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