feat(充值代理页面、操作收益页): 针对阿语系统的数字输入框做限制西方阿拉伯数组的处理
This commit is contained in:
parent
ae07e871ec
commit
f164962c52
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user