From ae43c2bc000691cbb8e3881298284b9256b00142 Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期二, 14 一月 2025 15:16:08 +0800
Subject: [PATCH] feat(支付):防止用户多次点击

---
 pay/scanpay.vue |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/pay/scanpay.vue b/pay/scanpay.vue
index eb489a4..e5f8719 100644
--- a/pay/scanpay.vue
+++ b/pay/scanpay.vue
@@ -166,6 +166,7 @@
   data() {
     return {
       tips: '璇ュ晢鎴锋殏鏈紑閫氭敮浠樺姛鑳�',
+      payLoading: false,
       loading: false,
       remark: '',
       buyerNote: '',
@@ -247,9 +248,6 @@
     }
   },
   onLoad(opt) {
-    uni.setStorageSync('CID', opt.cid)
-    uni.setStorageSync('SHOPID', opt.shopId)
-    uni.setStorageSync('AQCI', opt.activityQrcodeId)
     this.UNIONID = uni.getStorageSync('UNIONID') || null
     this.isNew = uni.getStorageSync('IS_NEW')
 
@@ -596,6 +594,8 @@
         return
       }
       this.bordShow = false
+      if (this.payLoading) return
+      this.payLoading = true
       // 閲戦 this.money
       uni.showLoading({
         title: '涓嬪崟涓�',
@@ -618,7 +618,7 @@
         params.cid = this.cid
       }
       if (this.onlineId) {
-        params = {payWay: this.payWay,onlineId: this.onlineId}
+        params.onlineId = this.onlineId
       }
       //鐢熸垚璁㈠崟
       saveOrder(params).then(res => {
@@ -641,6 +641,7 @@
           console.error(e);
         }
       }).catch(() => {
+        this.payLoading = false
         uni.hideLoading()
       })
     },
@@ -657,6 +658,7 @@
               "paySign": res.paySign //寰俊绛惧悕
             },
             (res) => {
+              this.payLoading = false
               if (res.err_msg == "get_brand_wcpay_request:ok") {
                 // 浣跨敤浠ヤ笂鏂瑰紡鍒ゆ柇鍓嶇杩斿洖,寰俊鍥㈤槦閮戦噸鎻愮ず锛�
                 //res.err_msg灏嗗湪鐢ㄦ埛鏀粯鎴愬姛鍚庤繑鍥瀘k锛屼絾骞朵笉淇濊瘉瀹冪粷瀵瑰彲闈犮��
@@ -674,6 +676,7 @@
       ap.tradePay({
         tradeNO: res.tradeNO
       }, (res) => {
+        this.payLoading = false
         if (res.resultCode == 9000) {
           uni.navigateTo({
             url: `/pay/paySuccess?orderId=${this.orderId}&youHuiInfo=${JSON

--
Gitblit v1.9.1