混合支付

This commit is contained in:
唐明明
2023-03-17 15:57:43 +08:00
parent 9eb1f97e4c
commit 7de206c0a2
13 changed files with 395 additions and 75 deletions

View File

@@ -2,7 +2,11 @@
<view class="content">
<view class="block" v-if="banks.length > 0">
<view class="bank">
<view class="block-title">到账银行卡</view>
<!-- <view class="block-title">到账<text>{{type == 1 ? '本人': '非本人'}}</text>银行卡</view> -->
<view class="bank-tabs">
<view class="item" :class="{'active': type == 1}" @click="onTypeTab(1)">本人银行卡</view>
<view class="item" :class="{'active': type == 2}" @click="onTypeTab(2)">非本人银行卡</view>
</view>
<view class="bank-input">
<label>开户银行</label>
<picker class="banks-picker" :range="banks" range-key="name" :value="bankVal" @change="bankVal = $event.detail.value" :disabled="isDisabled" >
@@ -19,9 +23,9 @@
</view>
<view class="bank-input">
<label>持卡人姓名</label>
<input type="text" placeholder="输入开户人真实姓名" maxlength="15" disabled v-model="name">
<input type="text" placeholder="输入开户人真实姓名" maxlength="15" :disabled="isDisabled || type == 1" v-model="name">
</view>
<view class="bank-input">
<view class="bank-input" v-if="type === 2">
<label>身份证号</label>
<input type="idcard" placeholder="输入开户人身份证号" maxlength="18" v-model="idcard" :disabled="isDisabled">
</view>
@@ -40,6 +44,8 @@
<button class="cny-btn" :disabled="greater" @click="onSubmit">申请提现</button>
</view>
</view>
<!-- 提现提醒 -->
<view class="withdraws-hint">后台提现管理时间 上午11:00-12:00 下午17:00-18:00</view>
</view>
</template>
@@ -48,17 +54,22 @@
export default {
data() {
return {
type : 1,
banks : [],
bankVal : 0,
bankNo : '',
mobile : '',
name : '',
idcard : '',
identity : {
name : '',
id_card_no : ''
},
amount : '',
min : 0,
rate : 0,
balance : '0.00',
isDisabled : false
isDisabled : false,
};
},
@@ -73,29 +84,62 @@
mask : true
})
withdrawsCreate().then(res => {
let { bank, tax, min, balance, banks} = res;
let bankIndex
this.rate = tax
this.min = min
this.balance = balance
this.banks = [ { id: '', name: '请选择开户银行'}, ...banks ]
this.name = bank.name
if(bank.bank_no){
bankIndex = this.banks.findIndex(val => val.name === bank.bank_name)
let { bank, tax, min, balance, banks, id_card, has_bank} = res;
this.rate = tax
this.min = min
this.balance = balance
this.banks = [ { id: '', name: '请选择开户银行'}, ...banks ]
this.identity = id_card
this.type = bank.message_type
this.isDisabled = has_bank
this.name = id_card.name
this.idcard = id_card.id_card_no
if(has_bank){
let bankIndex = this.banks.findIndex(val => val.name === bank.bank_name)
this.bankNo = bank.bank_no
this.mobile = bank.mobile
this.bankVal = bankIndex >= 0 ? bankIndex : 0
this.isDisabled = true
}
uni.hideLoading()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
console.log(err)
uni.showModal({
content : err.message,
showCancel : false,
success : ModalRes => {
if(ModalRes.confirm){
this.$Router.back()
}
}
})
})
},
methods: {
onTypeTab(type){
if(type == this.type) return
if(this.isDisabled){
uni.showToast({
title: "银行卡信息已绑定,如需变更请联系系统管理员",
icon : "none"
})
return
}
if(type == 1){
this.name = this.identity.name
this.idcard = this.identity.id_card_no
}else{
this.name = ''
this.idcard = ''
}
this.type = type
},
onSubmit(){
if(this.bankVal === 0){
uni.showToast({
@@ -114,6 +158,8 @@
name : this.name,
mobileNo : this.mobile,
bank_no : this.bankNo,
id_card : this.idcard,
message_type: this.type,
}).then(res => {
uni.showModal({
title : '提示',
@@ -141,16 +187,40 @@
.content{
padding: 30rpx;
}
.withdraws-hint{
padding: 30rpx;
font-size: 30rpx;
color: gray;
}
.block{
background: white;
.block-title{
font-size: 30rpx;
color: gray;
line-height: 50rpx;
text{
color: $main-color;
margin: 0 5rpx;
}
}
.bank{
background: #fdfdfd;
padding: 50rpx;
.bank-tabs{
@extend .border-solid;
margin-bottom: 30rpx;
display: flex;
align-items: center;
line-height: 100rpx;
.item{
width: 50%;
text-align: center;
font-size: 30rpx;
&.active{
color: $main-color;
}
}
}
.bank-input{
display: flex;
justify-content: space-between;