mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-16 01:46:45 +08:00
Merge branch 'feature/GFRS-718【0319】电投添加短信验证码验证身份' into release/0325
This commit is contained in:
@@ -18,7 +18,14 @@ export function updateCustomerInfo(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//本人实名认证
|
||||
export function checkPhone(data) {
|
||||
return request({
|
||||
url: getUrl('/customer/checkPhone', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
//查询代理人客户信息
|
||||
export function getAgentCustomerInfo(data) {
|
||||
return request({
|
||||
|
||||
@@ -61,7 +61,14 @@ export function getAuthCode(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 验证验证码
|
||||
export function autchCodeCheck(data) {
|
||||
return request({
|
||||
url: getUrl('/customer/authcode/check', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 上传图片
|
||||
export function uploadImg(data) {
|
||||
return request({
|
||||
|
||||
@@ -512,7 +512,8 @@ export default {
|
||||
idNo: appntDTO.idNo,
|
||||
appntId: appntDTO.appntId,
|
||||
healthGrade: appntDTO.healthGrade,
|
||||
lifeGrade: appntDTO.lifeGrade
|
||||
lifeGrade: appntDTO.lifeGrade,
|
||||
mobile: appntDTO.mobile
|
||||
})
|
||||
|
||||
if (insuredDTO) {
|
||||
@@ -531,7 +532,8 @@ export default {
|
||||
insuredId: insuredDTO.insuredId,
|
||||
idNo: insuredDTO.idNo,
|
||||
healthGrade: insuredDTO.healthGrade,
|
||||
lifeGrade: insuredDTO.lifeGrade
|
||||
lifeGrade: insuredDTO.lifeGrade,
|
||||
mobile: insuredDTO.mobile
|
||||
})
|
||||
|
||||
let [chooseProductCodes, mainRiskCodes, addRiskCodes] = [[], [], []]
|
||||
|
||||
@@ -65,6 +65,14 @@ export default {
|
||||
this.$refs.file.dispatchEvent(new MouseEvent('click'))
|
||||
},
|
||||
addImg(e) {
|
||||
this.$toast.loading({
|
||||
// 持续展示 toast
|
||||
duration: 0,
|
||||
// 禁用背景点击s
|
||||
forbidClick: true,
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
let that = this
|
||||
this.file = this.$refs.file.files[0]
|
||||
var reader = new FileReader()
|
||||
|
||||
@@ -214,22 +214,56 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<UploadImageFile :typeface="idcardData.typeface" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage">
|
||||
<!-- 短信验证 -->
|
||||
<van-dialog
|
||||
v-model="show"
|
||||
title="提示"
|
||||
show-cancel-button
|
||||
@confirm="authConfirm(authCode)"
|
||||
@cancel="clearTimer"
|
||||
>
|
||||
<p class="p10 fs14">
|
||||
为确保是您本人操作,短信验证码已发送至您手机号{{ encyCustomerMobile }},请您输入验证码以完成后续投保操作。
|
||||
</p>
|
||||
<van-cell-group class="flex align-items-c pr5 mb15">
|
||||
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="authCode" clearable label-width="0"/>
|
||||
<van-button type="danger" plain size="small" class="w160 p0" @click="getAuthCode" :disabled="codeDisabled" v-no-more-click="2000">{{
|
||||
codeDisabled ? `${countDown}s后重新获取` : '获取验证码'
|
||||
}}</van-button>
|
||||
</van-cell-group>
|
||||
</van-dialog>
|
||||
<UploadImageFile :typeface="idcardData.typeface && (faceAuthCount.weixin < smsAuthNum)" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage">
|
||||
</UploadImageFile>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UploadImageFile from '@/components/ebiz/sale/UploadImageFile'
|
||||
import { Cell, CellGroup, Collapse, CollapseItem, Dialog } from 'vant'
|
||||
import { underWrite, getOrderDetail, getSignInvalid, checkSignInvalid } from '@/api/ebiz/sale/sale'
|
||||
import { Field, Cell, CellGroup, Collapse, CollapseItem, Dialog } from 'vant'
|
||||
import { underWrite, getOrderDetail, getSignInvalid, checkSignInvalid, getAuthCode, autchCodeCheck} from '@/api/ebiz/sale/sale'
|
||||
import { checkPhone } from '@/api/ebiz/customer/customer'
|
||||
import { weixinShare } from '@/assets/js/utils/wxShare.js'
|
||||
// import axios from 'axios'
|
||||
// import device from '@/assets/js/commons.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
return {
|
||||
show: false, // 获取短信验证码
|
||||
codeDisabled: false, // 获取验证码按钮是否禁用
|
||||
timeId: null, // 计时器ID
|
||||
countDown: 60, // 倒计时
|
||||
authCode: '', // 验证码
|
||||
smsAuthNum: 3,
|
||||
operaFlag:null,
|
||||
encyCustomerMobile:null,
|
||||
sid:null,
|
||||
//人脸识别认证次数
|
||||
faceAuthCount:{
|
||||
appnt:0,
|
||||
insured:0,
|
||||
weixin:0
|
||||
},
|
||||
customerMobile:'',
|
||||
//保险产品名称
|
||||
riskName: '',
|
||||
// 员工信息
|
||||
@@ -361,6 +395,119 @@ export default {
|
||||
this.isShow = true
|
||||
}
|
||||
},
|
||||
// 获取消息和阅读状态
|
||||
realPeopelCheck() {
|
||||
let that = this
|
||||
this.$toast.loading({
|
||||
// 持续展示 toast
|
||||
duration: 0,
|
||||
// 禁用背景点击s
|
||||
forbidClick: true,
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
let data = {};
|
||||
this.authCode = null;
|
||||
if("appnt" == this.operaFlag){
|
||||
let appntData = JSON.parse(localStorage.saleInsuredInfo);
|
||||
data = {
|
||||
name: appntData.name,
|
||||
idType: appntData.idType,
|
||||
idNo: appntData.idNo,
|
||||
mobile: appntData.mobile
|
||||
}
|
||||
this.customerMobile = appntData.mobile;
|
||||
this.encyCustomerMobile = this.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/,'$1****$2');
|
||||
}else if("insured" == this.operaFlag){
|
||||
let insuredData = JSON.parse(localStorage.saleInsuredPersonInfo);
|
||||
data = {
|
||||
name: insuredData.name,
|
||||
idType: insuredData.idType,
|
||||
idNo: insuredData.idNo,
|
||||
mobile: insuredData.mobile
|
||||
}
|
||||
this.customerMobile = insuredData.mobile;
|
||||
this.encyCustomerMobile = this.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/,'$1****$2');
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
checkPhone(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
console.log(res);
|
||||
this.show = true;
|
||||
}else{
|
||||
Dialog.confirm({
|
||||
title: '提示',
|
||||
message: '抱歉,您预留的手机号非您本人的手机号,请进行线下投保!',
|
||||
showCancelButton: false
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 验证码确认事件
|
||||
async authConfirm() {
|
||||
//清理计时器
|
||||
this.clearTimer()
|
||||
this.changeSubmit()
|
||||
},
|
||||
// 获取短信验证码
|
||||
getAuthCode() {
|
||||
this.codeDisabled = true
|
||||
//倒计时
|
||||
this.timeId = setInterval(() => {
|
||||
this.countDown--
|
||||
if (this.countDown <= 0) {
|
||||
window.clearInterval(this.timeId)
|
||||
this.codeDisabled = false
|
||||
this.countDown = 60
|
||||
}
|
||||
}, 1000)
|
||||
getAuthCode({
|
||||
operateType: 'appntInfoEntry',
|
||||
type: 'H5',
|
||||
operateCode: this.customerMobile,
|
||||
system: 'agentApp',
|
||||
operateCodeType: '0'
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.result == 0) {
|
||||
this.sid = res.sessionId
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 清理计时器
|
||||
clearTimer() {
|
||||
window.clearInterval(this.timeId)
|
||||
this.timeId = null
|
||||
this.countDown = 60
|
||||
this.codeDisabled = false
|
||||
},
|
||||
//提交变更申请
|
||||
async changeSubmit() {
|
||||
if(null == this.sid){
|
||||
this.$toast("请先进行发送短信验证码")
|
||||
return;
|
||||
}
|
||||
let res = await autchCodeCheck({
|
||||
smsId: this.sid,
|
||||
code: this.authCode
|
||||
})
|
||||
if (res.result == 0) {
|
||||
if("appnt" == this.operaFlag){
|
||||
this.goUrl()
|
||||
}else if("insured" == this.operaFlag){
|
||||
this.insuredUrl()
|
||||
}
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
//清理计时器
|
||||
this.clearTimer()
|
||||
},
|
||||
// 人脸识别
|
||||
start_ocr(val) {
|
||||
// val 0投保人 1被保人 2本人
|
||||
@@ -374,9 +521,14 @@ export default {
|
||||
if (JSON.parse(this.$route.query.saleInsuredInfo).idType != '1') {
|
||||
that.goUrl()
|
||||
} else {
|
||||
this.idcardData.typeface = !this.idcardData.typeface
|
||||
this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name
|
||||
this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredInfo).idNo
|
||||
if(this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||
this.idcardData.typeface = !this.idcardData.typeface
|
||||
this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name
|
||||
this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredInfo).idNo
|
||||
}else{
|
||||
this.operaFlag = "appnt";
|
||||
this.realPeopelCheck();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
window.localStorage.setItem('sign-val', val)
|
||||
@@ -385,9 +537,14 @@ export default {
|
||||
// if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1') {
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
this.idcardData.typeface = !this.idcardData.typeface
|
||||
this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredPersonInfo).name
|
||||
this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredPersonInfo).idNo
|
||||
if(this.faceAuthCount.insured < this.smsAuthNum) {
|
||||
this.idcardData.typeface = !this.idcardData.typeface
|
||||
this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredPersonInfo).name
|
||||
this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredPersonInfo).idNo
|
||||
}else{
|
||||
this.operaFlag = "insured";
|
||||
this.realPeopelCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -398,17 +555,26 @@ export default {
|
||||
// if (this.saleInsuredInfo.idType != '1' || this.saleInsuredInfo.age < '18') {
|
||||
that.goUrl()
|
||||
} else {
|
||||
// 原人脸识别
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
number: that.saleInsuredInfo.idNo, //身份证号码
|
||||
name: that.saleInsuredInfo.name //姓名
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
that.goUrl()
|
||||
} else {
|
||||
// EWebBridge.webCallAppInJs('webview_toast', '人脸检测失败')
|
||||
}
|
||||
})
|
||||
if(this.faceAuthCount.appnt < this.smsAuthNum){
|
||||
// 原人脸识别
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
number: that.saleInsuredInfo.idNo, //身份证号码
|
||||
name: that.saleInsuredInfo.name //姓名
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
that.goUrl()
|
||||
} else {
|
||||
that.faceAuthCount.appnt++;
|
||||
if (this.faceAuthCount.appnt >= this.smsAuthNum) {
|
||||
this.operaFlag = 'appnt'
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.operaFlag = "appnt";
|
||||
this.realPeopelCheck();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
window.localStorage.setItem('sign-val', val)
|
||||
@@ -417,17 +583,26 @@ export default {
|
||||
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '18') {
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
// 调原生人脸识别
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
number: that.saleInsuredPersonInfo.idNo, //身份证号码
|
||||
name: that.saleInsuredPersonInfo.name //姓名
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
// this.$toast(JSON.parse(data).error)
|
||||
}
|
||||
})
|
||||
if(this.faceAuthCount.insured < this.smsAuthNum) {
|
||||
// 调原生人脸识别
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
number: that.saleInsuredPersonInfo.idNo, //身份证号码
|
||||
name: that.saleInsuredPersonInfo.name //姓名
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
that.faceAuthCount.insured++;
|
||||
if (this.faceAuthCount.insured >= this.smsAuthNum) {
|
||||
this.operaFlag = 'insured'
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.operaFlag = "insured";
|
||||
this.realPeopelCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -712,7 +887,7 @@ export default {
|
||||
orderNo: window.localStorage.getItem('orderNo')
|
||||
}
|
||||
localStorage.setItem('riskName', '')
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve) => {
|
||||
getOrderDetail(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
//弹框展示是否有社保、赔付比例和免赔额信息
|
||||
@@ -875,6 +1050,16 @@ export default {
|
||||
} else {
|
||||
this.goUrl()
|
||||
}
|
||||
}else{
|
||||
this.faceAuthCount.weixin++;
|
||||
if (this.faceAuthCount.weixin >= this.smsAuthNum) {
|
||||
if (window.sessionStorage.shareCode == '1') {
|
||||
this.operaFlag = 'insured'
|
||||
} else {
|
||||
this.operaFlag = 'appnt'
|
||||
}
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -909,8 +1094,9 @@ export default {
|
||||
[Collapse.name]: Collapse,
|
||||
UploadImageFile: UploadImageFile,
|
||||
[CollapseItem.name]: CollapseItem,
|
||||
[Dialog.name]: Dialog
|
||||
},
|
||||
[Dialog.name]: Dialog,
|
||||
[Field.name]: Field
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
document.body.style.backgroundColor = ''
|
||||
next()
|
||||
|
||||
@@ -9,7 +9,16 @@
|
||||
:max-count="1"
|
||||
@delete="deleteImg"
|
||||
/> -->
|
||||
<UploadImageFile :typeface="idcardData.typeface" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage">
|
||||
<van-dialog v-model="show" title="提示" show-cancel-button @confirm="authConfirm(authCode)" @cancel="clearTimer">
|
||||
<p class="p10 fs14">为确保是您本人操作,短信验证码已发送至您手机号{{ encyCustomerMobile }},请您输入验证码以完成后续投保操作。</p>
|
||||
<van-cell-group class="flex align-items-c pr5 mb15">
|
||||
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="authCode" clearable label-width="0" />
|
||||
<van-button type="danger" plain size="small" class="w160 p0" @click="getAuthCode" :disabled="codeDisabled" v-no-more-click="2000">{{
|
||||
codeDisabled ? `${countDown}s后重新获取` : '获取验证码'
|
||||
}}</van-button>
|
||||
</van-cell-group>
|
||||
</van-dialog>
|
||||
<UploadImageFile :typeface="idcardData.typeface && (faceAuthCount.weixin < smsAuthNum)" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage">
|
||||
</UploadImageFile>
|
||||
<div class="p60">
|
||||
<van-button type="danger" @click="uploadComparison" size="large">上传照片与证件照对比</van-button>
|
||||
@@ -22,16 +31,33 @@
|
||||
|
||||
<script>
|
||||
import UploadImageFile from '@/components/ebiz/sale/UploadImageFile'
|
||||
import { Button, Uploader, Dialog } from 'vant'
|
||||
import { Button, Uploader, Dialog, CellGroup, Field, Cell } from 'vant'
|
||||
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典进行页面展示
|
||||
import { getPolicyDetail, getReceiptSign } from '@/api/ebiz/serve/serve'
|
||||
import { uploadImg } from '@/api/ebiz/sale/sale'
|
||||
import { uploadImg, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale'
|
||||
import { formatAllRisk } from '@/assets/js/utils/formatRiskList'
|
||||
import { checkPhone } from '@/api/ebiz/customer/customer'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
return {
|
||||
show: false, // 获取短信验证码
|
||||
codeDisabled: false, // 获取验证码按钮是否禁用
|
||||
timeId: null, // 计时器ID
|
||||
countDown: 60, // 倒计时
|
||||
authCode: '', // 验证码
|
||||
smsAuthNum: 3,
|
||||
operaFlag: null,
|
||||
encyCustomerMobile: null,
|
||||
customerMobile: null,
|
||||
sid: null,
|
||||
//人脸识别认证次数
|
||||
faceAuthCount: {
|
||||
appnt: 0,
|
||||
insured: 0,
|
||||
weixin: 0
|
||||
},
|
||||
appntImg: '',
|
||||
idcardData: {
|
||||
typeface: false,
|
||||
@@ -69,9 +95,102 @@ export default {
|
||||
[Button.name]: Button,
|
||||
[Uploader.name]: Uploader,
|
||||
[Dialog.name]: Dialog,
|
||||
[CellGroup.name]: CellGroup,
|
||||
[Field.name]: Field,
|
||||
[Cell.name]: Cell,
|
||||
UploadImageFile: UploadImageFile
|
||||
},
|
||||
methods: {
|
||||
// 获取短信验证码
|
||||
getAuthCode() {
|
||||
this.codeDisabled = true
|
||||
//倒计时
|
||||
this.timeId = setInterval(() => {
|
||||
this.countDown--
|
||||
if (this.countDown <= 0) {
|
||||
window.clearInterval(this.timeId)
|
||||
this.codeDisabled = false
|
||||
this.countDown = 60
|
||||
}
|
||||
}, 1000)
|
||||
getAuthCode({
|
||||
operateType: 'appntInfoEntry',
|
||||
type: 'H5',
|
||||
operateCode: this.customerMobile,
|
||||
system: 'agentApp',
|
||||
operateCodeType: '0'
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.result == 0) {
|
||||
this.sid = res.sessionId
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 验证码确认事件
|
||||
async authConfirm() {
|
||||
//清理计时器
|
||||
this.clearTimer()
|
||||
this.changeSubmit()
|
||||
},
|
||||
// 清理计时器
|
||||
clearTimer() {
|
||||
window.clearInterval(this.timeId)
|
||||
this.timeId = null
|
||||
this.countDown = 60
|
||||
this.codeDisabled = false
|
||||
},
|
||||
//提交变更申请
|
||||
async changeSubmit() {
|
||||
if (null == this.sid) {
|
||||
this.$toast('请先进行发送短信验证码')
|
||||
return
|
||||
}
|
||||
let res = await autchCodeCheck({
|
||||
smsId: this.sid,
|
||||
code: this.authCode
|
||||
})
|
||||
if (res.result == 0) {
|
||||
this.next()
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
},
|
||||
realPeopelCheck() {
|
||||
this.$toast.loading({
|
||||
// 持续展示 toast
|
||||
duration: 0,
|
||||
// 禁用背景点击s
|
||||
forbidClick: true,
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
let data = {
|
||||
name: this.appntDTO.name,
|
||||
idType: this.appntDTO.idType,
|
||||
idNo: this.appntDTO.idNo,
|
||||
mobile: this.appntDTO.mobile
|
||||
}
|
||||
this.customerMobile = this.appntDTO.mobile
|
||||
this.encyCustomerMobile = this.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
||||
this.authCode = null
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
return new Promise((resolve, reject) => {
|
||||
checkPhone(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
console.log(res)
|
||||
this.show = true
|
||||
} else {
|
||||
Dialog.confirm({
|
||||
title: '提示',
|
||||
message: '抱歉,您预留的手机号非您本人的手机号,请进行线下投保!',
|
||||
showCancelButton: false
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
uploadComparison() {
|
||||
this.idcardData.typeface = !this.idcardData.typeface
|
||||
console.log('this.idcardData.queding', this.idcardData.typeface)
|
||||
@@ -82,6 +201,11 @@ export default {
|
||||
let that = this
|
||||
if (e) {
|
||||
that.disabled = false
|
||||
} else {
|
||||
this.faceAuthCount.weixin++;
|
||||
if (this.faceAuthCount.weixin >= this.smsAuthNum) {
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
}
|
||||
// if (e.result == '0') {
|
||||
// that.disabled = false
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
<!-- <van-cell title="交费期间" :value="Number(it.years) > 30 ? '至70周岁' : `${it.years}年交`" /> -->
|
||||
<van-cell title="交费期间" :value="it.payIntv" />
|
||||
|
||||
|
||||
<van-cell title="险种保额(元)" :value="it.amt | moneyFormat" />
|
||||
<van-cell title="险种保费(元)" :value="it.mainPremDetail | moneyFormat" />
|
||||
<van-collapse-item title="附加险信息" :name="num + 61" v-for="(i, num) in it.addtion" :key="num">
|
||||
@@ -78,6 +78,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</van-collapse>
|
||||
<van-dialog v-model="show" title="提示" show-cancel-button @confirm="authConfirm(authCode)" @cancel="clearTimer">
|
||||
<p class="p10 fs14">为确保是您本人操作,短信验证码已发送至您手机号{{ encyCustomerMobile }},请您输入验证码以完成后续投保操作。</p>
|
||||
<van-cell-group class="flex align-items-c pr5 mb15">
|
||||
<van-field maxlength="6" placeholder="请输入短信验证码" v-model="authCode" clearable label-width="0" />
|
||||
<van-button type="danger" plain size="small" class="w160 p0" @click="getAuthCode" :disabled="codeDisabled" v-no-more-click="2000">{{
|
||||
codeDisabled ? `${countDown}s后重新获取` : '获取验证码'
|
||||
}}</van-button>
|
||||
</van-cell-group>
|
||||
</van-dialog>
|
||||
<!-- 2019-09-27 版上线不含“回执签收” marked by panglizong on 2019-09-26 -->
|
||||
<div class="bottom-btn bg-white">
|
||||
<van-button type="danger" size="large" @click="next" v-if="OrderInfoDTO.orderStatus == '0'" v-no-more-click="1000">回执签收</van-button>
|
||||
@@ -86,13 +95,31 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Collapse, CollapseItem, Cell, CellGroup, Button } from 'vant'
|
||||
import { Collapse, CollapseItem, Cell, CellGroup, Button, Field, Dialog } from 'vant'
|
||||
import { getPolicyDetail, getReceiptSign } from '@/api/ebiz/serve/serve'
|
||||
import { getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale'
|
||||
import { checkPhone } from '@/api/ebiz/customer/customer'
|
||||
import dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典进行页面展示
|
||||
import { formatAllRisk } from '@/assets/js/utils/formatRiskList'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false, // 获取短信验证码
|
||||
codeDisabled: false, // 获取验证码按钮是否禁用
|
||||
timeId: null, // 计时器ID
|
||||
countDown: 60, // 倒计时
|
||||
authCode: '', // 验证码
|
||||
smsAuthNum: 3,
|
||||
operaFlag: null,
|
||||
encyCustomerMobile: null,
|
||||
customerMobile: null,
|
||||
sid: null,
|
||||
//人脸识别认证次数
|
||||
faceAuthCount: {
|
||||
appnt: 0,
|
||||
insured: 0,
|
||||
weixin: 0
|
||||
},
|
||||
// 折叠面板
|
||||
activeNames: ['1'],
|
||||
// 保单基本信息
|
||||
@@ -127,9 +154,101 @@ export default {
|
||||
[CollapseItem.name]: CollapseItem,
|
||||
[Cell.name]: Cell,
|
||||
[CellGroup.name]: CellGroup,
|
||||
[Button.name]: Button
|
||||
[Button.name]: Button,
|
||||
[Field.name]: Field,
|
||||
[Dialog.name]: Dialog
|
||||
},
|
||||
methods: {
|
||||
// 获取短信验证码
|
||||
getAuthCode() {
|
||||
this.codeDisabled = true
|
||||
//倒计时
|
||||
this.timeId = setInterval(() => {
|
||||
this.countDown--
|
||||
if (this.countDown <= 0) {
|
||||
window.clearInterval(this.timeId)
|
||||
this.codeDisabled = false
|
||||
this.countDown = 60
|
||||
}
|
||||
}, 1000)
|
||||
getAuthCode({
|
||||
operateType: 'appntInfoEntry',
|
||||
type: 'H5',
|
||||
operateCode: this.customerMobile,
|
||||
system: 'agentApp',
|
||||
operateCodeType: '0'
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.result == 0) {
|
||||
this.sid = res.sessionId
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 验证码确认事件
|
||||
async authConfirm() {
|
||||
//清理计时器
|
||||
this.clearTimer()
|
||||
this.changeSubmit()
|
||||
},
|
||||
// 清理计时器
|
||||
clearTimer() {
|
||||
window.clearInterval(this.timeId)
|
||||
this.timeId = null
|
||||
this.countDown = 60
|
||||
this.codeDisabled = false
|
||||
},
|
||||
//提交变更申请
|
||||
async changeSubmit() {
|
||||
if (null == this.sid) {
|
||||
this.$toast('请先进行发送短信验证码')
|
||||
return
|
||||
}
|
||||
let res = await autchCodeCheck({
|
||||
smsId: this.sid,
|
||||
code: this.authCode
|
||||
})
|
||||
if (res.result == 0) {
|
||||
this.toNextPage()
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
},
|
||||
realPeopelCheck() {
|
||||
this.$toast.loading({
|
||||
// 持续展示 toast
|
||||
duration: 0,
|
||||
// 禁用背景点击s
|
||||
forbidClick: true,
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
let data = {
|
||||
name: this.appntDTO.name,
|
||||
idType: this.appntDTO.idType,
|
||||
idNo: this.appntDTO.idNo,
|
||||
mobile: this.appntDTO.mobile
|
||||
}
|
||||
this.customerMobile = this.appntDTO.mobile
|
||||
this.encyCustomerMobile = this.customerMobile.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2')
|
||||
this.authCode = null
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
return new Promise((resolve, reject) => {
|
||||
checkPhone(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
console.log(res)
|
||||
this.show = true
|
||||
} else {
|
||||
Dialog.confirm({
|
||||
title: '提示',
|
||||
message: '抱歉,您预留的手机号非您本人的手机号,请进行线下投保!',
|
||||
showCancelButton: false
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取保单详情
|
||||
getPolicyDetail() {
|
||||
let that = this
|
||||
@@ -243,47 +362,58 @@ export default {
|
||||
},
|
||||
// 回执签收
|
||||
next() {
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
number: this.appntDTO.idNo, //身份证号码
|
||||
name: this.appntDTO.name //姓名
|
||||
}).then(data => {
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
if (JSON.parse(data).state == '1') {
|
||||
let params = {
|
||||
contNo: window.localStorage.getItem('policyNo')
|
||||
let that = this
|
||||
if (this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
number: this.appntDTO.idNo, //身份证号码
|
||||
name: this.appntDTO.name //姓名
|
||||
}).then(data => {
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
this.$toast.clear()
|
||||
if (JSON.parse(data).state == '1') {
|
||||
this.toNextPage()
|
||||
} else {
|
||||
that.faceAuthCount.appnt++
|
||||
if (that.faceAuthCount.appnt >= this.smsAuthNum) {
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
}
|
||||
getReceiptSign(params).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.$toast.clear()
|
||||
window.localStorage.setItem('insurance-policyUrl', res.signUrl)
|
||||
window.localStorage.setItem('detailJump', '1')
|
||||
window.localStorage.setItem('contNo', this.OrderInfoDTO.contNo)
|
||||
window.localStorage.setItem('orderNo', this.OrderInfoDTO.orderNo)
|
||||
window.localStorage.setItem('orderStatus', this.OrderInfoDTO.orderStatus)
|
||||
window.localStorage.setItem('saleInsuredInfo', JSON.stringify(this.appntDTO))
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/sale/signatureOfElectronic',
|
||||
forbidSwipeBack: '1',
|
||||
title: '保险合同签收回执电子确认书签名'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/sale/signatureOfElectronic'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
})
|
||||
} else {
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
},
|
||||
toNextPage() {
|
||||
let params = {
|
||||
contNo: window.localStorage.getItem('policyNo')
|
||||
}
|
||||
getReceiptSign(params).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.$toast.clear()
|
||||
window.localStorage.setItem('insurance-policyUrl', res.signUrl)
|
||||
window.localStorage.setItem('detailJump', '1')
|
||||
window.localStorage.setItem('contNo', this.OrderInfoDTO.contNo)
|
||||
window.localStorage.setItem('orderNo', this.OrderInfoDTO.orderNo)
|
||||
window.localStorage.setItem('orderStatus', this.OrderInfoDTO.orderStatus)
|
||||
window.localStorage.setItem('saleInsuredInfo', JSON.stringify(this.appntDTO))
|
||||
this.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/sale/signatureOfElectronic',
|
||||
forbidSwipeBack: '1',
|
||||
title: '保险合同签收回执电子确认书签名'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/sale/signatureOfElectronic'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$toast.clear()
|
||||
this.$toast(JSON.parse(data).error)
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user