From ae09f4f9699a7295075eb9e2d8fa4792449f0707 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Wed, 25 Sep 2024 17:47:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E6=8F=90=E7=8E=B0=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E5=8F=AA=E8=83=BD=E4=BF=9D=E7=95=99=E4=B8=80=E4=BD=8D?= =?UTF-8?q?=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle/pages/user_wallet/user_wallet_withdraw.vue | 10 ++++++++-- bundle/pages/user_withdraw/user_withdraw.vue | 7 ++++++- bundle_b/pages/subsidy_shop/subsidy_shop.vue | 7 ++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bundle/pages/user_wallet/user_wallet_withdraw.vue b/bundle/pages/user_wallet/user_wallet_withdraw.vue index c97a960..5e104d7 100644 --- a/bundle/pages/user_wallet/user_wallet_withdraw.vue +++ b/bundle/pages/user_wallet/user_wallet_withdraw.vue @@ -78,7 +78,7 @@ ¥ - @@ -183,12 +183,18 @@ const data = { ...this.form } - if (!data.money) { + if (!data.money || data.money == 0) { this.$toast({ title: '请输入提现金额' }); return; } + + const regex = /^[1-9]\d*(,\d{3})*(\.\d{1})?$|^0\.\d{1}$/; + if (!regex.test(data.money)) return this.$toast({ + title: '提现金额只保留一位小数' + }) + this.payMoney = data.money this.payInfo = '提现 ¥' + data.money + ' 到账户' this.showPay = true diff --git a/bundle/pages/user_withdraw/user_withdraw.vue b/bundle/pages/user_withdraw/user_withdraw.vue index 08a19f7..9102d14 100644 --- a/bundle/pages/user_withdraw/user_withdraw.vue +++ b/bundle/pages/user_withdraw/user_withdraw.vue @@ -183,13 +183,18 @@ }, startPay() { const data = {...this.form} - if (!data.money) { + if (!data.money || data.money == 0) { this.$toast({ title: '请输入提现金额' }); return; } + const regex = /^[1-9]\d*(,\d{3})*(\.\d{1})?$|^0\.\d{1}$/; + if (!regex.test(data.money)) return this.$toast({ + title: '提现金额只保留一位小数' + }) + this.payMoney = data.money this.payInfo = '分销佣金提现 ¥' + data.money + ' 到账户' this.showPay = true diff --git a/bundle_b/pages/subsidy_shop/subsidy_shop.vue b/bundle_b/pages/subsidy_shop/subsidy_shop.vue index 83e5e09..2f1aab4 100644 --- a/bundle_b/pages/subsidy_shop/subsidy_shop.vue +++ b/bundle_b/pages/subsidy_shop/subsidy_shop.vue @@ -17,7 +17,7 @@ ¥ - + @@ -200,6 +200,11 @@ return; } + const regex = /^[1-9]\d*(,\d{3})*(\.\d{1})?$|^0\.\d{1}$/; + if (!regex.test(data.withdrawl_money)) return this.$toast({ + title: '提现金额只保留一位小数' + }) + this.payMoney = data.withdrawl_money this.payInfo = '消费返补提现 ¥' + data.withdrawl_money; this.showPay = true