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"
@input="preventDecimalInput"
@keydown="onKeyDown"
dir="ltr"
inputmode="decimal"
/>
</div>
@ -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;

View File

@ -667,6 +667,8 @@
"
:value="cashOutAmount"
@input="handleCashOutAmountInput"
dir="ltr"
inputmode="decimal"
/>
</div>
@ -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;