提现输入 bug修改

This commit is contained in:
1154079537 2024-05-08 16:46:05 +08:00
parent 2f6ca46b15
commit 895ad285b1
2 changed files with 24 additions and 6 deletions

View File

@ -53,8 +53,8 @@
<view class="withdrawal-form-item">
<view class="withdrawal-form-item-label">提现金额</view>
<view class="withdrawal-form-item-val">
<input type="number" v-model="payForm.extract_money" placeholder="请输入提现金额"
placeholder-class="placeholderClass">
<input @input="onInput" type="number" placeholder="请输入提现金额"
placeholder-class="placeholderClass" :value="payForm.extract_money">
</view>
</view>
</view>
@ -96,7 +96,7 @@
<view class="withdrawal-form-item">
<view class="withdrawal-form-item-label">提现金额</view>
<view class="withdrawal-form-item-val">
<input type="number" v-model="payForm.extract_money" placeholder="请输入提现金额"
<input @input="onInput" type="number" placeholder="请输入提现金额" v-model="payForm.extract_money"
placeholder-class="placeholderClass">
</view>
</view>
@ -180,6 +180,7 @@
financial_type: 1,
withdrawal_pwd: "",
},
value: '12311',
mer_id: '',
ot_margin: '', //
extract_money: '', //
@ -201,6 +202,26 @@
},
methods: {
limitDecimalToTwo(input) {
console.log(input);
var regex = /^(\d+)?(\.\d{1,2})?$/;
var cleanInput = input.value.replace(regex, '$1$2');
if (cleanInput !== input.value) {
input.value = cleanInput;
};
},
//
onInput(e) {
let value = e.target.value;
// 使
value = value.replace(/^(\-)*(\d+)\.(\d{2}).*$/, '$1$2.$3');
this.$nextTick(() => {
this.payForm.extract_money = value;
})
this.$forceUpdate();
},
//
isShowAdd() {
if (this.bankList.length == 0) return true;

View File

@ -100,11 +100,8 @@
handleToUpdate(item) {
// , is_company =0
const isCompany = JSON.parse(this.$Cache.get("USER_INFO")).mer_info.is_company;
if (isCompany != 1 && item.is_own === 0) return;
let strUrl = "?mer_id=" + this.mer_id;
strUrl += "&id=" + item.id
uni.redirectTo({
url: "/pages/withdrawal/add" + strUrl
})