电投验证码优化修改

This commit is contained in:
pangxingyue
2021-03-05 18:04:52 +08:00
parent 24019fd467
commit 73dfd21fce
2 changed files with 16 additions and 60 deletions

View File

@@ -41,15 +41,17 @@
</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" />
maxlength="11" readonly />
</van-cell-group>
<van-cell-group class="pl20 fs14">
<van-field 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"
<van-button v-if="orderInfoDTO.validateCustomerFlag !== '0'" slot="button" size="small" type="danger" @click="getCode" :disabled="codeDisabled"
v-no-more-click="1000">
{{ codeDisabled ? `${countDown}s后重新获取` : '发送验证码' }}
</van-button>
<van-button v-else slot="button" size="small" color="grey">已获取验证码</van-button>
</van-field>
</van-cell-group>
<div class="fs12 mt10 ml20 w250 h15">
@@ -196,7 +198,8 @@ export default {
isAreaListShow: false,
accBankProvince: '',
accBankCity: '',
areaStr: ''
areaStr: '',
orderInfoDTO: ''
}
},
methods: {
@@ -572,6 +575,9 @@ 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)
@@ -639,7 +645,7 @@ export default {
if (res.result == 0) {
this.appntDTO = res.orderDTO.appntDTO
this.orderInfoDTO = res.orderDTO.orderInfoDTO
//如果是从编辑进来的
if (this.$route.query.edit) {
//投被保险人关系

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>