Browse Source

增加了确认框

wangning 5 years ago
parent
commit
c7b8edac5a
1 changed files with 20 additions and 10 deletions
  1. 20 10
      hdApp/src/pagesPurchase/gathering.vue

+ 20 - 10
hdApp/src/pagesPurchase/gathering.vue

@@ -183,17 +183,27 @@ export default {
     batchConfirm () {
       let arr = []
       if (this.selectList.length > 0) {
-        this.selectList.forEach(item => {
-          arr.push(item.id)
-        })
-        purchaseClearCreateOrder({ purchaseIds:arr.join(','),ghsId:this.option.id }).then(res => {
-          console.log('res ===>', res)
-          if(res.code == 1) {
-            uni.navigateTo({
-              url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice
-            })
+      uni.showModal({
+          content: '确定付款?',
+          success: (res) => {
+            if (res.confirm) {
+              
+                this.selectList.forEach(item => {
+                  arr.push(item.id)
+                })
+                purchaseClearCreateOrder({ purchaseIds:arr.join(','),ghsId:this.option.id }).then(res => {
+                  console.log('res ===>', res)
+                  if(res.code == 1) {
+                    uni.navigateTo({
+                      url: '/pagesPurchase/gatherPay?orderSn=' + res.data.orderSn + '&actPrice=' + res.data.actPrice
+                    })
+                  }
+                }).catch(err => {console.log('err===>', err)})
+            } else if (res.cancel) {
+              console.log('用户点击取消');
+            }
           }
-        }).catch(err => {console.log('err===>', err)})
+        })
       }
     },
     // 返回上一页