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