diff --git a/src/views/RechargeAgency/index.vue b/src/views/RechargeAgency/index.vue index 3f42ca3..7b5d7a2 100644 --- a/src/views/RechargeAgency/index.vue +++ b/src/views/RechargeAgency/index.vue @@ -198,9 +198,6 @@ > { // 防止输入小数点的函数 const preventDecimalInput = (event) => { + let value = event.target.value + // 移除小数点和其他非整数字符 - event.target.value = event.target.value.replace(/[^0-9]/g, '') + value = value.replace(/[^0-9]/g, '') // 确保最小值为1 - if (event.target.value === '' || parseInt(event.target.value) < 1) { - event.target.value = '' + if (value === '' || parseInt(value) < 1) { + value = '' } - rechargeAmount.value = event.target.value + // 更新输入框的值 + event.target.value = value + + rechargeAmount.value = parseFloat(value) || 0 } // 键盘按下事件,阻止某些按键 diff --git a/src/views/Wallet/CashOut/CashOut.vue b/src/views/Wallet/CashOut/CashOut.vue index 1269bc5..1d722ca 100644 --- a/src/views/Wallet/CashOut/CashOut.vue +++ b/src/views/Wallet/CashOut/CashOut.vue @@ -301,8 +301,6 @@