Przeglądaj źródła

抽奖记录页面重构

kk.shi 3 lat temu
rodzic
commit
3f0a1d833c
2 zmienionych plików z 78 dodań i 205 usunięć
  1. 12 35
      pages/luckDraw/recordPrize.wxml
  2. 66 170
      pages/luckDraw/recordPrize.wxss

+ 12 - 35
pages/luckDraw/recordPrize.wxml

@@ -1,40 +1,17 @@
 <!--pages/luckDraw/recordPrize.wxml-->
-<view class="personal">
-  <!-- 中奖记录 -->
-  <view class="luck-draw-theme" catchtap="turnPrize">
-    <button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">请登录</button>
-    <!-- 奖品 -->
-    <view class="luck-draw-content" wx:for="{{userDrawItemList}}" wx:key="index" data-id="{{item.id}}">
-      <view class="luck-draw-words">
-        <view class="luck-draw-discount1">
-
-          <image class="luck-draw-zkz5" src="{{item.fullGoodsSmallImage}}" />
-        </view>
-        <view class="luck-draw-discount2">
-          <view class="luck-draw-zkz1">{{item.goodsName?item.goodsName:'未设置名称'}}</view>
-          <view class="luck-draw-zkz3">{{item.createTime}}</view>
-        </view>
-        <view class="coupon-jump" wx:if="{{item.isHit == 1}}">
-          <view class="coupon-right-usenow2">
-            <navigator class="btn_exchange" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" open-type='navigate'>
-            </navigator>
-          </view>
-        </view>
-      </view>
-
-      <!-- <view class="luck-draw-words1" wx:if="{{item.isHit != 1}}">
-          <view class="luck-draw-discount12">
-            
-            <image class="luck-draw-zkz52" src="{{item.fullGoodsSmallImage}}" />
-          </view>
-          <view class="luck-draw-discount2">
-            <view class="luck-draw-zkz1"><text decode="true">很遗憾!您没中奖&gt;&lt;</text></view>
-            <view class="luck-draw-zkz3">{{item.createTime}}</view>
-          </view>
-        </view> -->
+<button class="luck-draw-cz" wx:if="{{!isLogin}}" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">请登录</button>
+<view class="{{item.isHit == 1?'record flex-row':'no-record flex-row'}}" wx:for="{{userDrawItemList}}" wx:key="index" data-id="{{item.id}}">
+  <view class="record-content">
+    <view class="record-title over-ellipsis">{{item.goodsName?item.goodsName:'未设置名称'}}</view>
+    <view class="record-data flex-row">
+      <view class="record-data-time">{{item.createTime}}</view>
+      <navigator class="record-refund flex-row" wx:if="{{item.isHit == 1}}" target="miniProgram" app-id="wxd92a2d29f8022f40" path="pages/index/index" extra-data="{foo: 'bar'}" open-type='navigate'>
+        <view class="lower-record-text">立即使用</view>
+      </navigator>
     </view>
-    <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无抽奖记录 ————</view>
-    <view class="no_result" wx:if="{{noMore}}">———— 更多抽奖 | 敬请期待 ————</view>
+  </view>
+  <view class="record-img flex-column">
+    <image class="record-img-url" src="{{item.fullGoodsSmallImage}}"></image>
   </view>
 </view>
 

+ 66 - 170
pages/luckDraw/recordPrize.wxss

@@ -1,197 +1,93 @@
 /* pages/luckDraw/recordPrize.wxss */
