Files
ebiz-h5/src/views/ebiz/sale/SignatureConfirmation.vue
liu.xiaofeng@ebiz-digits.com bb22178b4e 将被保人文件数组排序
2023-11-15 15:24:08 +08:00

1978 lines
78 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div class="signature-container">
<div class="signature-content pb40">
<div v-if="!isWeixin">
<index-bar></index-bar>
</div>
<div v-if="isWeixin" class="bg-white mt10 p20 fs14 tips">
<p>
尊敬的
<span>{{ tipsName }}</span
>先生/女士您好
</p>
<p>该保单由国富人寿保险股份有限公司进行承保具体确认信息如下</p>
</div>
<van-cell-group class="mt10">
<van-cell title="销售人员工号" :value="recmd.agentCode" />
<van-cell title="销售人员姓名" :value="recmd.name" />
<van-cell title="投保单号" :value="orderInfo.orderNo" @click="toTest"></van-cell>
<van-cell title="投保日期" :value="date" />
<van-cell title="保费合计(元)" :value="orderInfo.orderAmount == undefined ? '' : orderInfo.orderAmount | moneyFormat" />
</van-cell-group>
<div v-if="!isWeixin">
<!-- 不再微信 -->
<van-collapse v-model="activeNames" class="mt10">
<van-collapse-item name="0" v-if="showAgentView == 1">
<div slot="title">
代理人
<span class="ml20">{{ recmd.name }}</span>
</div>
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
<div v-if="changeCard">
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ agentSign.documentName }}</span>
<img :src="src" v-if="agentSign.documentStatus == '1'" />
</p>
</div>
<div v-else>
<div v-for="(item, index) in agentSign" :key="index">
<p>{{ item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13' || item.documentCode == '14' ? '需阅读' : '需签署' }}</p>
<p class="mb20">
<span class="text">{{ item.documentName }}</span>
<img :src="src" v-if="(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '1'" />
<img :src="src" v-if="!(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '3'" />
</p>
</div>
</div>
<p class="start" v-if="airSign != '1'">点击开始进行相关操作</p>
<div v-if="!isInvalid" class="flex justify-content-a mt20">
<van-button
type="danger"
size="normal"
class="w150"
plain
:disabled="changeCard ? agentSign.documentStatus == '1' : agentSignStatus == '3'"
v-no-more-click="1000"
@click="start_agent('3')"
>开始</van-button
>
</div>
<div class="text" v-else>操作时间已失效请联系销售人员</div>
</van-collapse-item>
</van-collapse>
<van-collapse v-model="activeNames" class="mt10">
<van-collapse-item name="1">
<div slot="title">
投保人
<span class="ml20">{{ appnt.name }}</span>
</div>
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
<div v-if="changeCard">
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ appntSign.documentName }}</span>
<img :src="src" v-if="appntSign.documentStatus == '1'" />
</p>
</div>
<div v-else>
<div v-for="(item, index) in appntSign" :key="index">
<p>{{ item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14' ? '需阅读' : '需签署' }}</p>
<p class="mb20">
<span class="text">{{ item.documentName }}</span>
<img :src="src" v-if="(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '1'" />
<img :src="src" v-if="!(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '3'" />
</p>
</div>
</div>
<p class="start" v-if="airSign != '1'">点击开始分享进行相关操作</p>
<div v-if="!isInvalid" class="flex justify-content-a mt20">
<van-button
v-if="isShow"
type="danger"
size="normal"
class="w150"
plain
v-no-more-click="1000"
:disabled="changeCard ? appntSign.documentStatus == '1' : appntSignStatus == '3'"
@click="share(saleInsuredPersonInfo.relationToAppnt == '1' ? '2' : '0')"
>分享</van-button
>
<!-- 前端测试 -->
<van-button
type="danger"
size="normal"
class="w150"
plain
:disabled="changeCard ? appntSign.documentStatus == '1' : appntSignStatus == '3'"
v-no-more-click="1000"
@click="start_ocr(saleInsuredPersonInfo.relationToAppnt == '1' ? '2' : '0')"
>开始</van-button
>
</div>
<div class="text" v-else>操作时间已失效请联系销售人员</div>
</van-collapse-item>
</van-collapse>
<div v-if="relationToAppnt != '1' && !changeCard" class="mt10">
<van-collapse v-model="activeNames" v-for="(item, index) in insured" :key="index">
<van-collapse-item :name="index + 2">
<div slot="title">
被保险人
<span class="ml20">{{ item.name }}</span>
</div>
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
<div v-for="(item, index) in insuredSign" :key="index">
<p>{{ item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '12' || item.documentCode == '13' || item.documentCode == '14'? '需阅读' : '需签署' }}</p>
<p class="mb20">
<span class="text">{{ item.documentName }}</span>
<img :src="src" v-if="(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '1'" />
<img :src="src" v-if="!(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '3'" />
</p>
</div>
<p class="start" v-if="airSign != '1'">点击开始分享进行相关操作</p>
<div v-if="!isInvalid" class="flex justify-content-a mt20">
<van-button
v-if="isShow"
type="danger"
size="normal"
class="w150"
:disabled="insuredSignStatus == '3'"
@click="share('1')"
plain
v-no-more-click="1000"
>分享</van-button
>
<van-button type="danger" size="normal" plain class="w150" :disabled="insuredSignStatus == '3'" @click="start_ocr('1')" v-no-more-click="1000"
>开始</van-button
>
</div>
<div class="text" v-else>操作时间已失效请联系销售人员</div>
</van-collapse-item>
</van-collapse>
</div>
</div>
<div v-else>
<!-- 在微信 -->
<div v-if="shareCode != '1'" class="mt10">
<van-collapse v-model="activeNames">
<van-collapse-item name="1">
<div slot="title">
投保人
<span class="ml20">{{ appnt.name }}</span>
</div>
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
<div v-if="changeCard">
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ appntSign.documentName }}</span>
<img :src="src" v-if="appntSign.documentStatus == '1'" />
</p>
</div>
<div v-else>
<div v-for="(item, index) in appntSign" :key="index">
<p>{{ item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14'? '需阅读' : '需签署' }}</p>
<p class="mb20">
<span class="text">{{ item.documentName }}</span>
<img :src="src" v-if="(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '1'" />
<img :src="src" v-if="!(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '9' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '3'" />
</p>
</div>
</div>
<p class="start" v-if="airSign != '1'">点击开始分享进行相关操作</p>
<div v-if="!isInvalid" class="flex justify-content-a mt20">
<van-button
type="danger"
size="normal"
style="width: 157px"
plain
:disabled="changeCard ? appntSign.documentStatus == '1' : appntSignStatus == '3'"
v-no-more-click="1000"
@click="start_ocr(saleInsuredPersonInfo.relationToAppnt == '1' ? '2' : '0')"
>开始</van-button
>
</div>
<div class="text" v-else>操作时间已失效请联系销售人员</div>
</van-collapse-item>
</van-collapse>
</div>
<div v-else class="mt10">
<van-collapse v-model="activeNames" v-for="(item, index) in insured" :key="index">
<van-collapse-item :name="index + 2">
<div slot="title">
被保险人
<span class="ml20">{{ item.name }}</span>
</div>
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
<div v-for="(item, index) in insuredSign" :key="index">
<p>{{ item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14' ? '需阅读' : '需签署' }}</p>
<p class="mb20">
<span class="text">{{ item.documentName }}</span>
<img :src="src" v-if="(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '1'" />
<img :src="src" v-if="!(item.documentCode == '1' || item.documentCode == '3' || item.documentCode == '8' || item.documentCode == '12' || item.documentCode == '13'|| item.documentCode == '14') && item.documentStatus == '3'" />
</p>
</div>
<p class="start" v-if="airSign != '1'">点击开始分享进行相关操作</p>
<div v-if="!isInvalid" class="flex justify-content-a mt20">
<van-button
type="danger"
size="normal"
plain
style="width: 157px"
:disabled="insuredSignStatus == '3'"
@click="start_ocr('1')"
v-no-more-click="1000"
>开始</van-button
>
</div>
<div class="text" v-else>操作时间已失效请联系销售人员</div>
</van-collapse-item>
</van-collapse>
</div>
</div>
</div>
<div v-if="!isWeixin">
<div v-if="changeCard">
<div class="bottom-btn bg-white" v-if="appntSign.documentStatus == '1'">
<van-button
type="danger"
v-if="relationToAppnt == '1' ? true : appntSign.documentStatus == '1' ? true : false"
size="large"
@click="rePayMent"
v-no-more-click="1000"
>支付</van-button
>
</div>
</div>
<div v-else>
<!--判断代理人自保件承诺书是否签名 或者不是自保件 投保人是否都签名-->
<div class="bottom-btn bg-white" v-if="(agentSignStatus == '3'&& appntSignStatus == '3')||(agentSignStatus == ''&& appntSignStatus == '3')">
<van-button
type="danger"
v-if="relationToAppnt == '1' ? true : insuredSignStatus == '3' ? true : false"
size="large"
@click="next"
v-no-more-click="1000"
>提交</van-button
>
</div>
</div>
</div>
<van-popup v-model="videoShow" position="bottom" style="height: 100vh; background: #666">
<!-- <video controls style="width: 100%; max-height: calc(100vh - 60px)" src="/app/video/rlsb.mp4"></video> -->
<div class="" v-if="videoShow" style="height: calc(100vh - 60px); display: flex; align-items: center; flex-flow: column; justify-content: center">
<!-- <van-notice-bar :scrollable="false" class="notice" style="width: 100%">为维护您的合法权益请您务必观看防范销售误导视频</van-notice-bar> -->
<video
controls
style="width: 100%; max-height: calc(100vh - 60px)"
:src="'https://gf-dev-202005-1254138932.cos.ap-shanghai-fsi.myqcloud.com/gfapp/pub01/2021/04/28/guofulive.MP4'"
ref="vid"
@timeupdate="timeupdate"
></video>
</div>
<div class="bottom-btn bg-white">
<van-button type="danger" size="large" @click="isVideoUrlClick()" v-no-more-click="1000">下一步</van-button>
</div>
</van-popup>
<!-- 短信验证 -->
<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 { Field, Cell, CellGroup, Collapse, CollapseItem, Dialog, NoticeBar } from 'vant'
import {
underWrite,
getOrderDetail,
getSignInvalid,
checkSignInvalid,
getAuthCode,
autchCodeCheck,
getRecognitionUrl,
getRecognitionResult,
saveCustomerRid
} from '@/api/ebiz/sale/sale'
import { getAgentInfo } from '@/api/ebiz/my/my.js'
import { checkPhone } from '@/api/ebiz/customer/customer'
import { weixinShare } from '@/assets/js/utils/wxShare.js'
import IndexBar from '@/components/ebiz/sale/IndexBar'
import Formatter from '@/assets/js/utils/date-utils.js'
import { getWhitelist } from '@/api/ebiz/whitelist'
export default {
data() {
let isWeixin = this.$utils.device().isWeixin //判断环境
return {
isInsuYearFlag: false, //是否为长期险
isVideo: false, //是否已阅读视频
isVideoNext: false,
videoShow: false, //防误导视频
show: false, // 获取短信验证码
codeDisabled: false, // 获取验证码按钮是否禁用
timeId: null, // 计时器ID
countDown: 60, // 倒计时
authCode: '', // 验证码
smsAuthNum: 3,
operaFlag: null,
encyCustomerMobile: null,
sid: null,
isVideoUrl: '',
//人脸识别认证次数
faceAuthCount: {
appnt: 0,
insured: 0,
weixin: 0
},
customerMobile: '',
//保险产品名称
riskName: '',
// 员工信息
recmd: {},
// 投保时间
date: '',
// 订单信息
orderInfo: {},
// 投保人信息
appnt: {},
// 被保险人信息
insured: [],
// 投保人签名阅读信息
appntSign: [],
//代理人签名阅读信息
agentSign: [],
// 被保险人签名阅读信息
insuredSign: [],
// 折叠面板
activeNames: ['0','1', '2'],
// 图片路径
src: this.$assetsUrl + 'images/u6490.png',
// 被保险人信息
saleInsuredPersonInfo: {},
// 投保人信息
saleInsuredInfo: {},
// 是否在微信
isWeixin,
// 是否显示 在微信中不显示
isShow: true,
// 调微信人脸的token
tokenInweixin: '',
// 投保人被保险人是否同一个人,1代表是同一个人
relationToAppnt: '',
// 微信分享校验值
signInvalid: '',
// 微信分享链接是否失效 false 为未失效 true为已失效
isInvalid: false,
// 是谁分享的微信链接 1为被保险人 0或2为投保人 3代理人
shareCode: '',
// 是否从空签成功跳转过来 1为是 其他为不是
airSign: '',
// 空签时顶部姓名
tipsName: '',
idcardData: {
realName: '',
idno: '',
redirectUrl: '',
businessSource: '1' //微信端人脸识别业务来源:1-电投2-入司3-理赔4-保全
},
// idcardData: {
// typeface: false,
// idcardName: '',
// idcardNumber: ''
// },
appntSignStatus: '', //投保人电子签名状态
insuredSignStatus: '', //被保险人电子签名状态
agentSignStatus:'', //代理人电子签名状态
changeCard: localStorage.changeCard,
salePageFlag: '-10',
recognizeResult: '', //微信端-人脸识别结果
recognizeMessage: '', //微信端-人脸识别失败原因
realPeopleRidInfo: {
appntRidFlag: null,
insureRidFlag: null
},
showAgentView:0
}
},
methods: {
timeupdate() {
console.log(this.$refs['vid'].paused)
if (!this.$refs['vid'].paused) {
this.isVideoNext = true
}
},
fakeFaceAuth(expect) {
console.log('模拟调用人脸识别')
return new Promise(function (resolve, reject) {
setTimeout(() => {
console.log('模拟人脸识别完成')
if (expect) {
resolve({ state: '0' })
} else {
reject({ state: '0' })
}
}, 2000)
})
},
appCallBack(data) {
if (data.trigger == 'left_button_click') {
if (this.videoShow) {
this.$jump({
flag: 'navigation',
extra: {
title: '签名确认',
hiddenRight: '1'
}
})
return (this.videoShow = false)
}
return this.$dialog
.confirm({
className: 'dialog-delete',
title: '提示',
message: '退出流程可能会丢失部分数据,是否确认退出?',
cancelButtonColor: '#E9332E',
confirmButtonColor: '#FFFFFF'
})
.then(() => {
this.$jump({
flag: 'h5',
extra: {
title: '电子投保单列表',
forbidSwipeBack: 1, //当前页面禁止右滑返回
url: location.origin + `/#/sale/list`
},
routerInfo: {
path: `/sale/list`,
type: '1'
}
})
})
.catch(() => {
return
})
}
},
isVideoUrlClick() {
console.log(this.isVideoUrl)
if (!this.isVideoNext) {
this.$dialog
.alert({
className: 'dialog-alert',
title: '提示',
message: '为维护您的合法权益,请您务必认真观看防范销售误导视频。',
confirmButtonColor: '#ee0a24',
confirmButtonText: '确认'
})
.then(() => {})
} else {
this.isVideoNext = !this.isVideoNext
this.isVideoUrl == 'goUrl' ? this.goUrl() : this.insuredUrl()
}
},
// 初始化
async init() {
localStorage.doubleRecordFlag = '0' //0不是双录单 1是双录单
if (this.isWeixin) {
if (this.$route.query.airSign) {
sessionStorage.setItem('airSign', this.$route.query.airSign)
}
// this.$CacheUtils.setLocItem('saleInsuredInfo', this.$route.query.saleInsuredInfo)
// window.localStorage.setItem('saleInsuredPersonInfo', this.$route.query.saleInsuredPersonInfo)
window.localStorage.setItem('token', this.$route.query.token)
window.localStorage.setItem('orderNo', this.$route.query.orderNo)
// window.localStorage.setItem('relationToAppnt', this.$route.query.relationToAppnt)
// window.localStorage.setItem('productCode', this.$route.query.productCode)
if (this.$route.query.changeCard == '0') {
localStorage.setItem('changeCard', true)
} else {
localStorage.removeItem('changeCard')
}
if (this.$route.query.signInvalid) {
sessionStorage.setItem('signInvalid', this.$route.query.signInvalid)
}
if (this.$route.query.shareCode) {
sessionStorage.setItem('shareCode', this.$route.query.shareCode)
}
let signInvalid = sessionStorage.getItem('signInvalid')
let rs = await this.checkSignInvalid(signInvalid)
console.log('````````````')
console.log('rs: ' + rs)
if (rs == '1') {
this.isInvalid = false
} else {
this.isInvalid = true
}
this.airSign = sessionStorage.getItem('airSign')
this.shareCode = sessionStorage.getItem('shareCode')
this.changeCard = localStorage.getItem('changeCard')
this.relationToAppnt = this.$route.query.relationToAppnt
this.isShow = false
await this.getOrderDetail()
console.log('初始化this.appntSign ==', this.appntSign)
if (
(this.appntSignStatus == '3' && sessionStorage.getItem('shareCode') == '0') ||
(this.appntSignStatus == '3' && sessionStorage.getItem('shareCode') == '2')
) {
// this.$toast('签名成功,请联系业务员进行后续流程!')
Dialog.alert({ title: '提示', message: '签名成功,请联系业务员进行后续流程!' })
} else if (this.insuredSignStatus == '3' && sessionStorage.getItem('shareCode') == '1') {
Dialog.alert({ title: '提示', message: '签名成功,请联系业务员进行后续流程!' })
}
if (this.changeCard && this.appntSign.documentStatus == '1') {
Dialog.alert({ title: '提示', message: '确认完成,请联系业务员完成后续流程!' })
}
// localStorage['faceAuthWeXin-requestId'] localStorage['faceAuthWeXin-bizToken']--微信端人脸识别获取腾讯认证url接口获得认证相关参数
if (localStorage['faceAuthWeXin-requestId'] && localStorage['faceAuthWeXin-bizToken'] && this.$route.query.faceAuthCountWeixin != undefined) {
this.getRecognitionResult(JSON.parse(localStorage['faceAuthWeXin-requestId']), JSON.parse(localStorage['faceAuthWeXin-bizToken']))
}
if (sessionStorage.shareCode == '1') {
console.log('进来被保险人')
this.tipsName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).name
} else if(sessionStorage.shareCode == '3'){
console.log('进来代理人')
this.tipsName =this.recmd.name
}else {
console.log('进来投保人')
this.tipsName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).name
// console.log('localStorage.saleInsuredInfo', localStorage.saleInsuredInfo)
// console.log('localStorage.saleInsuredInfo.name', localStorage.saleInsuredInfo.name)
// console.log('this.tipName', this.tipsName)
}
weixinShare({
title: '国富人寿计划书',
imgUrl: 'http://47.96.143.111:8000/app/images/logo.png',
desc: '国富为您量身定制的保险产品,请查收'
})
// let params = {
// orderNo: ''
// }
this.faceAuthCount.appnt = this.$route.query.faceAuthCountAppnt == undefined ? 0 : Number(this.$route.query.faceAuthCountAppnt)
this.faceAuthCount.insured = this.$route.query.faceAuthCountInsured == undefined ? 0 : Number(this.$route.query.faceAuthCountInsured)
this.faceAuthCount.weixin = this.$route.query.faceAuthCountWeixin == undefined ? 0 : Number(this.$route.query.faceAuthCountWeixin)
} else {
// 获取详情消息
this.getOrderDetail()
this.getSignInvalid()
this.isShow = true
}
},
// 获取消息和阅读状态
realPeopelCheck() {
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(this.$CacheUtils.getLocItem('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(this.$CacheUtils.getLocItem('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')
}
// 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
})
}
})
})
},
// 手机号鉴权
async realPeopleCheckMobile(type) {
this.$toast.loading({
// 持续展示 toast
duration: 0,
// 禁用背景点击s
forbidClick: true,
loadingType: 'spinner',
message: '加载中……'
})
let data = {}
if ('appnt' == type) {
let appntData = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
data = {
name: appntData.name,
idType: appntData.idType,
idNo: appntData.idNo,
mobile: appntData.mobile
}
} else if ('insured' == type) {
let insuredData = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
data = {
name: insuredData.name,
idType: insuredData.idType,
idNo: insuredData.idNo,
mobile: insuredData.mobile
}
}
let res = await checkPhone(data)
return res
},
// 验证码确认事件
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() {
let that = this
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) {
that.saveCustomerRidInfo('appnt_rid', 'A')
this.goUrl()
} else if ('insured' == this.operaFlag) {
that.saveCustomerRidInfo('insured_rid', 'A')
this.insuredUrl()
}
} else {
this.$toast(res.resultMessage)
}
},
beforeDestroy() {
//清理计时器
this.clearTimer()
},
// 人脸识别
async start_ocr(val) {
// val 0投保人 1被保险人 2本人
// return this.$dialog
// .alert({
// className: 'dialog-alert',
// title: '提示',
// message: '为维护您的合法权益,请您务必认真观看防范销售误导视频。',
// confirmButtonColor: '#ee0a24',
// confirmButtonText: '确认'
// })
// .then(() => {
// this.$jump({
// flag: 'navigation',
// extra: {
// title: '防范销售误导',
// hiddenRight: '1'
// }
// })
// this.videoShow = true
// this.isVideo = true
// this.isVideoUrl = 'goUrl'
// })
console.log('人脸识别')
console.log(val)
let that = this
if (this.isWeixin) {
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-appnt', JSON.stringify(that.appntSign))
if (val == '0' || val == '2') {
//idtype不为身份证跳过人脸识别
if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '1') {
that.goUrl()
} else {
// 白名单校验
const res = await getWhitelist({
idNo: this.saleInsuredInfo.idNo,
name: this.saleInsuredInfo.name,
whiteType: 'sale_face_show'
})
if (res.result === '0') {
// 在白名单内
if (res.content && res.content.length) {
this.goUrl()
return
}
} else {
this.$toast(res.resultMessage)
}
//RID 状态--有效
if (this.realPeopleRidInfo.appntRidFlag && this.realPeopleRidInfo.appntRidFlag == '0') {
// 手机号鉴权 --通过
let res = await this.realPeopleCheckMobile('appnt')
if (res && res.result == '0') {
that.goUrl()
return
}
}
// 人脸识别
if (this.faceAuthCount.appnt < this.smsAuthNum) {
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).name
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idNo
this.recognition()
} else {
this.operaFlag = 'appnt'
this.realPeopelCheck()
}
}
} else {
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-insured', JSON.stringify(that.insuredSign))
let thismysaleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
let thismyage = ''
if(thismysaleInsuredPersonInfo.age === 0 || thismysaleInsuredPersonInfo.age === '0' || thismysaleInsuredPersonInfo.age){
thismyage = thismysaleInsuredPersonInfo.age
} else {
thismyage = thismysaleInsuredPersonInfo.insuredAge
}
if (
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idType != '1' || thismyage < '18'
) {
that.insuredUrl()
} else {
// 白名单校验
const res = await getWhitelist({
idNo: this.saleInsuredPersonInfo.idNo,
name: this.saleInsuredPersonInfo.name,
whiteType: 'sale_face_show'
})
if (res.result === '0') {
// 用户在白名单内
if (res.content && res.content.length) {
this.insuredUrl()
return
}
} else {
this.$toast(res.resultMessage)
}
//RID 状态--有效
if (this.realPeopleRidInfo.insureRidFlag && this.realPeopleRidInfo.insureRidFlag == '0') {
// 手机号鉴权 --通过
let res = await this.realPeopleCheckMobile('insured')
if (res && res.result == '0') {
that.insuredUrl()
return
}
}
// 人脸识别
if (this.faceAuthCount.insured < this.smsAuthNum) {
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).name
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idNo
this.recognition()
} else {
this.operaFlag = 'insured'
this.realPeopelCheck()
}
}
}
} else {
if (val == '0' || val == '2') {
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-appnt', JSON.stringify(that.appntSign))
if (this.saleInsuredInfo.idType != '1') {
that.goUrl()
} else {
//RID 状态--有效
if (this.realPeopleRidInfo.appntRidFlag && this.realPeopleRidInfo.appntRidFlag == '0') {
// 手机号鉴权 --通过
let res = await this.realPeopleCheckMobile('appnt')
if (res && res.result == '0') {
that.goUrl()
return
}
}
// 白名单校验
const res = await getWhitelist({
idNo: this.saleInsuredInfo.idNo,
name: this.saleInsuredInfo.name,
whiteType: 'sale_face_show'
})
if (res.result === '0') {
// 在白名单内
if (res.content && res.content.length) {
this.goUrl()
return
}
} else {
this.$toast(res.resultMessage)
}
if (this.faceAuthCount.appnt < this.smsAuthNum) {
// 人脸识别
//eslint-disable-next-line no-undef
const authRes = await EWebBridge.webCallAppInJs('face_auth', {
businessSource: '1', //业务来源:1-电投2-入司3-理赔4-保全
number: that.saleInsuredInfo.idNo, //身份证号码
name: that.saleInsuredInfo.name //姓名
}).then((data) => {
if (JSON.parse(data).state == '1') {
// 保存rid 数据
that.saveCustomerRidInfo('appnt_rid', 'B')
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)
window.localStorage.setItem('sign-insured', JSON.stringify(that.insuredSign))
let thismyage = ''
if(this.saleInsuredPersonInfo.age === 0 || this.saleInsuredPersonInfo.age === '0' || this.saleInsuredPersonInfo.age){
thismyage = this.saleInsuredPersonInfo.age
} else {
thismyage = this.saleInsuredPersonInfo.insuredAge
}
if (this.saleInsuredPersonInfo.idType != '1' || thismyage < '18') {
that.insuredUrl()
} else {
//RID 状态--有效
if (this.realPeopleRidInfo.insureRidFlag && this.realPeopleRidInfo.insureRidFlag == '0') {
// 手机号鉴权 --通过
let res = await this.realPeopleCheckMobile('insured')
if (res && res.result == '0') {
that.insuredUrl()
return
}
}
// 白名单校验
const res = await getWhitelist({
idNo: this.saleInsuredPersonInfo.idNo,
name: this.saleInsuredPersonInfo.name,
whiteType: 'sale_face_show'
})
console.log('白名单查询结果: ', res)
if (res.result === '0') {
// 用户在白名单内
if (res.content && res.content.length) {
this.insuredUrl()
return
}
} else {
this.$toast(res.resultMessage)
}
// 人脸识别
if (this.faceAuthCount.insured < this.smsAuthNum) {
// 调原生人脸识别
const authRes = await EWebBridge.webCallAppInJs('face_auth', {
businessSource: '1', //业务来源:1-电投2-入司3-理赔4-保全
number: that.saleInsuredPersonInfo.idNo, //身份证号码
name: that.saleInsuredPersonInfo.name //姓名
}).then((data) => {
if (JSON.parse(data).state == '1') {
that.saveCustomerRidInfo('insured_rid', 'B')
that.insuredUrl()
} else {
that.faceAuthCount.insured++
if (this.faceAuthCount.insured >= this.smsAuthNum) {
this.operaFlag = 'insured'
this.realPeopelCheck()
}
}
})
} else {
this.operaFlag = 'insured'
this.realPeopelCheck()
}
}
}
}
},
goUrl() {
let that = this
let path = ''
if (this.isInsuYearFlag && !that.changeCard) {
this.$toast.loading({
// 持续展示 toast
duration: 0,
// 禁用背景点击s
forbidClick: true,
loadingType: 'spinner',
message: '获取信息中……'
})
getAgentInfo({}).then((res) => {
console.log(res)
if ((res.branchType == 'N1' || res.branchType == '1') && !this.isVideo) {
this.$jump({
flag: 'navigation',
extra: {
title: '防范销售误导',
hiddenRight: '1'
}
})
this.videoShow = true
this.isVideo = true
this.isVideoUrl = 'goUrl'
// this.$nextTick(() => {
// this.$dialog
// .alert({
// className: 'dialog-alert',
// title: '提示',
// message: '为维护您的合法权益,请您务必认真观看防范销售误导视频。',
// confirmButtonColor: '#ee0a24',
// confirmButtonText: '确认'
// })
// .then(() => {})
// })
} else {
console.log('that.appntSign 1 ==', that.appntSign)
if (that.changeCard) {
path = 'insuranceInformation'
} else {
console.log('that.appntSign.length ==', that.appntSign.length, typeof that.appntSign.length)
for (let i = 0; i < that.appntSign.length; i++) {
if ((that.appntSign[i].documentCode == '1' || that.appntSign[i].documentCode == '3' || that.appntSign[i].documentCode == '8' || that.appntSign[i].documentCode == '9' || that.appntSign[i].documentCode == '12' || that.appntSign[i].documentCode == '13'|| that.appntSign[i].documentCode == '14') && that.appntSign[i].documentStatus == 0) {
//1投保须知 未读
path = that.appntSign[i].routePath
break
} else {
if (that.appntSign[i].documentStatus == 2) {
path = that.appntSign[i].routePath
break
}
}
}
/* if (localStorage.productCode == 'GFRS_M0003' || localStorage.productCode == 'GFRS_M0015' || this.productCode == 'GFRS_M0017') {
if (that.appntSign[0].documentStatus == 0) {
path = 'insuranceInformation'
} else if (that.appntSign[1].documentStatus == 2) {
path = 'productTip'
} else if (that.appntSign[2].documentStatus == 2) {
path = 'InsuranceTip'
} else if (that.appntSign[3].documentStatus == 2) {
path = 'SignatureOfElectronic'
}
} else {
if (that.appntSign[0].documentStatus == 0) {
path = 'insuranceInformation'
} else if (that.appntSign[1].documentStatus == 2) {
path = 'InsuranceTip'
} else if (that.appntSign[2].documentStatus == 2) {
path = 'SignatureOfElectronic'
}
}*/
}
console.log('跳转页面path', path)
if (path)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/' + path + '?orderNo=' + this.$route.query.orderNo
},
routerInfo: {
path: '/sale/' + path + '?orderNo=' + this.$route.query.orderNo
}
})
}
})
} else {
console.log('that.appntSign 1 ==', that.appntSign)
if (that.changeCard) {
path = 'insuranceInformation'
} else {
console.log('that.appntSign.length ==', that.appntSign.length, typeof that.appntSign.length)
for (let i = 0; i < that.appntSign.length; i++) {
if ((that.appntSign[i].documentCode == '1' || that.appntSign[i].documentCode == '3' || that.appntSign[i].documentCode == '8' || that.appntSign[i].documentCode == '9' || that.appntSign[i].documentCode == '12'|| that.appntSign[i].documentCode == '13'|| that.appntSign[i].documentCode == '14') && that.appntSign[i].documentStatus == 0) {
//1投保须知 未读
path = that.appntSign[i].routePath
break
} else {
if (that.appntSign[i].documentStatus == 2) {
path = that.appntSign[i].routePath
break
}
}
}
/* if (localStorage.productCode == 'GFRS_M0003' || localStorage.productCode == 'GFRS_M0015' || this.productCode == 'GFRS_M0017') {
if (that.appntSign[0].documentStatus == 0) {
path = 'insuranceInformation'
} else if (that.appntSign[1].documentStatus == 2) {
path = 'productTip'
} else if (that.appntSign[2].documentStatus == 2) {
path = 'InsuranceTip'
} else if (that.appntSign[3].documentStatus == 2) {
path = 'SignatureOfElectronic'
}
} else {
if (that.appntSign[0].documentStatus == 0) {
path = 'insuranceInformation'
} else if (that.appntSign[1].documentStatus == 2) {
path = 'InsuranceTip'
} else if (that.appntSign[2].documentStatus == 2) {
path = 'SignatureOfElectronic'
}
}*/
}
console.log('跳转页面path', path)
if (path)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/' + path + '?orderNo=' + this.$route.query.orderNo
},
routerInfo: {
path: '/sale/' + path + '?orderNo=' + this.$route.query.orderNo
}
})
}
},
insuredUrl() {
let that = this
let path = ''
// if (that.insuredSign[0].documentStatus == 0) {
// path = 'insuranceInformation'
// } else {
// path = 'SignatureOfElectronic'
// }
console.log(that.insuredSign,'that.insuredSign')
// if (that.insuredSign[0].documentStatus == 0) {
// path = 'insuranceInformation'
// } else if (that.insuredSign[1].documentStatus == 2) {
// path = 'SignatureOfElectronic'
// } else if (that.insuredSign.length == 3 && that.insuredSign[2].documentStatus == 0) {
// path = 'PersonalInformation'
// }
for (let i = 0; i < that.insuredSign.length; i++) {
// if ((that.insuredSign[i].documentCode == '1' || that.insuredSign[i].documentCode == '8' || that.insuredSign[i].documentCode == '9' || that.insuredSign[i].documentCode == '12' || that.insuredSign[i].documentCode == '13') && that.insuredSign[i].documentStatus == 0) {
// //1投保须知 未读
// path = that.insuredSign[i].routePath
// break
// } else {
// if (that.insuredSign[i].documentStatus == 2) {
// path = that.insuredSign[i].routePath
// break
// }
// }
// documentStatus: 文档状态 0 未读 1 已读 2 未签名 3 已签名
if (that.insuredSign[i].documentStatus == 0 || that.insuredSign[i].documentStatus == 2 ) {
path = that.insuredSign[i].routePath
break
}
}
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/' + path + '?orderNo=' + this.$route.query.orderNo
},
routerInfo: {
path: '/sale/' + path + '?orderNo=' + this.$route.query.orderNo
}
})
// if (this.isInsuYearFlag) {
// this.$toast.loading({
// // 持续展示 toast
// duration: 0,
// // 禁用背景点击s
// forbidClick: true,
// loadingType: 'spinner',
// message: '获取信息中……'
// })
// getAgentInfo({}).then((res) => {
// console.log('是否进入下一页')
// console.log(res)
// console.log(this.isVideo)
// if ((res.branchType == 'N1' || res.branchType == '1') && !this.isVideo) {
// this.$jump({
// flag: 'navigation',
// extra: {
// title: '防范销售误导',
// hiddenRight: '1'
// }
// })
// this.videoShow = true
// this.isVideo = true
// this.isVideoUrl = 'insuredUrl'
// // this.$nextTick(() => {
// // this.$dialog
// // .alert({
// // className: 'dialog-alert',
// // title: '提示',
// // message: '为维护您的合法权益,请您务必认真观看防范销售误导视频。',
// // confirmButtonColor: '#ee0a24',
// // confirmButtonText: '确认'
// // })
// // .then(() => {})
// // })
// } else {
// if (that.insuredSign[0].documentStatus == 0) {
// path = 'insuranceInformation'
// } else {
// path = 'SignatureOfElectronic'
// }
// that.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + '/#/sale/' + path
// },
// routerInfo: {
// path: '/sale/' + path
// }
// })
// }
// })
// } else {
// if (that.insuredSign[0].documentStatus == 0) {
// path = 'insuranceInformation'
// } else {
// path = 'SignatureOfElectronic'
// }
// that.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + '/#/sale/' + path
// },
// routerInfo: {
// path: '/sale/' + path
// }
// })
// }
},
toTest() {},
// 微信分享
share(code) {
let shareName = ''
if (code == '1') {
shareName = '被保险人'
} else if(code == '3'){
shareName = '代理人'
}
else {
shareName = '投保人'
}
console.log('`````````````测试安卓url`````````````````')
console.log(
location.origin +
'/#/sale/signatureConfirmation?orderNo=' +
this.$route.query.orderNo +
'&token=' +
localStorage.token +
'&saleInsuredInfo=' +
this.$CacheUtils.getLocItem('saleInsuredInfo') +
'&saleInsuredPersonInfo=' +
this.$CacheUtils.getLocItem('saleInsuredPersonInfo') +
'&relationToAppnt=' +
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt +
'&shareCode=' +
code +
'&signInvalid=' +
this.signInvalid +
'&productCode=' +
localStorage.productCode
)
if (this.changeCard) {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
title: '国富人寿修改银行卡号确认',
content: '签字进行',
url:
location.origin +
'/#/sale/signatureConfirmation?orderNo=' +
this.$route.query.orderNo +
'&token=' +
localStorage.token +
'&relationToAppnt=' +
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt +
'&shareCode=' +
code +
'&signInvalid=' +
this.signInvalid +
'&productCode=' +
localStorage.productCode +
'&changeCard=0',
img: this.$assetsUrl + 'images/logo.png'
}
})
} else {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
title: `国富人寿电子投保单(${shareName})签字`,
content: '签字进行',
url:
location.origin +
'/#/sale/signatureConfirmation?orderNo=' +
this.$route.query.orderNo +
'&token=' +
localStorage.token +
'&relationToAppnt=' +
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt +
'&shareCode=' +
code +
'&signInvalid=' +
this.signInvalid +
'&productCode=' +
localStorage.productCode,
img: this.$assetsUrl + 'images/logo.png'
}
})
}
},
// 提交
next() {
//需要全部提交
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {
platform: 'app',
type: '1',
orderDTO: {
orderInfoDTO: {
orderNo: this.$route.query.orderNo
}
}
}
// /insure/selfToHuman
underWrite(data).then((res) => {
this.$toast.clear()
let that = this
if (res.result == '0') {
window.localStorage.setItem('underWriteData', JSON.stringify(res))
if (res.uwResult == '02') {
// 去支付
// window.localStorage.setItem('uwResult', res.uwResult)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/payMent?orderNo=' + this.$route.query.orderNo
},
routerInfo: {
path: '/sale/payMent?orderNo=' + this.$route.query.orderNo
}
})
} else if (res.uwResult == '07') {
// 核保失败
window.localStorage.setItem('uwResult', res.uwResult)
window.localStorage.setItem('resultMessage', res.message)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/result?orderNo=' + this.$route.query.orderNo,
backToFirst: '1'
},
routerInfo: {
path: '/sale/result?orderNo=' + this.$route.query.orderNo
}
})
} else if (res.uwResult == '46') {
// 转人核
window.localStorage.setItem('uwResult', res.uwResult)
window.localStorage.setItem('resultMessage', res.message)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/result?orderNo=' + this.$route.query.orderNo,
backToFirst: '1'
},
routerInfo: {
path: '/sale/result?orderNo=' + this.$route.query.orderNo
}
})
} else if (res.uwResult == '47') {
// 核心系统繁忙,请稍后重试
window.localStorage.setItem('uwResult', res.uwResult)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/result?orderNo=' + this.$route.query.orderNo,
backToFirst: '1'
},
routerInfo: {
path: '/sale/result?orderNo=' + this.$route.query.orderNo
}
})
} else {
//其他-系统繁忙,请稍后重试
window.localStorage.setItem('uwResult', res.uwResult)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/result?orderNo=' + this.$route.query.orderNo,
backToFirst: '1'
},
routerInfo: {
path: '/sale/result?orderNo=' + this.$route.query.orderNo
}
})
}
} else {
this.$toast(res.resultMessage)
}
})
},
// 重新支付
rePayMent() {
// 再次支付 salelist为 0
localStorage.salelist = '0'
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/payMent?orderNo=' + this.$route.query.orderNo
},
routerInfo: {
path: '/sale/payMent?orderNo=' + this.$route.query.orderNo
}
})
},
// 获取消息和阅读状态
getOrderDetail() {
let that = this
this.$toast.loading({
// 持续展示 toast
duration: 0,
// 禁用背景点击s
forbidClick: true,
loadingType: 'spinner',
message: '加载中……'
})
let data = {
orderNo: this.$route.query.orderNo,
getOtherType: 'RID'
}
localStorage.setItem('riskName', '')
return new Promise((resolve) => {
getOrderDetail(data).then((res) => {
if (res.result == '0') {
if (res.orderDTO && res.orderDTO.prtType) {
localStorage.setItem('readingProtocolType', res.orderDTO.prtType)
}
let documentCodeType = res.orderDTO.ebizSignDTOS.filter(item=>item.documentCode == '14').length>0
localStorage.setItem('documentCodeType', documentCodeType)
let riskDTOLst = res.orderDTO.insuredDTOs[0].riskDTOLst[0]
// 判断是否为长期险
if ((riskDTOLst.insuYearFlag == 'Y' && riskDTOLst.insuYear > 1) || riskDTOLst.insuYearFlag == 'A') {
this.$CacheUtils.setLocItem('isLongInsuranceFlag', "Y");
this.isInsuYearFlag = true
}else{
this.$CacheUtils.setLocItem('isLongInsuranceFlag', "N");
}
//弹框展示是否有社保、赔付比例和免赔额信息
const isMedical = res.orderDTO.insuredDTOs[0].medical === '0'
const mainRiskCode = res.orderDTO.insuredDTOs[0].riskDTOLst[0].mainRiskCode
// const isShowDialog = mainRiskCode === 'GFRS_M0005' || mainRiskCode === 'GFRS_M0016'
const isShowDialog = mainRiskCode === 'GFRS_M0016'
if (
!!res.orderDTO.productDTO &&
!!res.orderDTO.productDTO.special &&
!!res.orderDTO.productDTO.special.content &&
res.orderDTO.productDTO.special.content !== ''
) {
// const message = res.orderDTO.productDTO.special.content
// Dialog({ message })
let content = res.orderDTO.productDTO.special.content
// {
// title: '标题',
// message: '内容',
// confirmButtonText: '确认',
// messageAlign: 'left'
// }
// title 需要标题则配置,不需要则不要配置
// message 内容,\n换行
// confirmButtonText确认按钮的文字
// messageAlign 对齐方式,固定左对齐,为'left'
try {
const config = JSON.parse(content)
config.message = '&emsp;&emsp;' + config.message
config.message = config.message.split('\\n').join('\n&emsp;&emsp;')
// {
// title: '', //需要标题则配置,不需要则不要配置
// message: '提示的主体文本',
// confirmButtonText: '确认按钮的问题',
// messageAlign: 'left' //对齐方式,左对齐
// }
Dialog(config)
} catch (error) {
const message = '&emsp;&emsp;' + content
Dialog({
message: message.split('\\n').join('\n&emsp;&emsp;'),
confirmButtonText: '本人已阅读并同意上述特别约定内容',
messageAlign: 'left'
})
}
// const message = '&emsp;&emsp;' + res.orderDTO.productDTO.special.content
// Dialog({
// message: message.split('\\n').join('\n&emsp;&emsp;'),
// confirmButtonText: '本人已阅读并同意上述特别约定内容',
// messageAlign: 'left'
// })
}
/* if (isShowDialog) {
//记录每次弹框的订单号。再次进入页面,订单号改变才会弹窗。
let lastOrderNo = localStorage.lastOrderNo
if (lastOrderNo !== data.orderNo) {
const message = isMedical
? '您以社保身份投保理赔时通过社会基本医疗保险或者公费医疗就诊并结算意外伤害医疗保险金赔付比例80%免赔额0元未通过社会基本医疗保险或者公费医疗就诊并结算的意外伤害医疗保险金的赔付比例为60%免赔额为100元。'
: '您以无社保身份投保理赔时若未通过社会基本医疗保险或者公费医疗就诊并结算的意外伤害医疗保险金的赔付比例和免赔额分别70%100元理赔时若通过社会基本医疗保险或者公费医疗就诊并结算的意外伤害医疗保险金的赔付比例为90%免赔额为0元。'
Dialog({ message })
}
} else {
// 附加住院医疗险 GFRS_A0004
if (
!!res.orderDTO.productDTO &&
!!res.orderDTO.productDTO.special &&
!!res.orderDTO.productDTO.special.content &&
res.orderDTO.productDTO.special.content !== ''
) {
const message = res.orderDTO.productDTO.special.content
Dialog({ message })
}
}*/
localStorage.setItem('lastOrderNo', data.orderNo)
localStorage.setItem('AppntidType', res.orderDTO.appntDTO.idType)
this.$toast.clear()
this.$utils.intLocalStorage(res)
// 获取被保险人信息recmd
this.saleInsuredPersonInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo'))
let thismyage = ''
if(this.saleInsuredPersonInfo.age === 0 || this.saleInsuredPersonInfo.age === '0' || this.saleInsuredPersonInfo.age){
thismyage = this.saleInsuredPersonInfo.age
} else {
thismyage = this.saleInsuredPersonInfo.insuredAge
}
this.saleInsuredPersonInfo.age = thismyage
// 获取投保人信息
this.saleInsuredInfo = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo'))
this.relationToAppnt = this.saleInsuredPersonInfo.relationToAppnt //将缓存中的与被保险人关系赋值给页面
that.recmd = res.orderDTO.recmdDTO
that.orderInfo = res.orderDTO.orderInfoDTO
that.insured = res.orderDTO.insuredDTOs
// 初始化RID状态
this.realPeopleRidInfo.appntRidFlag = res.orderDTO.appntDTO.ridStatus
this.realPeopleRidInfo.insureRidFlag = res.orderDTO.insuredDTOs[0].ridStatus
//存code区分万能型产品
let productCode, riskName
let isDoubleMailRisk = that.orderInfo.isDoubleMailRisk
if (isDoubleMailRisk == '1') {
productCode = 'GFRS_M0017'
riskName = res.orderDTO.insuredDTOs[0].riskDTOLst[1].riskName
} else {
productCode = that.insured[0].riskDTOLst[0].mainRiskCode
riskName = res.orderDTO.insuredDTOs[0].riskDTOLst[0].riskName
}
if (that.orderInfo && that.orderInfo.activeType) {
that.$CacheUtils.setLocItem('activeType',that.orderInfo.activeType)
}
localStorage.setItem('productCode', productCode)
this.riskName = riskName
localStorage.setItem('riskName', riskName)
if (this.relationToAppnt != '1') {
this.activeNames.push(res.orderDTO.insuredDTOs.length + 1)
} else {
this.activeNames.push('1')
}
that.appnt = res.orderDTO.appntDTO
that.date = res.orderDTO.orderInfoDTO.appntDateLabel
res.orderDTO.ebizSignDTOS.map((item) => {
if (item.signType == '0' || item.signType == '2') {
if (!localStorage.changeCard) {
if (item.documentCode != '5') {
that.appntSign.push(item) //投保
that.addKey(item)
}
} else {
//阅读授权书
if (item.documentCode == '5') {
that.appntSign = item //投保
}
}
} else if(item.signType == '3'){
that.showAgentView = !localStorage.changeCard?1:0
that.agentSign.push(item)//代理人
that.addKey(item)
}else {
that.insuredSign.push(item) //被保
that.addKey(item)
}
})
if (!that.changeCard) {
//将投保人文件数组排序
that.appntSign.sort(function (a, b) {
return a.key - b.key
})
//将被保人文件数组排序
that.insuredSign.sort(function (a, b) {
return a.key - b.key
})
//获取投保和被保险人电子投保单签字状态
console.log(that.appntSign,'that.appntSign')
that.appntSign.map((item,index) => {
// console.log(that.appntSign,'that.appntSign')
// console.log(index,'index')
// 判断是否双录
if (item.documentCode == '7') {
localStorage.doubleRecordFlag = '1'
}
// if (item.documentCode == '2') {
// that.appntSignStatus = item.documentStatus
// }
// if (item.documentCode == '11') {
// that.appntSignStatus = item.documentStatus
// }
if (index == that.appntSign.length - 1) {
//初始化时最后一个文档documentStatus文档状态 1 已读 转化为 3 已签名
that.appntSignStatus = item.documentStatus == 1 ? 3:item.documentStatus
}
})
that.insuredSign.map((item,index) => {
// if (item.documentCode == '2') {
// that.insuredSignStatus = item.documentStatus
// }
//初始化时最后一个文档documentStatus文档状态 1 已读 转化为 3 已签名
if (index == that.insuredSign.length - 1) {
that.insuredSignStatus = item.documentStatus == 1 ? 3:item.documentStatus
}
})
that.agentSign.map((item) => {
if (item.documentCode == '10') {
that.agentSignStatus = item.documentStatus
}
})
}
resolve('success')
}
})
})
},
//自定义key值排序用
addKey(item) {
//ducumentCode 1投保须知 2投保单 3产品说明书 4提示书 6免除保险人责任条款说明书 7保险销售行为双录说明
// 8指定保单生效日 9短期险投保须知 10国富人寿自保件承诺书 11柳州保险行业寿险投保风险提示书 12个人信息使用授权
// documentStatus: 文档状态 0 未读 1 已读 2 未签名 3 已签名
// documentType: 文档类型 0 阅读文档 1 签名文档
// signType: 签名类型 0 投保人 1 被保人 2 本人
if (item.documentCode == '1') {
item.key = 2
// item.key = 4
if(JSON.parse(window.localStorage.getItem('mainRiskCodes'))[0] == 'GFRS_M0081'){
item.routePath = 'insuranceInformation_0081'
} else {
item.routePath = 'insuranceInformation'
}
} else if (item.documentCode == '2') {
// item.key = 9
item.key = 11
item.routePath = 'SignatureOfElectronic'
} else if (item.documentCode == '3') {
// item.key = 4
item.key = 6
item.routePath = 'productTip'
} else if (item.documentCode == '4') {
// item.key = 5
item.key = 7
item.routePath = 'InsuranceTip'
} else if (item.documentCode == '6') {
// item.key = 7
item.key = 9
item.routePath = 'avoidDutyTip'
} else if (item.documentCode == '7') {
// item.key = 8
item.key = 10
item.routePath = 'doubleRecordTip'
} else if (item.documentCode == '8') {
item.key = 1
item.routePath = 'apointValidDoc'
} else if (item.documentCode == '9') {
// item.key = 3
item.key = 5
item.routePath = 'shortPeriodProduct'
}else if (item.documentCode == '10') {
item.key = 1
item.routePath = 'commitmentSelfProtect'
} else if (item.documentCode == '11') {
// item.key = 6
item.key = 8
item.routePath = 'InsuranceRiskReminder'
} else if (item.documentCode == '12') {
// item.key = 10
item.key = 12
item.routePath = 'PersonalInformation'
} else if (item.documentCode == '13') {
// item.key = 2
item.key = 4
item.routePath = 'insuranceClauses'
}else if (item.documentCode == '14') {//风险评估pdf
item.key = 3
item.routePath = 'AnswerTip'
} else if (item.documentCode == '15') {
item.key = 7.1
item.routePath = 'universalRiskNotifyingMessageTip'
}
},
getSignInvalid() {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {}
getSignInvalid(data).then((res) => {
if (res.result == '0') {
this.$toast.clear()
this.signInvalid = res.content.sign
}
})
},
async checkSignInvalid(signInvalid) {
let that = this
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {
sign: signInvalid
}
return new Promise((resolve) => {
checkSignInvalid(data).then((res) => {
if (res.result == '0') {
that.$toast.clear()
let status = res.content.status
resolve(status)
}
})
})
},
// 微信人脸验证后 返回值 操作
sendimage(e) {
if (e == '0') {
// 1 为被保险人
if (window.sessionStorage.shareCode == '1') {
// 被保人微信端人脸识别成功
this.saveCustomerRidInfo('insured_rid', 'B')
this.insuredUrl()
} else {
// 投保人微信端人脸识别成功
this.saveCustomerRidInfo('appnt_rid', 'B')
this.goUrl()
}
} else {
this.faceAuthCount.weixin++
console.log('腾讯人脸识别失败', this.faceAuthCount.weixin, typeof this.faceAuthCount.weixin)
if (this.faceAuthCount.weixin >= this.smsAuthNum) {
if (window.sessionStorage.shareCode == '1') {
this.operaFlag = 'insured'
} else {
this.operaFlag = 'appnt'
}
this.realPeopelCheck()
}
}
},
async recognition() {
localStorage.setItem('faceAuthWeXin-requestId', '')
localStorage.setItem('faceAuthWeXin-bizToken', '')
await this.getRecognitionUrl()
},
//替换redirectUrl
replaceSearch() {
let obj = this.$route.query,
str = '/#/sale/signatureConfirmation?'
obj.faceAuthCountAppnt = this.faceAuthCount.appnt
obj.faceAuthCountInsured = this.faceAuthCount.insured
obj.faceAuthCountWeixin = this.faceAuthCount.weixin
for (let key in obj) {
str += `&${key}=${obj[key]}`
}
return str
},
getRecognitionUrl() {
return new Promise(() => {
this.idcardData.redirectUrl = location.origin + this.replaceSearch()
let data = {
realName: this.idcardData.realName,
idno: this.idcardData.idno,
redirectUrl: this.idcardData.redirectUrl,
businessSource: this.idcardData.businessSource
}
getRecognitionUrl(data).then(
(res) => {
if (res.result == '0') {
localStorage.setItem('faceAuthWeXin-requestId', JSON.stringify(res.content.requestId))
localStorage.setItem('faceAuthWeXin-bizToken', JSON.stringify(res.content.bizToken))
window.location.href = res.content.url
} else {
this.$toast(res.resultMessage)
}
},
(error) => {
console.log(error)
}
)
})
},
getRecognitionResult(requestId, bizToken) {
return new Promise(() => {
getRecognitionResult({ requestId, bizToken }).then(
(res) => {
if (res.result == '0') {
this.recognizeResult = res.result
} else {
this.$toast(res.resultMessage || '人脸识别认证失败')
}
this.sendimage(this.recognizeResult)
},
(error) => {
console.log(error)
}
)
localStorage.setItem('faceAuthWeXin-requestId', '')
localStorage.setItem('faceAuthWeXin-bizToken', '')
})
},
// 保存客户rid 认证结果
saveCustomerRidInfo(type, ridType) {
// 判断类型初始化入参
// eslint-disable-next-line no-unused-vars
let param = {}
if (type == 'appnt_rid') {
param = {
name: this.appnt.name,
sex: this.appnt.sex,
idType: this.appnt.idType,
idNo: this.appnt.idNo,
certificateValidate: this.appnt.effectiveDateType == true ? '9999-12-31' : this.appnt.certiexpiredate,
ridType: ridType,
ridDate: Formatter.formatDate(new Date(), 'yyyy-MM-dd'),
ridPhone: this.appnt.mobile,
orderNo: this.orderInfo.orderNo
}
} else if (type == 'insured_rid') {
param = {
name: this.insured[0].name,
sex: this.insured[0].sex,
idType: this.insured[0].idType,
idNo: this.insured[0].idNo,
certificateValidate: this.insured[0].effectiveDateType == true ? '9999-12-31' : this.insured[0].certiexpiredate,
ridType: ridType,
ridDate: Formatter.formatDate(new Date(), 'yyyy-MM-dd'),
ridPhone: this.insured[0].mobile,
orderNo: this.orderInfo.orderNo
}
}
// 保存rid 认证结果 不阻断流程
saveCustomerRid(param).then((res) => {
console.log('saveCustomerRid', res)
})
},
//代理人签署 跳过人脸识别
async start_agent(val) {
// val 0投保人 1被保险人 2本人 3代理人
console.log(val)
let that = this
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-agent', JSON.stringify(that.agentSign))
that.agentUrl()
},
agentUrl() {
let that = this
let path = ''
console.log('that.agentSign 1 ==', that.agentSign)
if (that.changeCard) {
path = 'insuranceInformation'
} else {
console.log('that.agentSign.length ==', that.agentSign.length, typeof that.agentSign.length)
for (let i = 0; i < that.agentSign.length; i++) {
if ((that.agentSign[i].documentCode == '1' || that.agentSign[i].documentCode == '3' || that.agentSign[i].documentCode == '8' || that.agentSign[i].documentCode == '9' || that.agentSign[i].documentCode == '12') && that.agentSign[i].documentStatus == 0) {
//1投保须知 未读
path = that.agentSign[i].routePath
break
} else {
if (that.agentSign[i].documentStatus == 2) {
path = that.agentSign[i].routePath
break
}
}
}
}
console.log('跳转页面path', path)
if (path)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/' + path + '?orderNo=' + this.$route.query.orderNo
},
routerInfo: {
path: '/sale/' + path + '?orderNo=' + this.$route.query.orderNo
}
})
},
},
async created() {
this.renovate = new Date().getTime()
setTimeout(() => {
// eslint-disable-next-line no-undef
EWebBridge.webCallAppInJs('webview_left_button', {
img: this.$assetsUrl + 'images/del-close-btn@3x.png',
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
window.appCallBack = this.appCallBack
},
mounted() {
//若进入签名页,则不允许回到签名页前面的页面
localStorage.setItem('salePageFlag', this.salePageFlag)
let that = this
document.title = this.changeCard ? '修改银行卡号确认' : '签名确认'
// 初始化
that.init()
// localStorage.orderNo = '19090510425500178912'
if (window.localStorage.getItem('jumpFromSign') != '1' && window.localStorage.getItem('attachmentShow') == '0') {
Dialog.confirm({
title: '提示',
message: '当前投保单件需进行双录,请手动切换至双录系统,进行双录操作,完成后进行后续操作',
showCancelButton: false
}).then(() => {
// 获取投被保险人是否同一个人
that.relationToAppnt = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt
})
} else if (window.localStorage.getItem('jumpFromSign') == '1' || window.localStorage.getItem('attachmentShow') == '1') {
// 获取投被保险人是否同一个人
that.relationToAppnt = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt
}
},
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[Collapse.name]: Collapse,
[CollapseItem.name]: CollapseItem,
[NoticeBar.name]: NoticeBar,
[Dialog.name]: Dialog,
[Field.name]: Field,
[IndexBar.name]: IndexBar
},
beforeRouteLeave(to, from, next) {
document.body.style.backgroundColor = ''
next()
}
}
</script>
<style lang="scss" scoped>
@import '@/assets/sass/variables.scss';
.text {
color: #4a90e2;
}
.start {
color: #4fc6b3;
}
.tips {
line-height: 30px;
}
.tips {
line-height: 30px;
}
</style>