2025-03-23 09:29:40 +08:00
|
|
|
|
<!--
|
2025-06-09 14:39:09 +08:00
|
|
|
|
* @Descripttion:
|
|
|
|
|
* @version:
|
2025-03-23 09:29:40 +08:00
|
|
|
|
* @Author: kBank
|
|
|
|
|
* @Date: 2022-11-21 15:11:22
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<view class="content">
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<view class="index_header"> </view>
|
2025-03-23 09:29:40 +08:00
|
|
|
|
<view class="contxt">
|
|
|
|
|
<view class="kuang">
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<u-form :model="form" labelWidth="auto" :rules="rules" ref="uForm">
|
|
|
|
|
<u-form-item :label="'银行卡号'" required prop="bankNo">
|
|
|
|
|
<u-input v-model="form.bankNo" :placeholder="'请输入银行卡卡号'" />
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</u-form-item>
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<u-form-item :label="'姓名'" required prop="name">
|
|
|
|
|
<u-input v-model="form.name" :placeholder="'请输入姓名'" />
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</u-form-item>
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<u-form-item :label="'身份证'" required prop="idCard">
|
|
|
|
|
<u-input v-model="form.idCard" :placeholder="'请输入身份证号码'" />
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</u-form-item>
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<u-form-item :label="'手机号'" required prop="phone">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="form.phone"
|
|
|
|
|
maxlength="20"
|
|
|
|
|
type="number"
|
|
|
|
|
:placeholder="'请输入银行预留手机号'"
|
|
|
|
|
/>
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="有效期">
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<u-input v-model="form.validdate" :placeholder="'请输入'" />
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="安全码">
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<u-input v-model="form.cvv2" :placeholder="'请输入'" />
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</u-form-item>
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<u-form-item :label="'验证码'" required prop="smsCode">
|
|
|
|
|
<u-input v-model="form.smsCode" :placeholder="'请输入验证码'">
|
2025-03-23 09:29:40 +08:00
|
|
|
|
<template slot="suffix">
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<view class="getCode" @tap="submitForm">{{ getCode }}</view>
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</template>
|
|
|
|
|
</u-input>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-form>
|
2025-06-09 14:39:09 +08:00
|
|
|
|
<div class="tips" v-if="bank == 'hf'">
|
|
|
|
|
<p>1、目前汇付支付支持绑定信用卡、储蓄卡</p>
|
|
|
|
|
<p>2、当绑定信用卡时,“安全码”、“有效期”两栏为必填项</p>
|
|
|
|
|
<p>3、安全码为信用卡背面签名栏后3位数字;</p>
|
|
|
|
|
<p>4、信用卡有效期格式不加/,例信用卡有效期10/24,请输入:1024</p>
|
|
|
|
|
</div>
|
|
|
|
|
<u-button
|
|
|
|
|
type="success"
|
|
|
|
|
class="uBtn"
|
|
|
|
|
shape="circle"
|
|
|
|
|
color="linear-gradient(to right, #005BAC, #005BAC )"
|
|
|
|
|
:loading="isLoading"
|
|
|
|
|
:loadingText="'绑定中'"
|
|
|
|
|
@click="toBind"
|
|
|
|
|
>{{ '立即绑定' }}</u-button
|
|
|
|
|
>
|
2025-03-23 09:29:40 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import * as pay from '@/config/pay.js'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
form: {
|
|
|
|
|
bankNo: '',
|
|
|
|
|
},
|
|
|
|
|
isLoading: false,
|
2025-04-01 21:35:18 +08:00
|
|
|
|
getCode: '获取验证码',
|
2025-03-23 09:29:40 +08:00
|
|
|
|
isSend: false,
|
|
|
|
|
beginTime: 60,
|
|
|
|
|
bankCode: '',
|
|
|
|
|
timer: '',
|
|
|
|
|
bank: '',
|
|
|
|
|
rules: {
|
|
|
|
|
bankNo: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
2025-04-01 21:35:18 +08:00
|
|
|
|
message: '请输入银行卡卡号',
|
2025-03-23 09:29:40 +08:00
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
idCard: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
2025-04-01 21:35:18 +08:00
|
|
|
|
message: '请输入身份证号码',
|
2025-03-23 09:29:40 +08:00
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
phone: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
2025-05-22 17:47:14 +08:00
|
|
|
|
message: '请输入手机号',
|
|
|
|
|
trigger: ['blur'],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
validator: (rule, value, callback) => {
|
|
|
|
|
return this.$u.test.mobile(value)
|
|
|
|
|
},
|
|
|
|
|
message: '手机号格式不正确',
|
|
|
|
|
trigger: ['blur'],
|
2025-03-23 09:29:40 +08:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
name: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
2025-04-01 21:35:18 +08:00
|
|
|
|
message: '请输入姓名',
|
2025-03-23 09:29:40 +08:00
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
this.bank = options.bank
|
|
|
|
|
// this.getInfo()
|
|
|
|
|
},
|
|
|
|
|
onShow() {},
|
|
|
|
|
methods: {
|
|
|
|
|
toBind() {
|
|
|
|
|
if (!this.bankCode) {
|
|
|
|
|
uni.showToast({
|
2025-04-01 21:35:18 +08:00
|
|
|
|
title: '请输入验证码',
|
2025-03-23 09:29:40 +08:00
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 1500,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let url = ''
|
|
|
|
|
if (this.bank == 'tl') {
|
|
|
|
|
url = pay.bindTlConfirm
|
|
|
|
|
} else if (this.bank == 'jd') {
|
|
|
|
|
url = pay.bindJdConfirm
|
|
|
|
|
} else if (this.bank == 'hf') {
|
|
|
|
|
url = pay.bindHfConfirm
|
|
|
|
|
}
|
|
|
|
|
url({
|
|
|
|
|
bindCode: this.bankCode,
|
|
|
|
|
smsCode: this.form.smsCode,
|
2025-06-09 14:39:09 +08:00
|
|
|
|
}).then(res => {
|
2025-03-23 09:29:40 +08:00
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
uni.showToast({
|
2025-04-01 21:35:18 +08:00
|
|
|
|
title: '绑卡成功',
|
2025-03-23 09:29:40 +08:00
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 1500,
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
}, 1500)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
areBothValuesSet(val1, val2) {
|
|
|
|
|
return (
|
|
|
|
|
((val1 === null || val1 === undefined || val1 === '') &&
|
|
|
|
|
(val2 === null || val2 === undefined || val2 === '')) ||
|
|
|
|
|
(val1 !== null &&
|
|
|
|
|
val1 !== undefined &&
|
|
|
|
|
val1 !== '' &&
|
|
|
|
|
val2 !== null &&
|
|
|
|
|
val2 !== undefined &&
|
|
|
|
|
val2 !== '')
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
// 绑卡获取验证码
|
|
|
|
|
submitForm() {
|
2025-06-09 14:39:09 +08:00
|
|
|
|
this.$refs.uForm.validate().then(res => {
|
2025-03-23 09:29:40 +08:00
|
|
|
|
if (!this.areBothValuesSet(this.form.validdate, this.form.cvv2)) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '请输入安全码及有效期',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 1500,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
for (let key in this.form) {
|
|
|
|
|
if (this.form[key] == '') {
|
|
|
|
|
delete this.form[key]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.startTime()
|
|
|
|
|
let url = ''
|
|
|
|
|
if (this.bank == 'tl') {
|
|
|
|
|
url = pay.bindTl
|
|
|
|
|
} else if (this.bank == 'jd') {
|
|
|
|
|
url = pay.bindJd
|
|
|
|
|
} else if (this.bank == 'hf') {
|
|
|
|
|
url = pay.bindHf
|
|
|
|
|
}
|
2025-06-09 14:39:09 +08:00
|
|
|
|
url(this.form).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
2025-03-23 09:29:40 +08:00
|
|
|
|
this.bankCode = res.data
|
2025-06-09 14:39:09 +08:00
|
|
|
|
} else {
|
2025-03-23 09:29:40 +08:00
|
|
|
|
this.beginTime = 0
|
2025-06-09 14:39:09 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
2025-03-23 09:29:40 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 倒计时
|
|
|
|
|
startTime() {
|
|
|
|
|
if (this.isSend) return
|
|
|
|
|
this.isSend = true
|
|
|
|
|
this.getCode = this.beginTime + ' s'
|
|
|
|
|
let that = this
|
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
|
this.beginTime--
|
|
|
|
|
this.getCode = this.beginTime + ' s'
|
|
|
|
|
if (this.beginTime < 0) {
|
|
|
|
|
clearInterval(this.timer)
|
2025-04-01 21:35:18 +08:00
|
|
|
|
this.getCode = '获取验证码'
|
2025-03-23 09:29:40 +08:00
|
|
|
|
this.beginTime = 60
|
|
|
|
|
this.isSend = false
|
|
|
|
|
}
|
|
|
|
|
}, 1000)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.content {
|
|
|
|
|
background: #f9f9f9;
|
|
|
|
|
}
|
|
|
|
|
.index_header {
|
|
|
|
|
background: #f9f9f9;
|
|
|
|
|
height: 330rpx;
|
|
|
|
|
}
|
|
|
|
|
.contxt {
|
|
|
|
|
margin-top: -320rpx;
|
|
|
|
|
padding: 0 26rpx;
|
|
|
|
|
}
|
|
|
|
|
.kuang {
|
|
|
|
|
// margin-top: 20rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
height: 90vh;
|
|
|
|
|
background: #fff;
|
|
|
|
|
box-shadow: 0px 2px 10px 0px rgba(204, 204, 204, 0.5);
|
|
|
|
|
border-radius: 10px 10px 10px 10px;
|
|
|
|
|
}
|
|
|
|
|
.getCode {
|
|
|
|
|
font-size: 10px;
|
2025-06-09 14:39:09 +08:00
|
|
|
|
font-family:
|
|
|
|
|
PingFang SC-Regular,
|
|
|
|
|
PingFang SC;
|
2025-03-23 09:29:40 +08:00
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #18acff;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .u-form-item__body__left {
|
|
|
|
|
margin-left: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .u-form-item__body__right__message {
|
|
|
|
|
margin-left: 80px !important;
|
|
|
|
|
}
|
|
|
|
|
.uBtn {
|
|
|
|
|
margin-top: 120rpx;
|
|
|
|
|
}
|
2025-06-09 14:39:09 +08:00
|
|
|
|
.tips {
|
2025-03-23 09:29:40 +08:00
|
|
|
|
font-size: 12px;
|
2025-06-09 14:39:09 +08:00
|
|
|
|
p {
|
2025-03-23 09:29:40 +08:00
|
|
|
|
// line-height: 10px;
|
|
|
|
|
}
|
|
|
|
|
color: #d5251d;
|
|
|
|
|
}
|
|
|
|
|
</style>
|