-.personal{
-  width: 750rpx;
-  height: auto;
-  padding-bottom: 119rpx;
-}
-
-.luck-draw-coupon,.luck-draw-prize{
-  display: inline-block;
-  width: 50%;
-  height: 100%;
-}
-.luck-draw-cn,.luck-draw-cz,.luck-draw-pn,.luck-draw-pz,.luck-draw-cjh{
-  text-align: center;
-}
-.luck-draw-cn,.luck-draw-pn{
-  margin-top: 30rpx;
-  font-size: 36rpx;
-  font-family: Source Han Sans CN;
-  font-weight: 500;
-  color: #BF2637;
-}
-.luck-draw-cz,.luck-draw-pz{
-  font-size: 32rpx;
-  font-family: Source Han Sans CN;
-  font-weight: 400;
-  color: #303030;
-}
-.luck-draw-cj{
-  width: 78rpx;
-  height: 6rpx;
-  background: #BF2637;
-  border-radius: 4rpx;
-  margin: 10rpx auto;
-}
-
-.luck-draw-content{
-  width: 708rpx;
-  height: 190rpx;
-  position: relative;
-  margin: 0 auto 20rpx;
-}
-.image_zk{
-  width: 708rpx;
-  height: 190rpx;
-  position: absolute;
-  z-index: 1;
-  left: 0;
-  top: 0;
-}
-
-.image_zk_un{
-  display: inline-block;
-  width: 162rpx;
-  height: 56rpx;
-  position:absolute;
-  z-index: 2;
-  bottom: 70rpx;
-  right: 26rpx;
-}
-.luck-draw-discount1,.luck-draw-discount2,.luck-draw-zkz2,.luck-draw-djz4,.luck-draw-djz5{
-  display: inline-block;
-}
-.luck-draw-words{
-  position:relative;
-  z-index: 2;
-  width: 708rpx;
-  height: 190rpx;
+page{
+  background: #F7F7F7;
+  display:flex;
+  flex-flow: column nowrap;
+  justify-content: left;
+  align-items: center;
+  box-sizing: border-box;
+  padding-top: 22rpx;
+}
+/* 垂直方向布局,水平居中 **/
+.flex-column{
   display: flex;
-  flex-direction: row;
-  background: #FFFFFF;
-  border: 0.5rpx solid #FF7A03;
-  box-shadow: 0 0 50rpx 8rpx rgba(127, 127, 127, 0.09);
-  border-radius: 20rpx;
+  flex-flow: column nowrap;
+  align-items: center;
+  justify-content: left;
 }
 
-.luck-draw-words1{
-  position:relative;
-  z-index: 2;
-  width: 708rpx;
-  height: 190rpx;
+/* 水平方向布局,垂直居中 **/
+.flex-row{
   display: flex;
-  flex-direction: row;
-  background: #FFFFFF;
-  border: 0.5rpx solid #878787;
-  box-shadow: 0 0 50rpx 8rpx rgba(127, 127, 127, 0.09);
-  border-radius: 20rpx;
+  flex-flow: row nowrap;
+  align-items: center;
+  justify-content: center;
 }
 
-.luck-draw-discount1{
-  width: 214rpx;
-  height: 190rpx;
-  background: #FFE9B0;
-  border-right: 0.5rpx solid #FF7A03;
-  border-radius: 20rpx 0 0 20rpx;
-  text-align: center;
-}
-.luck-draw-discount12{
-  width: 214rpx;
-  height: 190rpx;
-  background: #F4F4F4;
-  border-right: 0.5rpx solid #878787;
-  border-radius: 20rpx 0 0 20rpx;
-  text-align: center;
-}
-
-.luck-draw-discount1 view:nth-child(1) {
-  position: relative;
-  top: 40rpx;
-}
-
-.luck-draw-discount2{
-  width: 300rpx;
-  height: 100%;
-}
-
-.luck-draw-zkz4{
-  font-size: 32rpx;
-  font-family: YouSheBiaoTiHei;
-  font-weight: 400;
-  color: #FF7A03;
-  line-height: 44rpx;
+.record{
+  width: 707rpx;
+  height: 203rpx;
+  background-image: url(https://dy.shpr.top/welfareGo/luck-draw.png);
+  background-size: 100% 100%;
+  justify-content: space-between;
+  margin-bottom: 19rpx;
 }
 
-.luck-draw-zkz42{
-  font-size: 28rpx;
-  font-family: YouSheBiaoTiHei;
-  font-weight: 400;
-  color: #888888;
-  line-height: 44rpx;
+.no-record{
+  width: 707rpx;
+  height: 203rpx;
+  background-image: url(https://dy.shpr.top/welfareGo/no-luck-draw.png);
+  background-size: 100% 100%;
+  justify-content: space-between;
+  margin-bottom: 19rpx;
 }
 
-.luck-draw-zkz5{
-  width: 100%;
-  height: 100%;
-  /* position: relative; */
-  /* top: 50rpx; */
+.record-title,.record-data{
+  padding-left: 49rpx;
 }
 
-.luck-draw-zkz52{
-  width: 84rpx;
-  height: 80rpx;
-  position: relative;
-  top: 55rpx;
+.record-data{
+  width: 400rpx;
+  justify-content: space-between;
+  margin-top: 45rpx;
 }
 
-.luck-draw-zkz1{
-  font-size: 32rpx;
-  font-family: Microsoft YaHei;
-  font-weight: 400;
-  color: #443E5B;
-  line-height: 32rpx;
-  margin-top: 48rpx;
-  margin-left: 48rpx;
-}
-.luck-draw-mj{
-  margin-left: 48rpx;
-  margin-top: 20rpx;
-  margin-bottom: 20rpx;
+.record-title{
+  width: 400rpx;
+  height: 40rpx;
+  font-size: 34rpx;
+  font-weight: bold;
+  color: #000000;
+  line-height: 30rpx;
 }
 
-.luck-draw-zkz3{
+.record-data-time{
   font-size: 26rpx;
-  font-family: Microsoft YaHei;
   font-weight: 400;
-  color: #443E5B;
-  line-height: 32rpx;
-  line-height: 32rpx;
-  margin-left: 48rpx;
-  margin-top: 30rpx;
+  color: #000000;
+  line-height: 30rpx;
 }
 
-.no_result {
-  font-size: 24rpx;
-  color: #B1B1B1;
-  text-align: center;
-  line-height: 100rpx;
-  font-weight: 1000;
+.record-img{
+  width: 202rpx;
+  height: 203rpx;
+  justify-content: center;
 }
 
-.coupon-jump{
-  width: 200rpx;
-  height: 190rpx;
+.record-img-url{
+  width: 178rpx;
+  height: 166rpx;
 }
 
-.coupon-right-usenow2{
-  width: 162rpx;
-  height: 56rpx;
-  background-image: url(https://dy.shpr.top/luckDraw/coupon_use_now.png);
-  background-size: 100% 100%;
-  margin-top: 35%;
+.record-refund{
+  width: 139rpx;
+  height: 40rpx;
+  border: 1px solid #B01717;
+  border-radius: 50rpx;
 }
 
-.btn_exchange{
-  width: 100%;
-  height: 100%;
-}
+.lower-record-text{
+  font-size: 22rpx;
+  font-weight: 500;
+  color: #B01717;
+}