From c6f83537de95f3c5e591cd2eff90f1163f38f118 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期五, 01 十一月 2024 10:55:33 +0800 Subject: [PATCH] 1.钱包 --- sub_pages/supplier/wallet/wallet-withdrao-deposit.vue | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue b/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue index 0c983f5..a10245a 100644 --- a/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue +++ b/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(); }, -- Gitblit v1.9.3