['红包提现,红包转化默认值处理优化']

This commit is contained in:
2021-11-23 10:59:20 +08:00
parent 4611cb984e
commit 02a59e7720
2 changed files with 26 additions and 17 deletions

View File

@@ -14,9 +14,10 @@
<view class="item"> <view class="item">
<view style="flex: 1;"> <view style="flex: 1;">
<view class="inputTxt">提现数量</view> <view class="inputTxt">提现数量</view>
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number" <input class="input_num" ref='inputNumber' v-model="withdraw_input" @input='inputNum'
placeholder-style="color:#999;font-weight:normal; font-size:34rpx;" :value="withdraw_input" type="number"
placeholder="请输入提现数量" :disabled="balance===0" /> placeholder-style="color:#999;font-weight:normal; font-size:34rpx;" placeholder="请输入提现数量"
:disabled="balance===0" />
</view> </view>
<view class="all" @click="all">全部提现</view> <view class="all" @click="all">全部提现</view>
</view> </view>
@@ -44,7 +45,7 @@
withdraw_input: '', // 提现通证数量 withdraw_input: '', // 提现通证数量
bank_accounts: 0, bank_accounts: 0,
bankInfo: {}, bankInfo: {},
certification:false,//默认没有认证 certification: false, //默认没有认证
}; };
}, },
onLoad() { onLoad() {
@@ -60,10 +61,10 @@
// 提现基本信息 // 提现基本信息
getInfo() { getInfo() {
cashsCreate().then(res => { cashsCreate().then(res => {
this.withdraw_input = Number(res.balance) // this.withdraw_input = Number(res.balance)
this.balance = res.balance this.balance = res.balance
this.cost = res.cost this.cost = res.cost
this.total = Number(res.balance) * Number(res.cost) // this.total = Number(res.balance) * Number(res.cost)
this.certification = res.certification this.certification = res.certification
uni.setStorageSync('refresh', false) uni.setStorageSync('refresh', false)
}).catch(err => { }).catch(err => {
@@ -73,6 +74,7 @@
}) })
}) })
}, },
// 输入提现通证数量 // 输入提现通证数量
inputNum(e) { inputNum(e) {
let number = Number(e.detail.value) let number = Number(e.detail.value)
@@ -92,10 +94,13 @@
uni.showToast({ uni.showToast({
title: '最大值能超过' + this.balance + '', title: '最大值能超过' + this.balance + '',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000,
mask: true
}); });
this.$nextTick(() => {
this.withdraw_input = this.balance this.withdraw_input = this.balance
this.total = this.balance * this.cost this.total = this.balance * this.cost
})
} }
} }
}, },
@@ -106,7 +111,7 @@
this.total = this.balance * this.cost this.total = this.balance * this.cost
} else { } else {
uni.showToast({ uni.showToast({
title: '啥也没有,我也做不到~', title: '请核对提现金额~',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
@@ -145,7 +150,7 @@
} }
uni.showModal({ uni.showModal({
title: '温馨提示', title: '温馨提示',
content:'您是否确认提现到现金红包账户,交易将免手续费', content: '您是否确认提现到现金红包账户,交易将免手续费',
confirmColor: '#7c52fc', confirmColor: '#7c52fc',
cancelColor: '#cacaca', cancelColor: '#cacaca',
cancelText: '我再想想', cancelText: '我再想想',

View File

@@ -23,7 +23,7 @@
<view class="item"> <view class="item">
<view style="flex: 1;"> <view style="flex: 1;">
<view class="inputTxt">提现金额</view> <view class="inputTxt">提现金额</view>
<input class="input_num" v-model="withdraw_input" @input='inputNum' type="number" placeholder-style="color:#999;font-weight:normal; font-size:34rpx;" placeholder="请输入提现金额" :disabled="balance===0" /> <input class="input_num" ref='inputNuber' v-model="withdraw_input" @input='inputNum' type="number" placeholder-style="color:#999;font-weight:normal; font-size:34rpx;" placeholder="请输入提现金额" :disabled="balance===0" />
</view> </view>
<view class="all" @click="all">全部提现</view> <view class="all" @click="all">全部提现</view>
</view> </view>
@@ -96,7 +96,7 @@
this.balance = res.balance this.balance = res.balance
this.tax = res.tax this.tax = res.tax
this.bank_accounts = res.bank_accounts.length this.bank_accounts = res.bank_accounts.length
this.withdraw_input = Number(res.balance) // this.withdraw_input = Number(res.balance)
this.certification = res.certification this.certification = res.certification
uni.setStorageSync('refresh', false) uni.setStorageSync('refresh', false)
}).catch(err => { }).catch(err => {
@@ -117,16 +117,20 @@
uni.showToast({ uni.showToast({
title: '当前不能提现', title: '当前不能提现',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000,
mask: true
}); });
this.withdraw_input = 0 this.withdraw_input = 0
} else { } else {
uni.showToast({ uni.showToast({
title: '最大值能超过' + this.balance + '', title: '最大值能超过' + this.balance + '',
icon: 'none', icon: 'none',
duration: 2000 duration: 2000,
mask: true
}); });
this.$nextTick(() => {
this.withdraw_input = this.balance this.withdraw_input = this.balance
})
} }
} }
}, },