3
0
Fork 0
web-store-retail-h5/pages/selfService/realName/realName.vue

679 lines
34 KiB
Vue
Raw Normal View History

2025-03-23 09:29:40 +08:00
<template>
<view class="content">
<div class="img_cen"
v-if="hasRegin">
<div class="status-img">
<img src="@/static/images/status3.png" />
</div>
<div class="status-size bolds">{{$t('ENU_YES_NO_A_0')}}</div>
</div>
<view class="theform"
v-else>
<u--form labelPosition="left"
:model="dataForm"
:rules="rules"
ref="uForm">
<u-form-item required
label-width="180rpx"
:label="$t('MY_ORD_60')">
<uploadImg :ifsfz='true'
@imageUploaded='imageUploaded1'
prop="idFront"
ref="uploadImg1"
style="margin-right: 30rpx;"
:bgimg="`../../../static/images/idCard1.png`"
v-model="dataForm.idFront"></uploadImg>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('MY_ORD_61')">
<uploadImg :ifsfz='true'
@imageUploaded='imageUploaded2'
prop="idBack"
ref="uploadImg2"
style="margin-right: 30rpx;"
:bgimg="`../../../static/images/idCard2.png`"
v-model="dataForm.idBack"></uploadImg>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('MY_WAL_33')"
prop="accountName"
ref="item1">
<u--input :placeholder="$t('S_C_70')"
disabled
v-model="dataForm.accountName"></u--input>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('MY_WAL_34')"
prop="sex"
ref="item1">
<u-radio-group v-model="dataForm.sex"
@change="radioGroupChange"
disabled>
<u-radio :customStyle="{marginRight: '16rpx'}"
v-for="(item, index) in sexList"
:key="index"
:name="item.value">{{ item.label }}</u-radio>
</u-radio-group>
</u-form-item>
<!-- </u-form-item> -->
<u-form-item required
label-width="180rpx"
:label="$t('MY_WAL_35')"
prop="idName"
@click="showCtype = true; "
ref="item1">
<u--input suffixIcon="arrow-right"
readonly
v-model="dataForm.idName"
disabled
:placeholder="$t('CK_KS_38')">
</u--input>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('MY_WAL_36')"
prop="idCard"
ref="item1">
<u--input :placeholder="$t('S_C_70')"
v-model="dataForm.idCard"
disabled></u--input>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('CK_KS_41')"
@click="showAmount = true; "
prop="bankName"
ref="item1">
<u--input suffixIcon="arrow-right"
readonly
v-model="dataForm.bankName"
disabledColor="#ffffff"
:placeholder="$t('CK_KS_38')">
</u--input>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('MY_WAL_24')"
prop="cardNumber"
ref="item1">
<u--input :placeholder="$t('S_C_70')"
v-model="dataForm.cardNumber"
disabledColor="#F5F5F5;"></u--input>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('CK_KS_43')"
prop="subBankName"
ref="item1">
<u--input :placeholder="$t('S_C_70')"
v-model="dataForm.subBankName"
disabledColor="#F5F5F5;"></u--input>
</u-form-item>
<u-form-item required
@click="getDiqu"
:label="$t('MY_WAL_37')"
label-width="180rpx"
prop="theaddress">
<u--input v-model="dataForm.theaddress"
readonly
suffixIcon="arrow-right"
disabledColor="#ffffff"
:placeholder="$t('CK_KS_38')">
</u--input>
</u-form-item>
<view class="view-class">
<u-form-item required
:label="$t('S_C_27')"
class="label-style"
label-width="180rpx"
prop="address">
<u-textarea v-model="dataForm.address"
placeholder-class="place-class"
class="border-color"
maxlength="200"
:placeholder="$t('S_C_70')" />
</u-form-item>
</view>
<u-form-item required
label-width="180rpx"
:label="$t('w_0052')"
prop="phone"
ref="item1">
<u--input v-model="dataForm.phone"
:placeholder="$t('S_C_70')"></u--input>
</u-form-item>
<u-form-item required
label-width="180rpx"
:label="$t('w_0043')"
prop="verificationCode"
ref="item1">
<u--input v-model="dataForm.verificationCode"
:placeholder="$t('S_C_70')">
<template slot="suffix">
<text style="color: #18ACFF;"
@tap='getCode'>{{tips}}</text>
</template>
</u--input>
</u-form-item>
<u-code :seconds="seconds"
@end="end"
@start="start"
ref="uCode"
@change="codeChange"></u-code>
<u-picker @cancel='showAmount=false'
:show="showAmount"
ref="uPicker"
:columns="bankCardChioceList"
@confirm="confirm"
keyName='bankName'></u-picker>
<!-- <u-picker @cancel='showCtype=false' :show="showCtype" ref="uPicker2" :columns="cardTypeList"
@confirm="confirm2" keyName='label'></u-picker> -->
</u--form>
<view class="footer_l">
<u-checkbox-group v-model="agreementShow"
shape="circle"
activeColor="#FB3024">
<u-checkbox @change="toCheck"
:name="1">
</u-checkbox>
</u-checkbox-group>
<view class="tit3">{{$t('APP_ADD_19')}}</view>
<view class="tit2"
@click="toAgree"> 推广人员服务协议</view>
</view>
<view class="btnbox">
<u-button class="subbtn"
@click="submit">{{$t('w_0035')}}</u-button>
</view>
</view>
<u-popup :show="agreeMent"
:closeable="true"
@close="agreeMent=false"
:round="10"
class="popAll"
mode="center">
<view class="popList">
<view class="pop_box">
<view v-html="context"></view>
<view class="disflx">
<u-button type="success"
class="uBtn"
shape="circle"
color="linear-gradient(to right, #fb3024, #fb3024 )"
@tap="agreeMent=false,isRead = 1">{{ $t('APP_ADD_19') }}</u-button>
</view>
</view>
<!-- <view class="footer">
</view> -->
</view>
</u-popup>
<u-toast ref="uToast"></u-toast>
<v-address ref="address"
@getAddressData="AddressData"
:defaultCode="defaultCode"
@addressData="addressData"></v-address>
</view>
</template>
<script>
import * as ban from '@/config/balance.js'
import address from '@/components/address.vue'
import uploadImg from '@/components/uploadImg.vue'
export default {
components: {
'v-address': address,
uploadImg,
},
data() {
return {
isRead: 0,
agreeMent: false,
agreementShow: [],
showAmount: false,
showCtype: false,
dataForm: {
bankName: '',
cardNumber: '',
pkBank: '',
subBankName: '',
accountName: '',
idCard: '',
pkProvince: '',
pkCity: '',
pkCounty: '',
theaddress: '',
idFront: '',
idBack: '',
idName: '身份证',
idType: 1,
sex:1
},
sexRadio: 1,
address: '',
defaultCode: [],
bankCardChioceList: [], //银行选择
cardTypeList: [], //证件类型
sexList: [
{
label: this.$t('MY_WAL_44'),
value: 1,
},
{
label: this.$t('MY_WAL_45'),
value: 2,
},
],
rules: {
accountName: [
{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change'],
},
],
sexRadio: [
{
required: true,
message: this.$t('CK_KS_38'),
trigger: 'change',
},
],
idName: [
{
type: 'string',
required: true,
message: this.$t('CK_KS_38'),
trigger: ['change'],
},
],
idCard: [
{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change'],
},
],
pkBank: [
{
type: 'string',
required: true,
message: this.$t('CK_KS_38'),
trigger: ['change'],
},
],
address: [
{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change'],
},
],
cardNumber: [
{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change'],
},
],
subBankName: [
{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change'],
},
],
theaddress: [
{
type: 'string',
required: true,
message: this.$t('CK_KS_38'),
trigger: ['change'],
},
],
idFront: [
{
required: true,
message: this.$t('MY_CK_16'),
},
],
idBack: [
{
required: true,
message: this.$t('MY_CK_16'),
},
],
phone: [
{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change'],
},
],
verificationCode: [
{
type: 'string',
required: true,
message: this.$t('S_C_70'),
trigger: ['blur', 'change'],
},
],
},
tips: '',
// refCode: null,
seconds: 60,
hasRegin: false,
context:
'<p>\t</p><p class="ql-align-center" style="text-align:center;font-size:18px"><span class="ql-size-large">\t</span><strong style="color: rgb(35, 31, 32);text-align:center" class="ql-size-large">推广服务协议</strong></p><p>&nbsp;</p><p><br></p><p><strong style="color: rgb(35, 31, 32);">甲方青岛海之圣生物工程有限公司</strong></p><p><strong style="color: rgb(35, 31, 32);">乙方</strong></p><p><strong style="color: rgb(35, 31, 32);">身份证号: </strong></p><p><strong style="color: rgb(35, 31, 32);">手机号:</strong></p><p><br></p><p><span style="color: rgb(35, 31, 32);">甲乙双方经平等协商一致乙方愿意就甲方所有或经销的产品批发及&nbsp;/ 广</span></p><p><strong style="color: rgb(35, 31, 32);">&nbsp;</strong></p><p><span style="color: rgb(35, 31, 32);"> </span></p><p><span style="color: rgb(35, 31, 32);"></span></p><p><strong> </strong>&nbsp;&nbsp;<span style="color: rgb(35, 31, 32);">&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p><span style="color: rgb(35, 31, 32);">1.</span></p><p><span style="color: rgb(35, 31, 32);">2.</span></p><p>\t<span style="color: rgb(35, 31, 32);"></span></p><p><span style="color: rgb(35, 31, 32);">3.广退退退</span></p><p>\t<span style="color: rgb(35, 31, 32);"></span></p><p><strong style="color: rgb(35, 31, 32);">&nbsp;</strong></p><p><span style="color: rgb(35, 31, 32);">使使广 </span></p><p><strong style="color: rgb(35, 31, 32);">&nbsp;</strong><strong></strong></p><p><span style="color: rgb(35, 31, 32);">1. </span></p><p><span style="color: rgb(35, 31, 32);">2. </span></p><p><span style="color: rgb(35, 31, 32);"></span></p><p><span style="color: rgb(35, 31, 32);">3. </span></p><p><strong style="color: rgb(35, 31, 32);">
}
},
watch: {
'dataForm.idFront'(n, o) {
if (n) {
this.getIdCardInfo(n)
}
},
'dataForm.idBack'(n, o) {
if (n) {
this.idBackChange(n)
}
},
},
onLoad() {
this.getDetail()
this.getList()
},
onReady() {
this.$refs.uForm.setRules(this.rules)
},
methods: {
toAgree() {
this.agreeMent = true
},
getDetail() {
ban.authenticationDetails().then((res) => {
if (res.data) {
this.hasRegin = true
} else {
this.hasRegin = false
}
})
},
toCheck(e) {
if (this.isRead == 0) {
this.$nextTick(() => {
this.$set(this, 'agreementShow', [])
uni.showToast({
title: '请阅读推广人员服务协议',
icon: 'none',
duration: 1500,
})
})
}
},
getIdCardInfo(n) {
ban
.ocrIdCard({
idCardUrl: n,
})
.then((res) => {
if (res.code == 200) {
this.$set(this.dataForm, 'accountName', res.data.name)
this.$set(this.dataForm, 'idCard', res.data.idCard)
this.$set(this.dataForm, 'sex', res.data.sex)
} else {
this.$nextTick(() => {
this.$refs.uploadImg1.deletePic({ index: 0 })
this.$set(this.dataForm, 'accountName', '')
this.$set(this.dataForm, 'idCard', '')
this.$set(this.dataForm, 'sex', '')
this.$set(this.dataForm, 'idFront', '')
})
}
})
},
idBackChange(e) {
if (e) {
ban
.ocrIdCardBack({
idCardBackUrl: e,
})
.then((res) => {
if (res.code == 200) {
} else {
this.$nextTick(() => {
this.$refs.uploadImg2.deletePic({ index: 0 })
this.$set(this.dataForm, 'idBack', '')
})
}
})
}
},
imageUploaded1(url) {
this.dataForm.idFront = url
},
imageUploaded2(url) {
this.dataForm.idBack = url
},
// radio选择发生变化
radioGroupChange(e) {
this.dataForm.sex = e
// console.log('🌈eeee',e)
},
AddressData(name) {
this.dataForm.theaddress = name
},
getDiqu() {
this.$refs.address.setShow()
},
addressData(diqu, obj) {
this.dataForm.theaddress = diqu
this.dataForm.pkProvince = obj.province
this.dataForm.pkCity = obj.city
this.dataForm.pkCounty = obj.county
this.$forceUpdate()
},
codeChange(text) {
this.tips = text
},
getCode() {
if (this.dataForm.phone) {
if (this.$refs.uCode.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: this.$t('MY_ORD_62'),
})
ban
.getVerification({
phone: this.dataForm.phone,
})
.then((res) => {
uni.hideLoading()
// 这里此提示会被this.start()方法中的提示覆盖
uni.$u.toast(this.$t('MY_WAL_49'))
// 通知验证码组件内部开始倒计时
this.$refs.uCode.start()
})
} else {
uni.$u.toast(this.$t('MY_ORD_63'))
}
} else {
uni.$u.toast(this.$t('MY_WAL_47'))
return
}
},
end() {},
start() {},
getList() {
ban.getBankCardChoiceList().then((res) => {
this.bankCardChioceList = [res.data]
})
//证件类型
ban.getCardType().then((res) => {
this.cardTypeList = [res.data]
})
},
submit() {
if (this.agreementShow.length == 0) {
uni.showToast({
title: '请阅读推广人员服务协议',
icon: 'none',
duration: 1500,
})
} else {
this.$refs.uForm
.validate()
.then((res) => {
ban
.addAuthentication(this.dataForm)
.then((res) => {
if (res.code == 200) {
uni.$u.toast(res.msg)
setTimeout(() => {
uni.navigateBack()
}, 1500)
} else {
uni.$u.toast(res.msg)
}
})
.catch((err) => {})
})
.catch((errors) => {
uni.$u.toast(this.$t('MY_ORD_64'))
return false
})
}
},
confirm2(e) {
this.dataForm.idName = e.value[0].label
this.dataForm.idType = e.value[0].value
this.showCtype = false
},
confirm(e) {
this.dataForm.bankName = e.value[0].bankName
this.dataForm.pkBank = e.value[0].pkId
this.showAmount = false
},
},
}
</script>
<style lang="scss" scoped>
::v-deep .u-input--radius,
.u-input--square {
border-radius: 12rpx;
// border:2rpx solid #cccccc;
}
.content {
background: #f2f2f2;
.uni-textarea {
height: 100rpx;
}
.theform {
margin-top: 6rpx;
background: #ffffff;
padding: 20rpx 23rpx 48rpx 23rpx;
.contentye {
font-size: 28rpx;
margin-left: 200rpx;
font-family: Source Han Sans CN;
font-weight: 400;
}
}
.btnbox {
margin-top: 38rpx;
padding: 0 20rpx;
.subbtn {
background: #fb3024;
border-radius: 46rpx;
font-size: 30rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
.getcodes {
background: #2fbc42;
border-radius: 38rpx;
color: #fff;
}
}
.img_cen {
padding: 100px 0;
margin: 0 auto;
text-align: center;
}
.status-img img {
width: 80px;
height: 80px;
}
.footer_l {
display: flex;
justify-content: center;
.tit2 {
font-size: 26rpx;
font-family: Source Han Sans CN;
font-weight: bold;
color: #fb3024;
}
.tit3 {
font-size: 26rpx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
}
margin: 30rpx 0 40rpx 0;
}
.popAll ::v-deep .u-popup__content {
width: 90%;
}
.pop_box {
max-height: 70vh;
overflow-y: scroll;
padding: 40rpx;
img {
width: 100%;
margin-bottom: 20px;
}
}
.footer {
margin-bottom: 40rpx;
padding: 20rpx;
}
.disflx {
margin-top: 10px;
}
</style>