Merge branch 'feature/【GFRS-2282】电投验证码优化' into release/20210318

This commit is contained in:
pangxingyue
2021-03-18 14:03:39 +08:00
3 changed files with 96 additions and 122 deletions

View File

@@ -2,77 +2,56 @@
<div class="accountInformation-container redRadioCheckbox">
<index-bar></index-bar>
<div class="aaountInfomation-content" v-if="!isScan">
<van-radio-group v-model="radio" class="flex pl30 pr30 pt15 pb15 justify-content-s bg-white mt10">
<van-radio name="0" class="fs14" @click="clickRadio(saleInsuredInfo.name)" v-if="!changeCard">{{ `投保人${saleInsuredInfo.name}` }}</van-radio>
<van-radio name="0" class="fs14" @click="clickRadio(saleInsuredInfo.name)" v-if="!changeCard">{{
`投保人${saleInsuredInfo.name}` }}</van-radio>
<!-- <van-radio name="1" class="fs14" v-if="relationToAppnt != '1'" @click="clickRadio(saleInsuredPersonInfo.name)">{{
`被保险人${saleInsuredPersonInfo.name}`
}}</van-radio> -->
</van-radio-group>
<div v-if="radio == '0'">
<van-cell-group class="pl20 fs14">
<van-field
v-model="bank"
label="开户银行"
placeholder="请选择"
required
@click="islistShow = true"
readonly
v-validate="'required'"
data-vv-name="开户银行"
/>
<van-field v-model="bank" label="开户银行" placeholder="请选择" required @click="islistShow = true" readonly
v-validate="'required'" data-vv-name="开户银行" />
</van-cell-group>
<van-cell-group class="pl20 fs14">
<van-field
v-model="areaStr"
label="开户银行省市"
placeholder="请选择"
required
@click="areaSelect"
readonly
v-validate="'required'"
data-vv-name="开户银行省市"
/>
<van-field v-model="areaStr" label="开户银行省市" placeholder="请选择" required @click="areaSelect" readonly
v-validate="'required'" data-vv-name="开户银行省市" />
</van-cell-group>
<van-cell-group class="pl20 flex align-items-c">
<van-field
v-model="bankId"
label="银行卡号"
maxlength="19"
placeholder="手工录入或点击右侧银行卡扫描"
clearable
required
v-validate="'required|bankCard'"
data-vv-name="银行卡号"
/>
<van-button type="danger" size="small" class="bankCard mr10 w110 h20" @click="cardScanning('0')" v-no-more-click="1000" v-if="!changeCard"
>银行卡扫描</van-button
>
<van-field v-model="bankId" label="银行卡号" maxlength="19" placeholder="手工录入或点击右侧银行卡扫描" clearable required
v-validate="'required|bankCard'" data-vv-name="银行卡号" />
<van-button type="danger" size="small" class="bankCard mr10 w110 h20" @click="cardScanning('0')"
v-no-more-click="1000" v-if="!changeCard">银行卡扫描</van-button>
</van-cell-group>
<van-cell-group class="flex align-items-c" v-if="isAutoPay == '0' && !changeCard">
<van-switch-cell v-model="checked" title="是否自动垫交" active-color="#E9332E" inactive-color="#fff" class="ml15 pr30" />
<van-icon
name="question-o"
class="vanIcon"
@click="
<van-icon name="question-o" class="vanIcon" @click="
$toast({
message:
'保费自动垫交是当投保人没有按时交纳续期保险费,而保单当时已经具有足够的现金价值时,保险公司以现金价值自动垫交保险费,从而使保单继续有效。相当于投保人向保险公司贷款交纳保费,是保险公司提供给客户的一项选择权益,其目的是为了尽可能地减少客户因非故意的失误导致保单失效,使其利益受损。',
duration: 10000
})
"
/>
" />
</van-cell-group>
<van-cell-group class="flex align-items-c" v-if="isRenew == '0' && !changeCard">
<van-switch-cell
v-model="isChecked"
title="自动续保"
active-color="#E9332E"
inactive-color="#fff"
class="ml15 pr30"
:disabled="isForceRenew"
@change="handleRenew"
/>
<van-switch-cell v-model="isChecked" title="自动续保" active-color="#E9332E" inactive-color="#fff" class="ml15 pr30"
:disabled="isForceRenew" @change="handleRenew" />
</van-cell-group>
<van-cell-group class="pl20 fs14">
<van-field required v-model="appntDTO.mobile" clearable label="投保人手机号" name="投保人手机号" placeholder="请输入"
v-validate="'required|mobileLength11|mobileStartWith1|mobile'" maxlength="11" readonly />
</van-cell-group>
<van-cell-group class="pl20 fs14">
<van-field v-if="orderInfoDTO.validateCustomerFlag !== '0'" v-model="authCode" center clearable label name="短信验证码"
v-validate="'required'" placeholder="请输入短信验证码" maxlength="6">
<van-button slot="button" size="small" type="danger" @click="getCode" :disabled="codeDisabled"
v-no-more-click="1000">
{{ codeDisabled ? `${countDown}s后重新获取` : '发送验证码' }}
</van-button>
</van-field>
</van-cell-group>
<div class="fs12 mt10 ml20 w250 h15">
<span>温馨提示该账户将用于首期续期保费缴费</span>
@@ -125,15 +104,8 @@
<!--开户银行选择-->
<SelectBankName :inputShow="inputShow" :listShow.sync="islistShow" :operateType="'bank_type'" @getBank="getBank"></SelectBankName>
<van-popup position="bottom" v-model="isAreaListShow" :lazy-render="false">
<van-area
ref="areaSelect"
title="请选择省市"
:visible-item-count="4"
:columns-num="2"
:area-list="areaList"
@confirm="setBankArea"
@cancel="isAreaListShow = false"
/>
<van-area ref="areaSelect" title="请选择省市" :visible-item-count="4" :columns-num="2" :area-list="areaList" @confirm="setBankArea"
@cancel="isAreaListShow = false" />
</van-popup>
<!-- 短信验证弹窗 -->
@@ -145,7 +117,7 @@
<template #button>
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
}}</van-button>
}}</van-button>
</template>
</van-field>
</van-dialog>
@@ -166,6 +138,11 @@ export default {
return {
cardAuthCount: 0,
isCaptchaModalShow: false,
authCode: '', //手机号验证码
codeDisabled: false, //获取验证码按钮是否禁用
countDown: 60, //倒计时
timeId: null, //定时器
sessionId: '', //后台返回的 id
code: '',
sid: '',
countDownNum: 0,
@@ -215,12 +192,13 @@ export default {
age: null,
productNo: null,
salePageFlag: '6',
appntDTO: null,
appntDTO: {},
areaList,
isAreaListShow: false,
accBankProvince: '',
accBankCity: '',
areaStr: ''
areaStr: '',
orderInfoDTO: ''
}
},
methods: {
@@ -596,10 +574,12 @@ export default {
}
}
}
if (this.orderInfoDTO.validateCustomerFlag !== '0') {
data.orderDTO.smsCodeDTO = { smsId: this.sessionId, code: this.authCode }
}
saveInformation(data).then(res => {
if (res.result == '0') {
window.localStorage.setItem('accountInformationRadio', this.radio)
this.$jump({
flag: 'h5',
extra: {
@@ -625,6 +605,37 @@ export default {
} else {
this.isChecked = v
}
},
//获取验证码
getCode() {
if (this.appntDTO.mobile == '') {
return this.$toast('请填写移动电话')
}
this.codeDisabled = true
//倒计时
this.timeId = setInterval(() => {
this.countDown--
if (this.countDown <= 0) {
window.clearInterval(this.timeId)
this.codeDisabled = false
this.countDown = 60
}
}, 1000)
let data = {
operateType: 'appntInfoEntry',
type: 'H5',
operateCode: this.appntDTO.mobile,
system: 'agentApp',
operateCodeType: '0'
}
//获取验证码
getAuthCode(data).then(res => {
if (res.result == 0) {
this.sessionId = res.sessionId
} else {
this.$toast(res.resultMessage)
}
})
}
},
async created() {
@@ -632,7 +643,7 @@ export default {
if (res.result == 0) {
this.appntDTO = res.orderDTO.appntDTO
this.orderInfoDTO = res.orderDTO.orderInfoDTO
//如果是从编辑进来的
if (this.$route.query.edit) {
//投被保险人关系
@@ -734,6 +745,13 @@ export default {
}
}
},
beforeDestroy() {
//清理计时器
window.clearInterval(this.timeId)
this.timeId = null
this.countDown = 60
this.codeDisabled = false
},
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
@@ -756,6 +774,9 @@ export default {
<style lang="scss" scoped>
@import '@/assets/sass/variables.scss';
#app .van-cell:not(:last-child)::after {
border-bottom: none;
}
.accountInformation-container {
height: 100%;
}

View File

@@ -122,12 +122,7 @@
placeholder="请输入"
v-validate="'required|mobileLength11|mobileStartWith1|mobile'"
maxlength="11"
/>
<van-field v-model="userInfo.authCode" center clearable label name="短信验证码" v-validate="'required'" placeholder="请输入短信验证码" maxlength="6">
<van-button slot="button" size="small" type="danger" @click="getCode" :disabled="codeDisabled" v-no-more-click="1000">
{{ codeDisabled ? `${countDown}s后重新获取` : '发送验证码' }}
</van-button>
</van-field>
/>
<van-field v-model="userInfo.email" required label="电子邮箱" name="电子邮箱" placeholder="请输入" v-validate="'required|email'" clearable />
<van-field
v-model="userInfo.stature"
@@ -441,9 +436,7 @@ export default {
value: '1'
}
],
maxDate: beforeDate.getBeforeYear(16),
codeDisabled: false, //获取验证码按钮是否禁用
countDown: 60, //倒计时
maxDate: beforeDate.getBeforeYear(16),
certiexpiredateRequired: true, //证件截止日期是否需要校验
popupShow: false,
// areaShow: false, //省级联动
@@ -481,8 +474,7 @@ export default {
healthGrade: '', //健康等级
mobile: '', //移动电话
stature: '', //身高
avoirdupois: '', //体重
authCode: '', //验证码
avoirdupois: '', //体重
// degree: '', //文化程度
medical: '1', //有无社保
taxResidentId: '', //税收居民身份
@@ -1243,8 +1235,7 @@ export default {
orderInfoDTO: {
orderNo: localStorage.orderNo,
isElecCont: this.isElecCont
},
smsCodeDTO: { smsId: this.sessionId, code: this.userInfo.authCode },
},
appntDTO: {}
}
}
@@ -1269,11 +1260,6 @@ export default {
}
localStorage.orderNo = resultData.orderNo
// localStorage.insuredDetail = JSON.stringify(this.userInfo)
//清理计时器
window.clearInterval(this.timeId)
this.timeId = null
this.countDown = 60
this.codeDisabled = false
// 添加提示
let age = utilsAge.getAge(this.userInfo.birthday, new Date())
if (age >= 60) {
@@ -1341,37 +1327,7 @@ export default {
// this.userInfo.addressStatus = 0
// }
// },
//获取验证码
getCode() {
if (this.userInfo.mobile == '') {
return this.$toast('请填写移动电话')
}
this.codeDisabled = true
//倒计时
this.timeId = setInterval(() => {
this.countDown--
if (this.countDown <= 0) {
window.clearInterval(this.timeId)
this.codeDisabled = false
this.countDown = 60
}
}, 1000)
let data = {
operateType: 'appntInfoEntry',
type: 'H5',
operateCode: this.userInfo.mobile,
system: 'agentApp',
operateCodeType: '0'
}
//获取验证码
getAuthCode(data).then(res => {
if (res.result == 0) {
this.sessionId = res.sessionId
} else {
this.$toast(res.resultMessage)
}
})
},
//长期状态改变时
effectiveDataTypeChange(val) {
//勾选长期状态时,证件截止日期置空
@@ -1463,13 +1419,7 @@ export default {
}
}
},
beforeDestroy() {
//清理计时器
window.clearInterval(this.timeId)
this.timeId = null
this.countDown = 60
this.codeDisabled = false
}
}
</script>
<style lang="scss" scoped>

View File

@@ -596,7 +596,8 @@ export default {
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/accountInformation'
url: location.origin + '/#/sale/accountInformation',
needRefresh: '1'
},
routerInfo: {
path: '/sale/accountInformation'
@@ -630,7 +631,8 @@ export default {
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/AccountInformation'
url: location.origin + '/#/sale/AccountInformation',
needRefresh: '1'
},
routerInfo: {
path: '/sale/AccountInformation'
@@ -664,7 +666,8 @@ export default {
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/accountInformation'
url: location.origin + '/#/sale/accountInformation',
needRefresh: '1'
},
routerInfo: {
path: '/sale/accountInformation'