feat(充值代理页面、操作收益页): 针对阿语系统的数字输入框做限制西方阿拉伯数组的处理

This commit is contained in:
hzj 2026-02-11 19:25:52 +08:00
parent ae07e871ec
commit f164962c52
2 changed files with 45 additions and 16 deletions

View File

@ -205,6 +205,8 @@
class="amount-input" class="amount-input"
@input="preventDecimalInput" @input="preventDecimalInput"
@keydown="onKeyDown" @keydown="onKeyDown"
dir="ltr"
inputmode="decimal"
/> />
</div> </div>
@ -596,7 +598,7 @@ const rechargeNow = async () => {
t('transfer_success', { t('transfer_success', {
price: amount, price: amount,
name: selectedUser.value.name, name: selectedUser.value.name,
}) }),
) )
// //
@ -840,6 +842,11 @@ onMounted(() => {})
font-weight: 500; font-weight: 500;
} }
input[type='number'] {
font-family: 'Arial', sans-serif; /* 使用支持西方数字的字体 */
direction: ltr; /* 强制从左到右 */
}
.currency-suffix { .currency-suffix {
position: absolute; position: absolute;
right: 12px; right: 12px;

View File

@ -667,6 +667,8 @@
" "
:value="cashOutAmount" :value="cashOutAmount"
@input="handleCashOutAmountInput" @input="handleCashOutAmountInput"
dir="ltr"
inputmode="decimal"
/> />
</div> </div>
@ -878,13 +880,28 @@ const formattedAmount = (amount) => {
// //
const handleCashOutAmountInput = (event) => { const handleCashOutAmountInput = (event) => {
let value = parseFloat(event.target.value) let value = event.target.value
if (value > availableBalance.value) { //
value = availableBalance.value value = value.replace(/[^\d.]/g, '')
event.target.value = value //
//
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
} }
// //
@ -1052,7 +1069,7 @@ const transfer = async () => {
const response = await apiTransfer(transferData) const response = await apiTransfer(transferData)
if (response.status) { if (response.status) {
showSuccess( showSuccess(
t('transfer_success', { price: selectedCoinData.price, name: selectedPayee.name }) t('transfer_success', { price: selectedCoinData.price, name: selectedPayee.name }),
) )
selectedCoin.value = null selectedCoin.value = null
await fetchBankBalance() // await fetchBankBalance() //
@ -1073,7 +1090,7 @@ const handleExchange = async () => {
} }
const selectedOption = exchangeOptions.find( const selectedOption = exchangeOptions.find(
(option) => option.id === selectedExchangeOption.value (option) => option.id === selectedExchangeOption.value,
) )
console.log('当前身份:', identityStore.identity) console.log('当前身份:', identityStore.identity)
@ -1162,6 +1179,11 @@ input::placeholder {
color: rgba(0, 0, 0, 0.4); color: rgba(0, 0, 0, 0.4);
} }
input[type='number'] {
font-family: 'Arial', sans-serif; /* 使用支持西方数字的字体 */
direction: ltr; /* 强制从左到右 */
}
.transfer { .transfer {
width: 100vw; width: 100vw;
min-height: 100vh; min-height: 100vh;