From ccf2da8e778882a96d9a4a8289412a518845f661 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Thu, 16 Apr 2026 21:18:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8F=90=E7=8E=B0=E9=A1=B5=E9=9D=A2):=20?= =?UTF-8?q?=E6=8F=90=E7=8E=B0=E8=BE=93=E5=85=A5=E6=A1=86=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=E5=8F=AA=E8=83=BD=E8=BE=93=E5=85=A5=E6=95=B4=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Wallet/CashOut/CashOut.vue | 16 +++++----------- src/views/Wallet/CashOut/CashWithdraw.vue | 16 +++++----------- src/views/Wallet/availableIncome.vue | 16 +++++----------- 3 files changed, 15 insertions(+), 33 deletions(-) diff --git a/src/views/Wallet/CashOut/CashOut.vue b/src/views/Wallet/CashOut/CashOut.vue index 800cadc..58d9cb4 100644 --- a/src/views/Wallet/CashOut/CashOut.vue +++ b/src/views/Wallet/CashOut/CashOut.vue @@ -598,26 +598,20 @@ const getWithdrawConfig = async () => { const handleCashOutAmountInput = (event) => { let value = event.target.value - // 只保留数字和小数点 - value = value.replace(/[^\d.]/g, '') - - // 防止多个小数点 - const parts = value.split('.') - if (parts.length > 2) { - value = parts[0] + '.' + parts.slice(1).join('') - } + // 只保留整数数字 + value = value.replace(/[^\d]/g, '') // 如果输入值超过可用余额,则限制为最大值 - const numericValue = parseFloat(value) + const numericValue = parseInt(value, 10) if (numericValue > availableBalance.value) { - value = availableBalance.value.toString() + value = Math.floor(Number(availableBalance.value)).toString() } // 更新输入框的值 event.target.value = value // 更新 cashOutAmount 的值 - cashOutAmount.value = parseFloat(value) || 0 + cashOutAmount.value = parseInt(value, 10) || 0 } // 获取提现信息列表 diff --git a/src/views/Wallet/CashOut/CashWithdraw.vue b/src/views/Wallet/CashOut/CashWithdraw.vue index aec7664..71c83cb 100644 --- a/src/views/Wallet/CashOut/CashWithdraw.vue +++ b/src/views/Wallet/CashOut/CashWithdraw.vue @@ -784,26 +784,20 @@ const getWithdrawConfig = async () => { const handleCashOutAmountInput = (event) => { let value = event.target.value - // 只保留数字和小数点 - value = value.replace(/[^\d.]/g, '') - - // 防止多个小数点 - const parts = value.split('.') - if (parts.length > 2) { - value = parts[0] + '.' + parts.slice(1).join('') - } + // 只保留整数数字 + value = value.replace(/[^\d]/g, '') // 如果输入值超过可用余额,则限制为最大值 - const numericValue = parseFloat(value) + const numericValue = parseInt(value, 10) if (numericValue > currentAmount.value) { - value = currentAmount.value.toString() + value = Math.floor(Number(currentAmount.value)).toString() } // 更新输入框的值 event.target.value = value // 更新 cashOutAmount 的值 - cashOutAmount.value = parseFloat(value) || 0 + cashOutAmount.value = parseInt(value, 10) || 0 } // 获取提现信息列表 diff --git a/src/views/Wallet/availableIncome.vue b/src/views/Wallet/availableIncome.vue index 12ecf92..b2b83bc 100644 --- a/src/views/Wallet/availableIncome.vue +++ b/src/views/Wallet/availableIncome.vue @@ -934,26 +934,20 @@ const formattedAmount = (amount) => { const handleCashOutAmountInput = (event) => { let value = event.target.value - // 只保留数字和小数点 - value = value.replace(/[^\d.]/g, '') - - // 防止多个小数点 - const parts = value.split('.') - if (parts.length > 2) { - value = parts[0] + '.' + parts.slice(1).join('') - } + // 只保留整数数字 + value = value.replace(/[^\d]/g, '') // 如果输入值超过可用余额,则限制为最大值 - const numericValue = parseFloat(value) + const numericValue = parseInt(value, 10) if (numericValue > availableBalance.value) { - value = availableBalance.value.toString() + value = Math.floor(Number(availableBalance.value)).toString() } // 更新输入框的值 event.target.value = value // 更新 cashOutAmount 的值 - cashOutAmount.value = parseFloat(value) || 0 + cashOutAmount.value = parseInt(value, 10) || 0 } // 获取提现信息列表