feat(充值代理页): 转账数额输入框取消小数点

This commit is contained in:
hzj 2025-12-22 10:48:36 +08:00
parent 7dc682188b
commit 38152de7c9

View File

@ -200,8 +200,11 @@
v-model="rechargeAmount" v-model="rechargeAmount"
type="number" type="number"
min="1" min="1"
step="1"
:placeholder="t('enter_recharge_amount')" :placeholder="t('enter_recharge_amount')"
class="amount-input" class="amount-input"
@input="preventDecimalInput"
@keydown="onKeyDown"
/> />
</div> </div>
@ -438,6 +441,27 @@ const Confirm = () => {
closedPopup() closedPopup()
} }
//
const preventDecimalInput = (event) => {
//
event.target.value = event.target.value.replace(/[^0-9]/g, '')
// 1
if (event.target.value === '' || parseInt(event.target.value) < 1) {
event.target.value = ''
}
rechargeAmount.value = event.target.value
}
//
const onKeyDown = (event) => {
// e+-
if (['.', 'e', '+', '-'].includes(event.key)) {
event.preventDefault()
}
}
// //
const checkDealerAccess = async () => { const checkDealerAccess = async () => {
try { try {