Преглед на файлове

优惠券页面动态调整

kk.shi преди 3 години
родител
ревизия
dda69f5439
променени са 4 файла, в които са добавени 45 реда и са изтрити 12 реда
  1. 1 2
      pages/signIn/activity/activity.json
  2. 2 3
      pages/signIn/record/record.js
  3. 19 7
      pages/signIn/record/record.wxml
  4. 23 0
      pages/signIn/record/record.wxss

+ 1 - 2
pages/signIn/activity/activity.json

@@ -1,5 +1,4 @@
 {
   "usingComponents": {},
-  "navigationStyle": "custom",
-  "navigationBarColor": "#fff"
+  "navigationStyle": "custom"
 }

+ 2 - 3
pages/signIn/record/record.js

@@ -39,7 +39,6 @@ Page({
         }).then(res => {
             if (res.code == 200) {
                 this.userCouponListView(res.data)
-                console.log(res)
             }
             this.data.lock = false
         }).catch(_ => {
@@ -71,10 +70,10 @@ Page({
             v.coupon.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
         })
 
-        this.data = this.data.concat(...data)
+        this.data.couponList = this.data.couponList.concat(...data)
         this.setData({
             // mobileTop:getMobileCache(),
-            couponList: this.data
+            couponList: this.data.couponList
         })
     },
 

+ 19 - 7
pages/signIn/record/record.wxml

@@ -26,22 +26,34 @@
     <!-- 主要内容 -->
     <view class="check-in-content flex-column">
       <!-- 优惠券内容 -->
-      <view class="coupon flex-row">
+      <view class="{{item.coupon.couponType == 'C'?'coupon flex-row':'coupon2 flex-row'}}" wx:for="{{couponList}}" wx:key="index" data-id="{{item.id}}">
         <view class="coupon-left flex-row">
-          <view class="coupon-left-symbol">¥</view>
-          <view class="coupon-left-num">1.09</view>
+          <!-- 代金券 -->
+          <view class="coupon-left-symbol" wx:if="{{item.coupon.couponType == 'C'}}">¥</view>
+          <view class="coupon-left-num" wx:if="{{item.coupon.couponType == 'C'}}">{{item.coupon.formatReduceCost ?item.coupon.formatReduceCost:0}}</view>
+          <!-- 折扣券 -->
+          <view class="coupon-left-num" wx:if="{{item.coupon.couponType == 'D'}}">{{item.coupon.formatDiscount ?item.coupon.formatDiscount:0}}</view>
+          <view class="coupon-left-symbol" wx:if="{{tem.coupon.couponType == 'D'}}">折</view>
         </view>
         <view class="coupon-center flex-column">
-          <view class="coupon-center-upper">圣诞活动代金券</view>
+          <view class="coupon-center-upper">{{item.coupon.couponTitle}}</view>
           <view class="coupon-center-bm flex-row">
             <view class="coupon-center-block1"></view>
-            <view class="coupon-center-middle">满199使用</view>
+            <view class="coupon-center-middle" wx:if="{{item.coupon.formatLeastCost == '0'}}">无门槛</view>
+            <view class="coupon-center-middle" wx:if="{{item.coupon.formatLeastCost != '0'}}">满{{item.coupon.formatLeastCost}}使用</view>
             <view class="coupon-center-block2"></view>
           </view>
-          <view class="coupon-center-lower">2021.10.10-2022.01.02</view>
+          <view class="coupon-center-lower">{{item.coupon.couponBeginTimestamp}}-{{item.coupon.couponEndTimestamp}}</view>
         </view>
         <view class="coupon-right">
-          <view class="coupon-right-usenow"></view>
+          <view class="{{item.coupon.couponType == 'C'?'coupon-right-usenow flex-row':'coupon-right-usenow2 flex-row'}}">
+            <navigator class="btn_exchange" 
+            target = "miniProgram" 
+            app-id="wxd92a2d29f8022f40"
+            path="page/index/index"
+            open-type='navigate'> 
+            </navigator>
+          </view>
         </view>
       </view>
       <!-- 获得明细 -->

+ 23 - 0
pages/signIn/record/record.wxss

@@ -93,6 +93,15 @@
   justify-content: left !important;
 }
 
+.coupon2{
+  width: 708rpx;
+  height: 220rpx;
+  background-image: url(https://dy.shpr.top/luckDraw/coupon.png);
+  background-size: 100% 100%;
+  margin-top: 30rpx;
+  justify-content: left !important;
+}
+
 .coupon-left{
   width: 110px;
   height: 100%;
@@ -179,6 +188,15 @@
   margin-left: -10px;
 }
 
+.coupon-right-usenow2{
+  width: 81px;
+  height: 28px;
+  background-image: url(https://dy.shpr.top/luckDraw/coupon_use_now.png);
+  background-size: 100% 100%;
+  margin-top: 47px;
+  margin-left: -10px;
+}
+
 .coupon-center-bm{
   width: 100px;
   height: 15px;
@@ -192,4 +210,9 @@
   margin: 0 10rpx;
 }
 
+.btn_exchange{
+  width: 100%;
+  height: 100%;
+}
+