Browse Source

添加次卡规则

yuhao 11 months ago
parent
commit
a9d21def8b

BIN
images/icon_up.png


+ 9 - 0
subPackages/pages/cardBag/cardBag.js

@@ -18,6 +18,8 @@ Page({
18 18
     storeId: wx.getStorageSync('store_id'),
19 19
     couponType: ['抵扣券', '满减券', '全额减免', '卡券'], //卡券类型 优惠券类型,1直接抵扣券,2满减券,3全额减免券,4卡券
20 20
     couponList: [], //优惠券列表
21
+    isExplain:false,//详情开关
22
+    explainIndex:0,
21 23
   },
22 24
 
23 25
   /**
@@ -201,6 +203,13 @@ Page({
201 203
       url: '/pages/shoppingMall/shoppingMall',
202 204
     })
203 205
   },
206
+    // 打开次卡说明
207
+    openExplain(e){
208
+      this.setData({
209
+        isExplain:!this.data.isExplain,
210
+        explainIndex:e.currentTarget.dataset.index
211
+      })
212
+    },
204 213
   /**
205 214
    * 生命周期函数--监听页面初次渲染完成
206 215
    */

+ 22 - 0
subPackages/pages/cardBag/cardBag.wxml

@@ -12,6 +12,7 @@
12 12
 <scroll-view wx:if="{{current==1}}" class="scroll" scroll-y bindscrolltolower="toLower" enable-flex="true">
13 13
     <view class="content">
14 14
       <view class="conItem" wx:for="{{list}}" data-status = '{{item.status}}' data-id="{{item.id}}" wx:key="index" bindtap="jumpCard" >
15
+      <view class="conItemTop">
15 16
         <view class="leftLine {{item.status!=1?'leftLineDe':''}}"></view>
16 17
         <view class="right">
17 18
           <view class="titleFrequency">
@@ -31,12 +32,23 @@
31 32
             <view class="toUse finish" wx:if="{{item.status==0}}">已使用</view>
32 33
             <view class="toUse finish" wx:if="{{item.status==-1}}">已过期</view>
33 34
             <view class="toUse finish" wx:if="{{item.status==-2}}">已注销</view>
35
+            <view class="explainIcon" data-index="{{index}}" catchtap="openExplain">
36
+                <image wx:if='{{isExplain&&explainIndex==index}}' src="../../../images/icon_up.png"></image>
37
+                <image wx:else src="../../../images/icon_arrow_gray.png"></image>
38
+              </view>
34 39
           </view>
35 40
         </view>
36 41
         <view class="cardBg">
37 42
           <image src="{{item.status!=1?'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220610/de_icon.png':'https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220610/cardBg.png'}}"></image>
38 43
         </view>
39 44
       </view>
45
+      <view class="explain" wx:if="{{isExplain&&explainIndex==index}}">
46
+        <view>使用说明:</view>
47
+        <view>1、请注意,此次卡或优惠券仅在规定的有效期限内有效。过期后将无法使用,请确保在有效期内充分利用。</view>
48
+        <view>2、此次卡或优惠券一经使用,将不退款、不找零、不兑换现金。并在使用前确认您的需求。</view>
49
+        <view>3、每位顾客仅限本人使用,以确保公平使用,请遵循相关规定。</view>
50
+      </view>
51
+      </view>
40 52
       <view class="loading" hidden="{{!loadMore}}">正在载入更多...</view>
41 53
       <view class="loading" hidden="{{!loadAll}}">已加载全部</view>
42 54
       <view class="no-data" style="display: {{list.length == 0 ? 'block' : 'none'}};">暂无数据~</view>
@@ -78,7 +90,17 @@
78 90
     <view class="coupon-redio" wx:if="{{item.status==2}}">
79 91
     已过期
80 92
     </view>
93
+    <view class="explainIcon" data-index="{{index}}" catchtap="openExplain">
94
+          <image wx:if='{{isExplain&&explainIndex==index}}' src="../../../images/icon_up.png"></image>
95
+          <image wx:else src="../../../images/icon_arrow_gray.png"></image>
96
+        </view>
81 97
     </view>
82 98
   </view>
83 99
   </view>
100
+  <view class="explain" wx:if="{{isExplain&&explainIndex==index}}">
101
+    <view>使用说明:</view>
102
+    <view>1、请注意,此次卡或优惠券仅在规定的有效期限内有效。过期后将无法使用,请确保在有效期内充分利用。</view>
103
+    <view>2、此次卡或优惠券一经使用,将不退款、不找零、不兑换现金。并在使用前确认您的需求。</view>
104
+    <view>3、每位顾客仅限本人使用,以确保公平使用,请遵循相关规定。</view>
105
+  </view>
84 106
 </view>

+ 28 - 4
subPackages/pages/cardBag/cardBag.wxss

@@ -64,16 +64,30 @@
64 64
 }
65 65
 
66 66
 .conItem{
67
+  margin: 40rpx 30rpx;
68
+}
69
+.conItem .conItemTop{
70
+  display: flex;
71
+  flex-direction: row;
67 72
   background-color: #FFF;
68 73
   border-radius: 16rpx;
69 74
   width: 690rpx;
70 75
   height: 154rpx;
71
-  flex-direction: row;
72
-  display: flex;
73
-  margin: 40rpx 30rpx;
74 76
   position: relative;
75 77
 }
76
-
78
+.explain{
79
+  margin: 0 auto;
80
+  margin-top: 10rpx;
81
+  background-color: #FFF;
82
+  border-radius: 16rpx;
83
+  width: 690rpx;
84
+  padding: 20rpx;
85
+  font-size: 20rpx;
86
+  box-sizing:border-box
87
+}
88
+.explain view{
89
+  margin-bottom: 10rpx;
90
+}
77 91
 .leftLine{
78 92
   background-color: #FA7D22;
79 93
   border-radius: 16rpx 0rpx 0rpx 16rpx;
@@ -256,6 +270,7 @@
256 270
 
257 271
 .coupon-right {
258 272
   flex: 1;
273
+  width: 400rpx;
259 274
   height: 100%;
260 275
   padding-left: 30rpx;
261 276
 }
@@ -362,4 +377,13 @@
362 377
   width: 99rpx;
363 378
   height: 38rpx;
364 379
   border-radius: 12px 0px 12px 0px;
380
+}
381
+.explainIcon{
382
+  z-index: 999;
383
+}
384
+.explainIcon image{
385
+  width: 54rpx;
386
+  height: 44rpx;
387
+  margin-left: 20rpx;
388
+  margin-top: 8rpx;
365 389
 }