xiabx 5 лет назад
Родитель
Сommit
6e364bdd6d
2 измененных файлов с 43 добавлено и 19 удалено
  1. 2 2
      src/manifest.json
  2. 41 17
      src/views/Pay/index.ux

+ 2 - 2
src/manifest.json

@@ -1,8 +1,8 @@
 {
   "package": "com.beidao.kuaiying.zsy",
   "name": "追书云",
-  "versionName": "1.0.4",
-  "versionCode": "5",
+  "versionName": "1.0.5",
+  "versionCode": "6",
   "minPlatformVersion": "1020",
   "icon": "/assets/imgs/logo.png",
   "features": [

+ 41 - 17
src/views/Pay/index.ux

@@ -99,6 +99,7 @@ export default {
     isInPay: false,
     showLoading: false,
     checked: false,
+    phone: '',
     payType: [
       {
         name: "支付宝",
@@ -124,12 +125,8 @@ export default {
     let userinfo = await getUserInfo();
     this.balance = userinfo.balance;
     this.send_order_id = userinfo.send_order_id;
-    if (userinfo.is_check) {
-      router.push({
-        uri: '/views/Phone'
-      })
-    }
-
+    this.checked = userinfo.is_check;
+    this.phone = userinfo.phone;
   },
   async initChargeList() {
     this.rechargeList = await getChargeList();
@@ -141,18 +138,43 @@ export default {
     })
   },
   async toPay() {
-    let cur_pay_type = this.curPayType;
-    let product_id = this.rechargeList[this.curSelect].product_id;
-    let ret = null;
-    if (cur_pay_type === 1) {
-      ret = await configAliPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
-    }
-    else {
-      ret = await configWxPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
+    if (this.checked && !this.phone) {
+      prompt.showDialog({
+        title: '友情提示',
+        message: '您还未绑定手机号,请绑定手机号后在进行相关操作',
+        buttons: [
+          {
+            text: '前往绑定',
+            color: '#33dd44'
+          }
+        ],
+        success: function (data) {
+          router.push({
+            uri: '/views/Phone'
+          })
+        },
+        cancel: function () {
+          console.log('取消绑定')
+        },
+
+      })
+
+    } else {
+      let cur_pay_type = this.curPayType;
+      let product_id = this.rechargeList[this.curSelect].product_id;
+      let ret = null;
+      if (cur_pay_type === 1) {
+        ret = await configAliPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
+      }
+      else {
+        ret = await configWxPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
+      }
+      // 成功支付后的回调操作
+      if (ret.code === "9000") this.showWaitingWrap(ret);
+      else this.showToastByCode(ret.code);
     }
-    // 成功支付后的回调操作
-    if (ret.code === "9000") this.showWaitingWrap(ret);
-    else this.showToastByCode(ret.code);
+
+
   },
   checkOrder(order_info) {
     this.showLoading = true;
@@ -209,6 +231,8 @@ export default {
   },
   onInit() {
     this.initChargeList();
+  },
+  onShow() {
     this.getUserInfo();
   },
   onHide() {