From a0ea1ece4e3ffb728aee73e954d65a2209ebde32 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期三, 06 十一月 2024 17:51:45 +0800 Subject: [PATCH] 1.提现不能超过500 --- sub_pages/supplier/wallet/wallet-withdrao-deposit.vue | 26 +++++++++++++++++++++++--- 1 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue b/sub_pages/supplier/wallet/wallet-withdrao-deposit.vue index 0c983f5..1ad2586 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', { @@ -91,12 +94,18 @@ setTimeout(() => { uni.navigateBack() }, 1000) - } else { - this.$message.showToast(resp.msg) + }else{ + // if(resp&&resp.data&&resp.data[0]){ + // this.$message.showToast(resp.data[0].msg) + // } + this.$message.showToast("提现失败") } - }).catch(err => { + console.log(err) + + }).finally(() => { + this.$message.hideLoading() // 关闭加载提示 }) }, @@ -107,12 +116,23 @@ 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('提现金额不能大于可提现金额')); + } + // 提现金额不能大于500 + if (value > 500) { + return callback(new Error('提现金额不能大于500')); } + callback(); }, -- Gitblit v1.9.3