浏览代码

Merge branch 'skk/feat/welfare-mall' into jeffrey/feat/coupon-center

xing.li 3 年之前
父节点
当前提交
aa0e32273b

+ 1 - 7
pages/welfareMall/historical/historical.js

@@ -21,13 +21,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.setData({
-      isLogin: getMobileCache() != ''
-    })
-    if(this.data.isLogin){
-        this.getOrderList();
-    }
-
+    this.getOrderList();
   },
 
   // 订单数据

+ 6 - 15
pages/welfareMall/order/orderCompletion.js

@@ -113,15 +113,10 @@ Page({
    * 获取订单参数
    */
   async goPay() {
-      let res = await WelfareMall.getPayParams({
-        mobile: getMobileCache(),
-        orderSn: this.data.orderSn,
-        openId: wx.getStorageSync('loginInfo').openId,
-        thirdPartyName: 'coupon-activity',
-        payCode: "HSAY-COUPON",
-      });
+    console.log(wx.getStorageSync('loginInfo').openId)
+      let result = await WelfareMall.getOrderParams(this.data.orderSn,wx.getStorageSync('loginInfo').openId);
       console.log(res);
-      // res = res.wxPrePayVo
+      let res = result.data
       wx.requestPayment({
         timeStamp: res.wxPrePayVo.timeStamp,
         package: res.wxPrePayVo.pack,
@@ -129,13 +124,11 @@ Page({
         signType: res.wxPrePayVo.signType,
         paySign: res.wxPrePayVo.paySign,
         success: function (res) {
-          //支付成功,跳转领取成功页面
-          wx.reLaunch({
-            url: '/pages/couponSuccess/couponSuccess'
-          })
+          //支付成功
+          console.log(res);
+          this.onLoad(this.options);
         },
         fail: function (res) {
-          console.log('payerror')
           console.log(res);
         }
       })
@@ -207,11 +200,9 @@ Page({
               url
           })
         }
-        this.data.lock = false
     }).catch(_ => {
         console.log(_)
         this.cancel();
-        this.data.lock = false
     })
     
   },

+ 12 - 16
pages/welfareMall/personal/personal.js

@@ -19,11 +19,18 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: async function (options) {
-    await this.getUserPhone();
-    this.setData({
-      isLogin: getMobileCache() != '',
-      mobileTop: getMobileCache(),
-    })
+    let  userMobile = await activity.getMobileCache();
+    console.log(userMobile)
+    if (userMobile.length !== 0) {
+      this.setData({
+        isLogin: true,
+        mobileTop: userMobile,
+      })
+    }
+    // this.setData({
+    //   isLogin: getMobileCache() != '',
+    //   mobileTop: getMobileCache(),
+    // })
 
     if(this.data.isLogin){
       let nums = await this.getCountNum();
@@ -34,17 +41,6 @@ Page({
 
   },
 
-  /**
-   * 获取用户信息
-   */
-  getUserPhone: async function(){
-    await WelfareMall.getUser({
-      openid: activity.getOpenId(),
-      source:'FREE_MINI_APP',
-    });
-
-  },
-
   getCountNum: async function(){
   /**
    * 福利社

+ 3 - 3
pages/welfareMall/refund/refund.js

@@ -36,13 +36,13 @@ Page({
    */
   onLoad: function (options) {
     var that = this;
-    that.orderSn = options.ordersn;
+    that.orderSn = options.orderSn;
     this.setData({
-      orderSn: options.ordersn,
+      orderSn: options.orderSn,
     })
       this.getRefundOrderStatus(that.orderSn);
       this.getOrder(that.orderSn);
-      this.data.orderSn = options.ordersn;
+      this.data.orderSn = options.orderSn;
   },
 
   /**

+ 3 - 3
project.config.json

@@ -4,7 +4,7 @@
     "ignore": []
   },
   "setting": {
-    "urlCheck": true,
+    "urlCheck": false,
     "es6": true,
     "enhance": true,
     "postcss": false,
@@ -31,7 +31,7 @@
       "outputPath": ""
     },
     "enableEngineNative": false,
-    "useIsolateContext": false,
+    "useIsolateContext": true,
     "userConfirmedBundleSwitch": false,
     "packNpmManually": false,
     "packNpmRelationList": [],
@@ -42,7 +42,7 @@
     "useCompilerPlugins": false
   },
   "compileType": "miniprogram",
-  "libVersion": "2.19.6",
+  "libVersion": "2.21.0",
   "appid": "wxcc1cdb8babd3f62c",
   "projectname": "%E9%A3%9E%E7%A0%81",
   "debugOptions": {