Quellcode durchsuchen

去支付防止重复提交

kk.shi vor 3 Jahren
Ursprung
Commit
bd0cd37e69
1 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 7 0
      pages/welfareMall/order/orderCompletion.js

+ 7 - 0
pages/welfareMall/order/orderCompletion.js

@@ -18,6 +18,7 @@ Page({
     hidden: true,
     reason: '',
     inputValue: '',
+    repeat: false,
   },
 
   /**
@@ -127,6 +128,10 @@ Page({
    */
   async goPay() {
       var that = this;
+      if(that.data.repeat){
+        return;
+      }
+      that.data.repeat = true;
       let result = await WelfareMall.getOrderParams(that.data.orderSn,wx.getStorageSync('loginInfo').openId);
       let res = result.data
       wx.requestPayment({
@@ -139,9 +144,11 @@ Page({
           //支付成功
           console.log(res);
           that.selectOrder(that.data.orderSn);
+          that.data.repeat = false;
         },
         fail: function (res) {
           console.log(res);
+          that.data.repeat = false;
         }
       })