Kaynağa Gözat

使用详情和积分问题

kk.shi 3 yıl önce
ebeveyn
işleme
ba62f27fd9

+ 6 - 0
pages/integral/exchange.js

@@ -110,4 +110,10 @@ Page({
        
     });
   },
+
+  toInstructions(){
+    wx.navigateTo({
+      url: '../integral/instructions'
+  })
+  }
 })

+ 7 - 1
pages/integral/exchange.wxml

@@ -14,7 +14,7 @@
       </view>
     </view>
     <view class="status" :style="item.order_status === 0 ? 'line-height: 168upx;' : 'line-height: 84upx;'">
-      <text class="status-text" style="color: rgb(245, 108, 108);">使用说明</text>
+      <text class="status-text" style="color: rgb(245, 108, 108);" catchtap="toInstructions">使用说明</text>
       <text class="status-text" style="color: rgb(51, 51, 51);">{{item.order_status === 1 ? '已使用' : item.order_status === 2 ? '已过期' : ''}}</text>
     </view>
   </view>
@@ -24,4 +24,10 @@
     <text>至</text>
     <text> {{item.end}}</text>
   </view>
+</view>
+
+<view class="card-img" wx:if="{{cardList.length === 0}}">
+  <view class="card-img-text">
+    <text>暂无卡券</text>
+  </view>
 </view>

+ 13 - 1
pages/integral/exchange.wxss

@@ -79,10 +79,22 @@ page {
 }
 
 .time {
-  width:750rpx;
+  width: 750rpx;
   height: 78rpx;
   line-height: 78rpx;
   font-size: 12px;
   color: #b1b1b1;
   font-weight: 600;
+}
+
+.card-img {
+  width: 750rpx;
+  text-align: center;
+}
+
+.card-img-text {
+  color: rgb(153, 153, 153);
+  font-size: 14px;
+  margin-top: 21px;
+  font-weight: bold;
 }

+ 66 - 0
pages/integral/instructions.js

@@ -0,0 +1,66 @@
+// pages/integral/instructions.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/integral/instructions.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "使用说明"
+}

+ 2 - 0
pages/integral/instructions.wxml

@@ -0,0 +1,2 @@
+<!--pages/integral/instructions.wxml-->
+<image src="https://dy.shpr.top/welfareGo/buyInfo1.png" mode="widthFix"></image>

+ 1 - 0
pages/integral/instructions.wxss

@@ -0,0 +1 @@
+/* pages/integral/instructions.wxss */

+ 31 - 18
pages/integral/integral.js

@@ -51,20 +51,6 @@ Page({
         title: '',
         status: false
     },
-    stepList:[
-        {
-          name:"下单时间",
-          status:"0"
-        },
-        {
-          name:"支付时间",
-          status:"0"
-        },
-        {
-          name:"降锁时间",
-          status:"1"//status步骤条状态。=1表示最后一条渲染不同样式
-        }
-      ]
   },
 
   /**
@@ -78,7 +64,6 @@ Page({
         setPhone: getMobileCache(),
         mobile: getMobileCache(),
     })
-    this.step = this.selectComponent("#step");
   },
 
   /**
@@ -93,9 +78,31 @@ Page({
    */
   onShow: function () {
     this.getBannerList()
-    this.getCouponList()
     if(getMobileCache() != ''){
-        this.getphoneClick()
+        Integralinfo.getBalance({
+            mobile: '13816922995', 
+            callbackUrl: '../integral/integral.wxml',
+            fingerprint: '',
+            sessionid: '',
+            shopid: 2,
+            type: 'wx',
+        }).then(arr => {
+            if (arr.code === '0000') {
+                var reg = /^(\d{3})\d{4}(\d{4})$/;
+                this.setData({
+                    isLogin: getMobileCache() != '',
+                    phone: getMobileCache() == ''?'********':getMobileCache().replace(reg, "$1****$2"),
+                    setPhone: getMobileCache(),
+                    mobile: getMobileCache(),
+                    integralNum: arr.data,
+                })
+                // 获取优惠券列表
+                this.getCouponList()
+            }
+        })
+    } else {
+        // 获取优惠券列表
+        this.getCouponList()
     }
   },
 
@@ -171,6 +178,7 @@ couponListView: function(data) {
         v.quantity = 0
         v.integral = v.price * v.ratio
     })
+    if (this.data.mobile != '********') {
         let num = this.data.integralNum > 20000 ? 19999 : this.data.integralNum
         const arr = []
         for (let i = 0; i < data.length; i++) {
@@ -189,7 +197,12 @@ couponListView: function(data) {
         this.setData({
             couponList: [...arr, ...data]
         })
-    console.log(this.data.couponList)
+    } else {
+        this.setData({
+            couponList: data
+        })
+    }
+    console.log(this.data.total)
  },
 // 点击标识点触发
 detailsClick(row) {