mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-18 08:36: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
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//本人实名认证
|
||||||
|
export function checkPhone(data) {
|
||||||
|
return request({
|
||||||
|
url: getUrl('/customer/checkPhone', 1),
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
//查询代理人客户信息
|
//查询代理人客户信息
|
||||||
export function getAgentCustomerInfo(data) {
|
export function getAgentCustomerInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -61,7 +61,14 @@ export function getAuthCode(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 验证验证码
|
||||||
|
export function autchCodeCheck(data) {
|
||||||
|
return request({
|
||||||
|
url: getUrl('/customer/authcode/check', 1),
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 上传图片
|
// 上传图片
|
||||||
export function uploadImg(data) {
|
export function uploadImg(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -512,7 +512,8 @@ export default {
|
|||||||
idNo: appntDTO.idNo,
|
idNo: appntDTO.idNo,
|
||||||
appntId: appntDTO.appntId,
|
appntId: appntDTO.appntId,
|
||||||
healthGrade: appntDTO.healthGrade,
|
healthGrade: appntDTO.healthGrade,
|
||||||
lifeGrade: appntDTO.lifeGrade
|
lifeGrade: appntDTO.lifeGrade,
|
||||||
|
mobile: appntDTO.mobile
|
||||||
})
|
})
|
||||||
|
|
||||||
if (insuredDTO) {
|
if (insuredDTO) {
|
||||||
@@ -531,7 +532,8 @@ export default {
|
|||||||
insuredId: insuredDTO.insuredId,
|
insuredId: insuredDTO.insuredId,
|
||||||
idNo: insuredDTO.idNo,
|
idNo: insuredDTO.idNo,
|
||||||
healthGrade: insuredDTO.healthGrade,
|
healthGrade: insuredDTO.healthGrade,
|
||||||
lifeGrade: insuredDTO.lifeGrade
|
lifeGrade: insuredDTO.lifeGrade,
|
||||||
|
mobile: insuredDTO.mobile
|
||||||
})
|
})
|
||||||
|
|
||||||
let [chooseProductCodes, mainRiskCodes, addRiskCodes] = [[], [], []]
|
let [chooseProductCodes, mainRiskCodes, addRiskCodes] = [[], [], []]
|
||||||
|
|||||||
@@ -65,6 +65,14 @@ export default {
|
|||||||
this.$refs.file.dispatchEvent(new MouseEvent('click'))
|
this.$refs.file.dispatchEvent(new MouseEvent('click'))
|
||||||
},
|
},
|
||||||
addImg(e) {
|
addImg(e) {
|
||||||
|
this.$toast.loading({
|
||||||
|
// 持续展示 toast
|
||||||
|
duration: 0,
|
||||||
|
// 禁用背景点击s
|
||||||
|
forbidClick: true,
|
||||||
|
loadingType: 'spinner',
|
||||||
|
message: '加载中……'
|
||||||
|
})
|
||||||
let that = this
|
let that = this
|
||||||
this.file = this.$refs.file.files[0]
|
this.file = this.$refs.file.files[0]
|
||||||
var reader = new FileReader()
|
var reader = new FileReader()
|
||||||
|
|||||||
@@ -214,22 +214,56 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</UploadImageFile>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UploadImageFile from '@/components/ebiz/sale/UploadImageFile'
|
import UploadImageFile from '@/components/ebiz/sale/UploadImageFile'
|
||||||
import { Cell, CellGroup, Collapse, CollapseItem, Dialog } from 'vant'
|
import { Field, Cell, CellGroup, Collapse, CollapseItem, Dialog } from 'vant'
|
||||||
import { underWrite, getOrderDetail, getSignInvalid, checkSignInvalid } from '@/api/ebiz/sale/sale'
|
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 { weixinShare } from '@/assets/js/utils/wxShare.js'
|
||||||
// import axios from 'axios'
|
|
||||||
// import device from '@/assets/js/commons.js'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||||
return {
|
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: '',
|
riskName: '',
|
||||||
// 员工信息
|
// 员工信息
|
||||||
@@ -361,6 +395,119 @@ export default {
|
|||||||
this.isShow = true
|
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) {
|
start_ocr(val) {
|
||||||
// val 0投保人 1被保人 2本人
|
// val 0投保人 1被保人 2本人
|
||||||
@@ -374,9 +521,14 @@ export default {
|
|||||||
if (JSON.parse(this.$route.query.saleInsuredInfo).idType != '1') {
|
if (JSON.parse(this.$route.query.saleInsuredInfo).idType != '1') {
|
||||||
that.goUrl()
|
that.goUrl()
|
||||||
} else {
|
} else {
|
||||||
this.idcardData.typeface = !this.idcardData.typeface
|
if(this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||||
this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name
|
this.idcardData.typeface = !this.idcardData.typeface
|
||||||
this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredInfo).idNo
|
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 {
|
} else {
|
||||||
window.localStorage.setItem('sign-val', val)
|
window.localStorage.setItem('sign-val', val)
|
||||||
@@ -385,9 +537,14 @@ export default {
|
|||||||
// if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1') {
|
// if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1') {
|
||||||
that.insuredUrl()
|
that.insuredUrl()
|
||||||
} else {
|
} else {
|
||||||
this.idcardData.typeface = !this.idcardData.typeface
|
if(this.faceAuthCount.insured < this.smsAuthNum) {
|
||||||
this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredPersonInfo).name
|
this.idcardData.typeface = !this.idcardData.typeface
|
||||||
this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredPersonInfo).idNo
|
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 {
|
} else {
|
||||||
@@ -398,17 +555,26 @@ export default {
|
|||||||
// if (this.saleInsuredInfo.idType != '1' || this.saleInsuredInfo.age < '18') {
|
// if (this.saleInsuredInfo.idType != '1' || this.saleInsuredInfo.age < '18') {
|
||||||
that.goUrl()
|
that.goUrl()
|
||||||
} else {
|
} else {
|
||||||
// 原人脸识别
|
if(this.faceAuthCount.appnt < this.smsAuthNum){
|
||||||
EWebBridge.webCallAppInJs('face_auth', {
|
// 原人脸识别
|
||||||
number: that.saleInsuredInfo.idNo, //身份证号码
|
EWebBridge.webCallAppInJs('face_auth', {
|
||||||
name: that.saleInsuredInfo.name //姓名
|
number: that.saleInsuredInfo.idNo, //身份证号码
|
||||||
}).then(data => {
|
name: that.saleInsuredInfo.name //姓名
|
||||||
if (JSON.parse(data).state == '1') {
|
}).then(data => {
|
||||||
that.goUrl()
|
if (JSON.parse(data).state == '1') {
|
||||||
} else {
|
that.goUrl()
|
||||||
// EWebBridge.webCallAppInJs('webview_toast', '人脸检测失败')
|
} else {
|
||||||
}
|
that.faceAuthCount.appnt++;
|
||||||
})
|
if (this.faceAuthCount.appnt >= this.smsAuthNum) {
|
||||||
|
this.operaFlag = 'appnt'
|
||||||
|
this.realPeopelCheck()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.operaFlag = "appnt";
|
||||||
|
this.realPeopelCheck();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
window.localStorage.setItem('sign-val', val)
|
window.localStorage.setItem('sign-val', val)
|
||||||
@@ -417,17 +583,26 @@ export default {
|
|||||||
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '18') {
|
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '18') {
|
||||||
that.insuredUrl()
|
that.insuredUrl()
|
||||||
} else {
|
} else {
|
||||||
// 调原生人脸识别
|
if(this.faceAuthCount.insured < this.smsAuthNum) {
|
||||||
EWebBridge.webCallAppInJs('face_auth', {
|
// 调原生人脸识别
|
||||||
number: that.saleInsuredPersonInfo.idNo, //身份证号码
|
EWebBridge.webCallAppInJs('face_auth', {
|
||||||
name: that.saleInsuredPersonInfo.name //姓名
|
number: that.saleInsuredPersonInfo.idNo, //身份证号码
|
||||||
}).then(data => {
|
name: that.saleInsuredPersonInfo.name //姓名
|
||||||
if (JSON.parse(data).state == '1') {
|
}).then(data => {
|
||||||
that.insuredUrl()
|
if (JSON.parse(data).state == '1') {
|
||||||
} else {
|
that.insuredUrl()
|
||||||
// this.$toast(JSON.parse(data).error)
|
} 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')
|
orderNo: window.localStorage.getItem('orderNo')
|
||||||
}
|
}
|
||||||
localStorage.setItem('riskName', '')
|
localStorage.setItem('riskName', '')
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
getOrderDetail(data).then(res => {
|
getOrderDetail(data).then(res => {
|
||||||
if (res.result == '0') {
|
if (res.result == '0') {
|
||||||
//弹框展示是否有社保、赔付比例和免赔额信息
|
//弹框展示是否有社保、赔付比例和免赔额信息
|
||||||
@@ -875,6 +1050,16 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.goUrl()
|
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,
|
[Collapse.name]: Collapse,
|
||||||
UploadImageFile: UploadImageFile,
|
UploadImageFile: UploadImageFile,
|
||||||
[CollapseItem.name]: CollapseItem,
|
[CollapseItem.name]: CollapseItem,
|
||||||
[Dialog.name]: Dialog
|
[Dialog.name]: Dialog,
|
||||||
},
|
[Field.name]: Field
|
||||||
|
},
|
||||||
beforeRouteLeave(to, from, next) {
|
beforeRouteLeave(to, from, next) {
|
||||||
document.body.style.backgroundColor = ''
|
document.body.style.backgroundColor = ''
|
||||||
next()
|
next()
|
||||||
|
|||||||
@@ -9,7 +9,16 @@
|
|||||||
:max-count="1"
|
:max-count="1"
|
||||||
@delete="deleteImg"
|
@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>
|
</UploadImageFile>
|
||||||
<div class="p60">
|
<div class="p60">
|
||||||
<van-button type="danger" @click="uploadComparison" size="large">上传照片与证件照对比</van-button>
|
<van-button type="danger" @click="uploadComparison" size="large">上传照片与证件照对比</van-button>
|
||||||
@@ -22,16 +31,33 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UploadImageFile from '@/components/ebiz/sale/UploadImageFile'
|
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 dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典进行页面展示
|
||||||
import { getPolicyDetail, getReceiptSign } from '@/api/ebiz/serve/serve'
|
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 { formatAllRisk } from '@/assets/js/utils/formatRiskList'
|
||||||
|
import { checkPhone } from '@/api/ebiz/customer/customer'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||||
return {
|
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: '',
|
appntImg: '',
|
||||||
idcardData: {
|
idcardData: {
|
||||||
typeface: false,
|
typeface: false,
|
||||||
@@ -69,9 +95,102 @@ export default {
|
|||||||
[Button.name]: Button,
|
[Button.name]: Button,
|
||||||
[Uploader.name]: Uploader,
|
[Uploader.name]: Uploader,
|
||||||
[Dialog.name]: Dialog,
|
[Dialog.name]: Dialog,
|
||||||
|
[CellGroup.name]: CellGroup,
|
||||||
|
[Field.name]: Field,
|
||||||
|
[Cell.name]: Cell,
|
||||||
UploadImageFile: UploadImageFile
|
UploadImageFile: UploadImageFile
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
uploadComparison() {
|
||||||
this.idcardData.typeface = !this.idcardData.typeface
|
this.idcardData.typeface = !this.idcardData.typeface
|
||||||
console.log('this.idcardData.queding', this.idcardData.typeface)
|
console.log('this.idcardData.queding', this.idcardData.typeface)
|
||||||
@@ -82,6 +201,11 @@ export default {
|
|||||||
let that = this
|
let that = this
|
||||||
if (e) {
|
if (e) {
|
||||||
that.disabled = false
|
that.disabled = false
|
||||||
|
} else {
|
||||||
|
this.faceAuthCount.weixin++;
|
||||||
|
if (this.faceAuthCount.weixin >= this.smsAuthNum) {
|
||||||
|
this.realPeopelCheck()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// if (e.result == '0') {
|
// if (e.result == '0') {
|
||||||
// that.disabled = false
|
// that.disabled = false
|
||||||
|
|||||||
@@ -78,6 +78,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</van-collapse>
|
</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 -->
|
<!-- 2019-09-27 版上线不含“回执签收” marked by panglizong on 2019-09-26 -->
|
||||||
<div class="bottom-btn bg-white">
|
<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>
|
<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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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 { 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 dataDictionary from '@/assets/js/utils/data-dictionary' //根据数据字典进行页面展示
|
||||||
import { formatAllRisk } from '@/assets/js/utils/formatRiskList'
|
import { formatAllRisk } from '@/assets/js/utils/formatRiskList'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
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'],
|
activeNames: ['1'],
|
||||||
// 保单基本信息
|
// 保单基本信息
|
||||||
@@ -127,9 +154,101 @@ export default {
|
|||||||
[CollapseItem.name]: CollapseItem,
|
[CollapseItem.name]: CollapseItem,
|
||||||
[Cell.name]: Cell,
|
[Cell.name]: Cell,
|
||||||
[CellGroup.name]: CellGroup,
|
[CellGroup.name]: CellGroup,
|
||||||
[Button.name]: Button
|
[Button.name]: Button,
|
||||||
|
[Field.name]: Field,
|
||||||
|
[Dialog.name]: Dialog
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
getPolicyDetail() {
|
||||||
let that = this
|
let that = this
|
||||||
@@ -243,47 +362,58 @@ export default {
|
|||||||
},
|
},
|
||||||
// 回执签收
|
// 回执签收
|
||||||
next() {
|
next() {
|
||||||
EWebBridge.webCallAppInJs('face_auth', {
|
let that = this
|
||||||
number: this.appntDTO.idNo, //身份证号码
|
if (this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||||
name: this.appntDTO.name //姓名
|
EWebBridge.webCallAppInJs('face_auth', {
|
||||||
}).then(data => {
|
number: this.appntDTO.idNo, //身份证号码
|
||||||
this.$toast.loading({
|
name: this.appntDTO.name //姓名
|
||||||
duration: 0, // 持续展示 toast
|
}).then(data => {
|
||||||
forbidClick: true, // 禁用背景点击
|
this.$toast.loading({
|
||||||
loadingType: 'spinner',
|
duration: 0, // 持续展示 toast
|
||||||
message: '加载中……'
|
forbidClick: true, // 禁用背景点击
|
||||||
})
|
loadingType: 'spinner',
|
||||||
if (JSON.parse(data).state == '1') {
|
message: '加载中……'
|
||||||
let params = {
|
})
|
||||||
contNo: window.localStorage.getItem('policyNo')
|
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') {
|
} else {
|
||||||
this.$toast.clear()
|
this.realPeopelCheck()
|
||||||
window.localStorage.setItem('insurance-policyUrl', res.signUrl)
|
}
|
||||||
window.localStorage.setItem('detailJump', '1')
|
},
|
||||||
window.localStorage.setItem('contNo', this.OrderInfoDTO.contNo)
|
toNextPage() {
|
||||||
window.localStorage.setItem('orderNo', this.OrderInfoDTO.orderNo)
|
let params = {
|
||||||
window.localStorage.setItem('orderStatus', this.OrderInfoDTO.orderStatus)
|
contNo: window.localStorage.getItem('policyNo')
|
||||||
window.localStorage.setItem('saleInsuredInfo', JSON.stringify(this.appntDTO))
|
}
|
||||||
this.$jump({
|
getReceiptSign(params).then(res => {
|
||||||
flag: 'h5',
|
if (res.result == '0') {
|
||||||
extra: {
|
this.$toast.clear()
|
||||||
url: location.origin + '/#/sale/signatureOfElectronic',
|
window.localStorage.setItem('insurance-policyUrl', res.signUrl)
|
||||||
forbidSwipeBack: '1',
|
window.localStorage.setItem('detailJump', '1')
|
||||||
title: '保险合同签收回执电子确认书签名'
|
window.localStorage.setItem('contNo', this.OrderInfoDTO.contNo)
|
||||||
},
|
window.localStorage.setItem('orderNo', this.OrderInfoDTO.orderNo)
|
||||||
routerInfo: {
|
window.localStorage.setItem('orderStatus', this.OrderInfoDTO.orderStatus)
|
||||||
path: '/sale/signatureOfElectronic'
|
window.localStorage.setItem('saleInsuredInfo', JSON.stringify(this.appntDTO))
|
||||||
}
|
this.$jump({
|
||||||
})
|
flag: 'h5',
|
||||||
} else {
|
extra: {
|
||||||
this.$toast(res.resultMessage)
|
url: location.origin + '/#/sale/signatureOfElectronic',
|
||||||
|
forbidSwipeBack: '1',
|
||||||
|
title: '保险合同签收回执电子确认书签名'
|
||||||
|
},
|
||||||
|
routerInfo: {
|
||||||
|
path: '/sale/signatureOfElectronic'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$toast.clear()
|
this.$toast(res.resultMessage)
|
||||||
this.$toast(JSON.parse(data).error)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user