石广澎
2025-01-14 ae43c2bc000691cbb8e3881298284b9256b00142
feat(支付):防止用户多次点击
1个文件已修改
6 ■■■■■ 已修改文件
pay/scanpay.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pay/scanpay.vue
@@ -166,6 +166,7 @@
  data() {
    return {
      tips: '该商户暂未开通支付功能',
      payLoading: false,
      loading: false,
      remark: '',
      buyerNote: '',
@@ -593,6 +594,8 @@
        return
      }
      this.bordShow = false
      if (this.payLoading) return
      this.payLoading = true
      // 金额 this.money
      uni.showLoading({
        title: '下单中',
@@ -638,6 +641,7 @@
          console.error(e);
        }
      }).catch(() => {
        this.payLoading = false
        uni.hideLoading()
      })
    },
@@ -654,6 +658,7 @@
              "paySign": res.paySign //微信签名
            },
            (res) => {
              this.payLoading = false
              if (res.err_msg == "get_brand_wcpay_request:ok") {
                // 使用以上方式判断前端返回,微信团队郑重提示:
                //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
@@ -671,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