From f164962c525b016e0adc3b55773a57c5dce03df4 Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Wed, 11 Feb 2026 19:25:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=85=85=E5=80=BC=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E3=80=81=E6=93=8D=E4=BD=9C=E6=94=B6=E7=9B=8A?= =?UTF-8?q?=E9=A1=B5):=20=E9=92=88=E5=AF=B9=E9=98=BF=E8=AF=AD=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=9A=84=E6=95=B0=E5=AD=97=E8=BE=93=E5=85=A5=E6=A1=86?= =?UTF-8?q?=E5=81=9A=E9=99=90=E5=88=B6=E8=A5=BF=E6=96=B9=E9=98=BF=E6=8B=89?= =?UTF-8?q?=E4=BC=AF=E6=95=B0=E7=BB=84=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/RechargeAgency/index.vue | 9 ++++- src/views/Wallet/availableIncome.vue | 52 ++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/views/RechargeAgency/index.vue b/src/views/RechargeAgency/index.vue index efcb322..3f42ca3 100644 --- a/src/views/RechargeAgency/index.vue +++ b/src/views/RechargeAgency/index.vue @@ -205,6 +205,8 @@ class="amount-input" @input="preventDecimalInput" @keydown="onKeyDown" + dir="ltr" + inputmode="decimal" /> @@ -596,7 +598,7 @@ const rechargeNow = async () => { t('transfer_success', { price: amount, name: selectedUser.value.name, - }) + }), ) // 重置表单 @@ -840,6 +842,11 @@ onMounted(() => {}) font-weight: 500; } +input[type='number'] { + font-family: 'Arial', sans-serif; /* 使用支持西方数字的字体 */ + direction: ltr; /* 强制从左到右 */ +} + .currency-suffix { position: absolute; right: 12px; diff --git a/src/views/Wallet/availableIncome.vue b/src/views/Wallet/availableIncome.vue index 142538f..bb32988 100644 --- a/src/views/Wallet/availableIncome.vue +++ b/src/views/Wallet/availableIncome.vue @@ -667,6 +667,8 @@ " :value="cashOutAmount" @input="handleCashOutAmountInput" + dir="ltr" + inputmode="decimal" /> @@ -878,13 +880,28 @@ const formattedAmount = (amount) => { //处理提现金额输入 const handleCashOutAmountInput = (event) => { - let value = parseFloat(event.target.value) + let value = event.target.value - if (value > availableBalance.value) { - value = availableBalance.value - event.target.value = value // 更新输入框的值 + // 只保留数字和小数点 + value = value.replace(/[^\d.]/g, '') + + // 防止多个小数点 + const parts = value.split('.') + if (parts.length > 2) { + value = parts[0] + '.' + parts.slice(1).join('') } - cashOutAmount.value = value // 更新 cashOutAmount 的值 + + // 如果输入值超过可用余额,则限制为最大值 + const numericValue = parseFloat(value) + if (numericValue > availableBalance.value) { + value = availableBalance.value.toString() + } + + // 更新输入框的值 + event.target.value = value + + // 更新 cashOutAmount 的值 + cashOutAmount.value = parseFloat(value) || 0 } // 获取提现信息列表 @@ -937,8 +954,8 @@ const fetchBankBalance = async () => { identityStore.identity == 'ADMIN' ? 'ADMIN_SALARY' : ['BD_LEADER', 'BD'].includes(identityStore.identity) - ? 'BD_SALARY' - : '' + ? 'BD_SALARY' + : '' try { const response = await apiGetBankBalance(salaryType) @@ -1044,15 +1061,15 @@ const transfer = async () => { identityStore.identity == 'ADMIN' ? 'ADMIN_SALARY' : ['BD_LEADER', 'BD'].includes(identityStore.identity) - ? 'BD_SALARY' - : '', + ? 'BD_SALARY' + : '', } try { const response = await apiTransfer(transferData) if (response.status) { showSuccess( - t('transfer_success', { price: selectedCoinData.price, name: selectedPayee.name }) + t('transfer_success', { price: selectedCoinData.price, name: selectedPayee.name }), ) selectedCoin.value = null await fetchBankBalance() // 刷新银行余额 @@ -1073,7 +1090,7 @@ const handleExchange = async () => { } const selectedOption = exchangeOptions.find( - (option) => option.id === selectedExchangeOption.value + (option) => option.id === selectedExchangeOption.value, ) console.log('当前身份:', identityStore.identity) @@ -1086,8 +1103,8 @@ const handleExchange = async () => { identityStore.identity == 'ADMIN' ? 'ADMIN_SALARY' : ['BD_LEADER', 'BD'].includes(identityStore.identity) - ? 'BD_SALARY' - : '', + ? 'BD_SALARY' + : '', }) if (response.status === true || response.errorCode === 0) { @@ -1118,8 +1135,8 @@ const Receive = async () => { identityStore.identity == 'ADMIN' ? 'ADMIN_SALARY' : ['BD_LEADER', 'BD'].includes(identityStore.identity) - ? 'BD_SALARY' - : '' + ? 'BD_SALARY' + : '' const resApply = await withdrawApply({ amount: cashOutAmount.value, @@ -1162,6 +1179,11 @@ input::placeholder { color: rgba(0, 0, 0, 0.4); } +input[type='number'] { + font-family: 'Arial', sans-serif; /* 使用支持西方数字的字体 */ + direction: ltr; /* 强制从左到右 */ +} + .transfer { width: 100vw; min-height: 100vh;