陶杰
2024-11-01 c6f83537de95f3c5e591cd2eff90f1163f38f118
sub_pages/supplier/wallet/wallet-withdrao-deposit.vue
@@ -80,6 +80,9 @@
      },
      methods: {
          submitWithdraw(){
            this.$message.showLoading()
            // 防止多次重复点击
            this.protocal=false
            // 判断输入的金额是否是数字,需要真正则表达式,两位小数点
            this.$refs.uForm.validate().then(async res => {
               const resp = await this.$http.request('post', '/v2/withdraw-record', {
@@ -97,6 +100,8 @@
            }).catch(err => {
               console.log(err)
            }).finally(() => {
               this.$message.hideLoading()  // 关闭加载提示
            })
         },
@@ -107,12 +112,18 @@
                if (!value) {
                    return callback(new Error('请输入提现金额'));
                }
                if (!decimalRegex.test(value)) {
                    return callback(new Error('提现金额必须是有效的数字(最多两位小数)'));
                }
               // 提现金额要大于0
               if (value <= 0) {
                  return callback(new Error('提现金额必须大于0'));
               }
               if (value > this.wallet.withdrawableAmount) {
                  return callback(new Error('提现金额不能大于可提现金额'));
               }
               }
                callback();
            },