产品说明书

This commit is contained in:
zhouna
2019-11-02 13:54:48 +08:00
parent 4b2c06aa1e
commit 921c47e65b
3 changed files with 987 additions and 200 deletions

View File

@@ -624,12 +624,11 @@ export default {
res.orderDTO.ebizSignDTOS.map(item => {
if (item.signType == '0') {
that.appntSign.push(item) //投保
//ducumentCode 1投保须知 2投保单 3产品说明书 4提示书
that.addKey(item)
} else if (item.signType == '1') {
that.insuredSign.push(item) //被保
} else {
that.appntSign.push(item)
that.appntSign.push(item) //本人
that.addKey(item)
}
})
@@ -637,7 +636,6 @@ export default {
that.appntSign.sort(function(a, b) {
return a.key - b.key
})
console.log('哈哈哈哈', that.appntSign)
//获取投保和被保人电子投保单签字状态
that.appntSign.map(item => {
if (item.documentCode == '2') {
@@ -652,7 +650,9 @@ export default {
}
})
},
//自定义key值排序用
addKey(item) {
//ducumentCode 1投保须知 2投保单 3产品说明书 4提示书
if (item.documentCode == '1') {
item.key = 1
} else if (item.documentCode == '2') {

View File

@@ -0,0 +1,915 @@
<template>
<div class="signature-container">
<div class="signature-content pb40">
<div v-if="isWeixin" class="bg-white mt10 p20 fs14 tips">
<p>
尊敬的
<span class="red">{{ 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="1">
<div slot="title">
投保人
<span class="ml20">{{ appnt.name }}</span>
</div>
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ appntSign.readDocumentName }}</span>
<img :src="src" v-if="appntSign.readStatus == '1'" />
</p>
<p>需签署</p>
<p class="mb20">
<span class="text">{{ appntSign.tipsSignDocumentName }}</span>
<img :src="src" v-if="appntSign.tipsSignStatus == '1'" />
</p>
<p>需签署</p>
<p class="mb20">
<span class="text">{{ appntSign.signDocumentName }}</span>
<img :src="src" v-if="appntSign.signStatus == '1'" />
</p>
<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="appntSign.signStatus == '1'"
@click="share(insured.length == '0' ? '2' : '0')"
>分享</van-button>
<van-button
type="danger"
size="normal"
class="w150"
plain
:disabled="appntSign.signStatus == '1'"
v-no-more-click="1000"
@click="start_ocr(insured.length == '0' ? '2' : '0')"
>开始</van-button
>
</div>
<div class="text" v-else>操作时间已失效请联系销售人员</div>
</van-collapse-item>
</van-collapse>
<div v-if="relationToAppnt != '1'" 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>
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ insuredSign.readDocumentName }}</span>
<img :src="src" v-if="insuredSign.readStatus == '1'" />
</p>
<!-- <p>需签署</p>
<p class="mb20">
<span class="text">{{ insuredSign.tipsSignDocumentName }}</span>
<img :src="src" v-if="insuredSign.tipsSignStatus == '1'" />
</p> -->
<p>需签署</p>
<p class="mb20">
<span class="text">{{ insuredSign.signDocumentName }}</span>
<img :src="src" v-if="insuredSign.signStatus == '1'" />
</p>
<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="insuredSign.signStatus == '1'"
@click="share('1')"
plain
v-no-more-click="1000"
>分享</van-button>
<van-button
type="danger"
size="normal"
plain
class="w150"
:disabled="insuredSign.signStatus == '1'"
@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>
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ appntSign.readDocumentName }}</span>
<img :src="src" v-if="appntSign.readStatus == '1'" />
</p>
<p>需签署</p>
<p class="mb20">
<span class="text">{{ appntSign.tipsSignDocumentName }}</span>
<img :src="src" v-if="appntSign.tipsSignStatus == '1'" />
</p>
<p>需签署</p>
<p class="mb20">
<span class="text">{{ appntSign.signDocumentName }}</span>
<img :src="src" v-if="appntSign.signStatus == '1'" />
</p>
<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"
style="width: 157px;"
plain
v-no-more-click="1000"
:disabled="appntSign.signStatus == '1'"
@click="share(insured.length == '0' ? '2' : '0')"
>分享</van-button> -->
<van-button
type="danger"
size="normal"
style="width: 157px;"
plain
:disabled="appntSign.signStatus == '1'"
v-no-more-click="1000"
@click="start_ocr(insured.length == '0' ? '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>
<p>需阅读</p>
<p class="mb20">
<span class="text">{{ insuredSign.readDocumentName }}</span>
<img :src="src" v-if="insuredSign.readStatus == '1'" />
</p>
<!-- <p>需签署</p>
<p class="mb20">
<span class="text">{{ insuredSign.tipsSignDocumentName }}</span>
<img :src="src" v-if="insuredSign.tipsSignStatus == '1'" />
</p> -->
<!-- 新加的 需要改++++++++++++++++++++++++= -->
<p>需签署</p>
<p class="mb20">
<span class="text">{{ insuredSign.signDocumentName }}</span>
<img :src="src" v-if="insuredSign.signStatus == '1'" />
</p>
<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"
style="width: 157px;"
:disabled="insuredSign.signStatus == '1'"
@click="share('1')"
plain
v-no-more-click="1000"
>分享</van-button> -->
<van-button
type="danger"
size="normal"
plain
style="width: 157px;"
:disabled="insuredSign.signStatus == '1'"
@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>
<!-- <p class="mb20">尊敬的<span class="text">陈伟</span>先生/女士您好</p>
<p class="mb20">
感谢您于<span class="text">2019-08-03</span>在鼎诚人寿保险有限责任公司为陈伟投保保费合计<span class="text">7128</span>销售人员为1009368孙岚
</p>-->
</div>
<div v-if="!isWeixin">
<div class="bottom-btn bg-white" v-if="appntSign.signStatus == '1'">
<van-button
type="danger"
v-if="relationToAppnt == '1' ? true : insuredSign.signStatus == '1' ? true : false"
size="large"
@click="next"
v-no-more-click="1000"
>提交</van-button
>
</div>
</div>
<UploadImageFile :typeface="idcardData.typeface" :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, getToken, getSignInvalid, checkSignInvalid } from '@/api/ebiz/sale/sale'
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 {
// 员工信息
recmd: {},
// 投保时间
date: '',
// 订单信息
orderInfo: {},
// 投保人信息
appnt: {},
// 被保人信息
insured: [],
// 投保人签名阅读信息
appntSign: {},
// 被保人签名阅读信息
insuredSign: {},
// 折叠面板
activeNames: ['1', '2'],
// 图片路径
src: this.$assetsUrl + 'images/u6490.png',
// 被保人信息
saleInsuredPersonInfo: {},
// 投保人信息
saleInsuredInfo: {},
// 是否在微信
isWeixin,
// 是否显示 在微信中不显示
isShow: true,
// 调微信人脸的token
tokenInweixin: '',
// 投保人被保人是否同一个人
relationToAppnt: '',
// 微信分享校验值
signInvalid: '',
// 微信分享链接是否失效 false 为未失效 true为已失效
isInvalid: false,
// 是谁分享的微信链接 1为被保人 0或2为投保人
shareCode: '',
// 是否从空签成功跳转过来 1为是 其他为不是
airSign: '',
// 空签时顶部姓名
tipsName: '',
idcardData: {
typeface: false,
idcardName: '',
idcardNumber: ''
}
}
},
methods: {
// 初始化
async init() {
if (this.isWeixin) {
if (this.$route.query.airSign) {
sessionStorage.setItem('airSign', this.$route.query.airSign)
}
window.localStorage.setItem('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)
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.relationToAppnt = this.$route.query.relationToAppnt
this.isShow = false
await this.getOrderDetail()
if (this.shareCode == '1') {
this.tipsName = this.saleInsuredPersonInfo.name
} else {
this.tipsName = this.saleInsuredInfo.name
}
weixinShare({
title: '国富人寿计划书',
imgUrl: 'http://47.96.143.111:8000/app/images/logo.png',
desc: '国富为您量身定制的保险产品,请查收'
})
let params = {
orderNo: ''
}
// params.orderNo = this.$route.query.orderNo
// // 获取详情消息
// getOrderDetail(params).then(res => {
// if (res.result == '0') {
// this.recmd = res.orderDTO.recmdDTO
// // if (res.orderDTO.orderInfoDTO.orderAmount == undefined) {
// // res.orderDTO.orderInfoDTO.orderAmount = ''
// // }
// this.orderInfo = res.orderDTO.orderInfoDTO
// this.insured = res.orderDTO.insuredDTOs
// if (this.relationToAppnt != '1') {
// this.activeNames.push(res.orderDTO.insuredDTOs.length + 1)
// } else {
// this.activeNames.push('1')
// }
// this.appnt = res.orderDTO.appntDTO
// this.date = res.orderDTO.orderInfoDTO.appntDateLabel
// // debugger
// console.log(res.orderDTO.signDTOS, 'xxxx')
// res.orderDTO.signDTOS.map(item => {
// if (item.signType == '0') {
// this.appntSign = item
// } else if (item.signType == '1') {
// this.insuredSign = item
// } else {
// this.appntSign = item
// }
// })
// } else {
// this.$toast(res.resultMessage)
// }
// })
} else {
// 获取详情消息
this.getOrderDetail()
this.getSignInvalid()
this.isShow = true
}
},
// 人脸识别
start_ocr(val) {
let that = this
// window.localStorage.setItem('sign-insured', JSON.stringify(that.insuredSign))
// console.log(window.localStorage.getItem('sign-insured'))
if (this.isWeixin) {
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-appnt', JSON.stringify(that.appntSign))
if (val == '0' || val == '2') {
if (JSON.parse(this.$route.query.saleInsuredInfo).idType != '1' || JSON.parse(this.$route.query.saleInsuredInfo).age <= '16') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} 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
// getToken(data).then(res => {
// if (res.result == '0') {
// window.location.href = `https://api.megvii.com/faceid/lite/do?token=${res.content.token}`
// } else {
// this.$toast(res.resultMessage)
// }
// })
}
} else {
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-insured', JSON.stringify(that.insuredSign))
if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1' || JSON.parse(this.$route.query.saleInsuredPersonInfo).age <= '16') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else {
// let data = {
// idcardName: JSON.parse(this.$route.query.saleInsuredPersonInfo).name,
// idcardNumber: JSON.parse(this.$route.query.saleInsuredPersonInfo).idNo
// }
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
// getToken(data).then(res => {
// if (res.result == '0') {
// window.location.href = `https://api.megvii.com/faceid/lite/do?token=${res.content.token}`
// } else {
// this.$toast(res.resultMessage)
// }
// })
}
}
} 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' || this.saleInsuredInfo.age <= '16') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else {
// 原人脸识别
EWebBridge.webCallAppInJs('face_auth', {
number: that.saleInsuredInfo.idNo, //身份证号码
name: that.saleInsuredInfo.name //姓名
// })
// 跳过人脸识别
// new Promise(resolve => {
// console.log('--跳过人脸识别--返回识别成功')
// resolve(JSON.stringify({ state: '1' }))
}).then(data => {
if (JSON.parse(data).state == '1') {
if (that.appntSign.readStatus == '0') {
console.log('--跳过人脸识别--返回识别成功zzzzzzzzzz')
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else if (that.appntSign.readStatus == '1') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else if (that.appntSign.signStatus == '0') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/signatureOfElectronic'
},
routerInfo: {
path: '/sale/signatureOfElectronic'
}
})
}
} else {
// EWebBridge.webCallAppInJs('webview_toast', '人脸检测失败')
}
})
}
} else {
window.localStorage.setItem('sign-val', val)
window.localStorage.setItem('sign-insured', JSON.stringify(that.insuredSign))
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age <= '16') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else {
// 跳过人脸识别
EWebBridge.webCallAppInJs('face_auth', {
number: that.saleInsuredInfo.idNo, //身份证号码
name: that.saleInsuredInfo.name //姓名
// })
// new Promise(resolve => {
// console.log('--跳过人脸识别--返回识别成功')
// resolve(JSON.stringify({ state: '1' }))
}).then(data => {
if (JSON.parse(data).state == '1') {
if (that.insuredSign.readStatus == '0') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else if (that.insuredSign.readStatus == '1') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else if (that.insuredSign.signStatus == '0') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
}
} else {
// this.$toast(JSON.parse(data).error)
}
})
}
}
}
},
toTest() {},
// 微信分享
share(code) {
let shareName = ''
if (code == '1') {
shareName = '被保人'
} else {
shareName = '投保人'
}
console.log('`````````````测试安卓url`````````````````')
console.log(
location.origin +
'/#/sale/signatureConfirmation?orderNo=' +
localStorage.orderNo +
'&token=' +
localStorage.token +
'&saleInsuredInfo=' +
localStorage.saleInsuredInfo +
'&saleInsuredPersonInfo=' +
localStorage.saleInsuredPersonInfo +
'&relationToAppnt=' +
JSON.parse(window.localStorage.getItem('saleInsuredPersonInfo')).relationToAppnt +
'&shareCode=' +
code +
'&signInvalid=' +
this.signInvalid
)
EWebBridge.webCallAppInJs('bridge', {
flag: 'share',
extra: {
title: `国富人寿电子投保单(${shareName})签字`,
content: '签字进行',
url:
location.origin +
'/#/sale/signatureConfirmation?orderNo=' +
localStorage.orderNo +
'&token=' +
localStorage.token +
'&saleInsuredInfo=' +
encodeURI(localStorage.saleInsuredInfo) +
'&saleInsuredPersonInfo=' +
encodeURI(localStorage.saleInsuredPersonInfo) +
'&relationToAppnt=' +
JSON.parse(window.localStorage.getItem('saleInsuredPersonInfo')).relationToAppnt +
'&shareCode=' +
code +
'&signInvalid=' +
this.signInvalid,
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: window.localStorage.getItem('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'
},
routerInfo: {
path: '/sale/payMent'
}
})
} else if (res.uwResult == '07') {
// 核保失败
window.localStorage.setItem('uwResult', res.uwResult)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/result',
backToFirst: '1'
},
routerInfo: {
path: '/sale/result'
}
})
} 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',
backToFirst: '1'
},
routerInfo: {
path: '/sale/result'
}
})
} else if (res.uwResult == '47') {
// 核心系统繁忙,请稍后重试
window.localStorage.setItem('uwResult', res.uwResult)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/result',
backToFirst: '1'
},
routerInfo: {
path: '/sale/result'
}
})
} else {
//其他-系统繁忙,请稍后重试
window.localStorage.setItem('uwResult', res.uwResult)
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/result',
backToFirst: '1'
},
routerInfo: {
path: '/sale/result'
}
})
}
} else {
this.$toast(res.resultMessage)
}
})
},
// 获取消息和阅读状态
getOrderDetail() {
let that = this
this.$toast.loading({
// 持续展示 toast
duration: 0,
// 禁用背景点击s
forbidClick: true,
loadingType: 'spinner',
message: '加载中……'
})
let data = {
orderNo: window.localStorage.getItem('orderNo')
}
getOrderDetail(data).then(res => {
if (res.result == '0') {
this.$toast.clear()
this.$utils.intLocalStorage(res)
// 获取被保人信息recmd
this.saleInsuredPersonInfo = JSON.parse(window.localStorage.getItem('saleInsuredPersonInfo'))
// 获取投保人信息
this.saleInsuredInfo = JSON.parse(window.localStorage.getItem('saleInsuredInfo'))
this.relationToAppnt = this.saleInsuredPersonInfo.relationToAppnt //将缓存中的与被保人关系赋值给页面
that.recmd = res.orderDTO.recmdDTO
that.orderInfo = res.orderDTO.orderInfoDTO
that.insured = res.orderDTO.insuredDTOs
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.signDTOS.map(item => {
if (item.signType == '0') {
that.appntSign = item
} else if (item.signType == '1') {
that.insuredSign = item
} else {
that.appntSign = item
}
})
}
})
},
getSignInvalid() {
let that = this
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, reject) => {
checkSignInvalid(data).then(res => {
if (res.result == '0') {
that.$toast.clear()
let status = res.content.status
resolve(status)
}
})
})
},
// 微信人脸验证后 返回值 操作
sendimage(e) {
let that = this
if (e.result == '0') {
if (that.appntSign.readStatus == '0') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else if (that.appntSign.readStatus == '1') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/insuranceInformation'
},
routerInfo: {
path: '/sale/insuranceInformation'
}
})
} else if (that.appntSign.signStatus == '0') {
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/signatureOfElectronic'
},
routerInfo: {
path: '/sale/signatureOfElectronic'
}
})
}
} else {
that.$toast(e.resultMessage)
// EWebBridge.webCallAppInJs('webview_toast', '人脸检测失败')
}
}
},
mounted() {
let that = this
// 初始化
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(window.localStorage.getItem('saleInsuredPersonInfo')).relationToAppnt
})
} else if (window.localStorage.getItem('jumpFromSign') == '1' || window.localStorage.getItem('attachmentShow') == '1') {
// 获取投被保人是否同一个人
that.relationToAppnt = JSON.parse(window.localStorage.getItem('saleInsuredPersonInfo')).relationToAppnt
}
},
components: {
[Cell.name]: Cell,
[CellGroup.name]: CellGroup,
[Collapse.name]: Collapse,
UploadImageFile: UploadImageFile,
[CollapseItem.name]: CollapseItem,
[Dialog.name]: Dialog
},
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>

View File

@@ -1,8 +1,7 @@
<template>
<div class="insuranceInformation-container pb50">
<van-notice-bar :scrollable="false" v-if="!Time" class="notice">{{ `提示阅读时长需在${this.Time ? this.time : this.number}秒以上` }}</van-notice-bar>
<iframe :src="src + pdfUrl" class="iframe"></iframe>
<iframe :src="src + appntSign.policyUrl" class="iframe"></iframe>
<van-radio-group v-model="radio" class="pb10 pt20 pl30 fs14">
<van-radio name="1" @click="click">
本人确认已阅读
@@ -13,13 +12,7 @@
<span class="mr10">投保人签名 :</span>
<div v-if="signVal == '0' || signVal == '2'">
<van-button type="danger" size="small" :disabled="signVal == '1' ? true : isDisable" @click="sign('0')" v-no-more-click="1000">{{
appntSign.tipsSignStatus == '0' ? '签名' : '已签名'
}}</van-button>
</div>
<div v-if="signVal == '1'">
<van-button type="danger" size="small" :disabled="signVal == '1' ? true : isDisable" @click="sign('0')">{{
appntSign.tipsSignStatus == '0' ? '未签名' : '已签名'
appntSign.documentStatus == '2' ? '签名' : '已签名'
}}</van-button>
</div>
</div>
@@ -39,8 +32,6 @@ export default {
return {
// 投保人还是被保人信息
signVal: '',
// 被保人签名信息
insuredSign: {},
// 投保人签名信息
appntSign: {},
radio: '',
@@ -70,8 +61,7 @@ export default {
// 是否从详情跳过来 如果为1 是
detailJump: '',
pdfUrl: '',
src: location.origin + '/pdfjs/web/viewer.html?file=',
tipsPolicyUrl: localStorage.getItem('tips-PolicyUrl')
src: location.origin + '/pdfjs/web/viewer.html?file='
}
},
components: {
@@ -82,16 +72,7 @@ export default {
},
mounted() {
let that = this
// {{switchFlag.Time?pageVariable.msg:pageVariable.number}}
that.timeOut()
// Notify({
// type: 'warning',
// message: `提示:阅读时长需在${this.Time ? this.time : this.number}秒以上`,
// duration: 10000,
// background: '#999999',
// className: 'notify'
// })
that.pdfUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${that.tipsPolicyUrl}`)
document.body.style.backgroundColor = '#fff'
},
async created() {
@@ -113,7 +94,16 @@ export default {
that.saleInsuredPersonInfo = JSON.parse(window.localStorage.getItem('saleInsuredPersonInfo'))
}
if (this.detailJump != '1') {
this.getOrderDetail()
that.appntSign = JSON.parse(window.localStorage.getItem('sign-appnt'))
that.appntSign.map(item => {
if (item.documentCode == '3') {
that.appntSign.signId = item.signId
that.appntSign.documentCode = item.documentCode
that.appntSign.documentType = item.documentType
that.appntSign.documentStatus = item.documentStatus
that.appntSign.policyUrl = encodeURIComponent(config.imgDomain + `/returnDirectStream?imgPath=${item.policyUrl}`)
}
})
}
if (this.isWeixin) {
let imgBase64Data = sessionStorage.getItem('imgBase64Data')
@@ -135,32 +125,20 @@ export default {
this.isDisabledComplite = false
console.log('signInfo.status:' + signInfo.status)
if (signInfo.status == '1') {
this.appntSign.tipsSignStatus = '1'
this.appntSign.documentStatus = '3'
console.log('``````````````````')
this.$set(this.appntSign, 'tipsSignStatus', '1')
console.log('appntSign.tipsSignStatus: ' + this.appntSign.tipsSignStatus)
this.$set(this.appntSign, 'documentStatus', '3')
console.log('appntSign.documentStatus: ' + this.appntSign.documentStatus)
this.isSign = false
// this.isDisable = false
} else {
this.insuredSign.tipsSignStatus = '1'
console.log('````````````````````')
// this.isDisableInsured = false
this.$set(this.insuredSign, 'tipsSignStatus', '1')
console.log('insuredSign.tipsSignStatus: ' + this.insuredSign.tipsSignStatus)
// this.isDisabledComplite = false
}
}
} else {
console.log('````````````````````````')
console.log('第一次进入电子保单')
this.timeOut()
this.getOrderDetail()
}
} else {
this.timeOut()
if (this.detailJump != '1') {
this.getOrderDetail()
}
}
},
methods: {
@@ -177,7 +155,6 @@ export default {
that.Time = true
that.isOver = true
// window.localStorage.setItem('step', '1')
}
that.number = `${time}`
}, 1000)
@@ -191,18 +168,9 @@ export default {
return new Promise((resolve, reject) => {
getOrderDetail(data).then(res => {
if (res.result == '0') {
res.orderDTO.signDTOS.map(item => {
if (item.signType == '0') {
that.appntSign = item
} else if (item.signType == '1') {
that.insuredSign = item
} else {
that.appntSign = item
}
})
if (that.isWeixin) {
if (res.orderDTO.signDTOS.length > 1) {
if (that.appntSign.tipsSignStatus == '1' && that.insuredSign.tipsSignStatus == '1') {
if (that.appntSign.tipsSignStatus == '1') {
that.isDisabledComplite = false
}
}
@@ -238,7 +206,7 @@ export default {
if (this.detailJump != '1') {
if (this.relationToAppnt == '1') {
if (this.isWeixin) {
this.toAirSign('1', '日期', '-150')
this.toAirSign('1', '日期', '150')
} else {
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
@@ -248,13 +216,13 @@ export default {
keyword: '日期',
pageNo: '1',
index: '1',
offset: '-150',
offset: '150',
pos: '3'
}).then(data => {
this.$toast.clear()
if (JSON.parse(data).state == '1') {
this.base64 = decodeURI(JSON.parse(data).sign)
this.appntSign.tipsSignStatus = '1'
this.appntSign.decumentStauts = '3'
this.isDisabledComplite = false
this.isSign = false
}
@@ -262,7 +230,7 @@ export default {
}
} else {
if (this.isWeixin) {
this.toAirSign('1', '日期', '-150')
this.toAirSign('1', '日期', '150')
} else {
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
@@ -273,13 +241,13 @@ export default {
keyword: '日期',
pageNo: '1',
index: '1',
offset: '-150',
offset: '150',
pos: '3'
}).then(data => {
this.$toast.clear()
if (JSON.parse(data).state == '1') {
this.base64 = decodeURI(JSON.parse(data).sign)
this.appntSign.tipsSignStatus = '1'
this.appntSign.documentStatus = '3'
this.isDisabledComplite = false
this.isSign = false
}
@@ -287,8 +255,37 @@ export default {
}
}
} else {
switch (that.saleInsuredInfo.idType) {
case '居民身份证':
that.saleInsuredInfo.idType = '1'
break
case '户口本':
that.saleInsuredInfo.idType = '2'
break
case '出生证':
that.saleInsuredInfo.idType = '3'
break
case '外国人护照':
that.saleInsuredInfo.idType = '4'
break
case '港澳居民来往内地通行证':
that.saleInsuredInfo.idType = '5'
break
case '台湾居民来往大陆通行证':
that.saleInsuredInfo.idType = '6'
break
// case '其他':
// that.saleInsuredInfo.idType = '7'
// break
case '外国人永久居留身份证':
that.saleInsuredInfo.idType = '8'
break
case '港澳台居民居住证':
that.saleInsuredInfo.idType = '9'
break
}
if (this.isWeixin) {
this.toAirSign('1', '日期', '-150')
this.toAirSign('1', '日期', '150')
} else {
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
@@ -299,43 +296,19 @@ export default {
keyword: '日期',
pageNo: '1',
index: '1',
offset: '-150',
offset: '150',
pos: '3'
}).then(data => {
this.$toast.clear()
if (JSON.parse(data).state == '1') {
that.base64 = decodeURI(JSON.parse(data).sign)
that.appntSign.tipsSignStatus = '1'
that.appntSign.documentStatus = '3'
that.isDisabledComplite = false
that.isSign = false
}
})
}
}
} else {
if (this.isWeixin) {
this.toAirSign('2', '日期', '-150')
} else {
EWebBridge.webCallAppInJs('ca_sign', {
//身份证号码
number: that.saleInsuredPersonInfo.idNo,
//姓名
name: that.saleInsuredPersonInfo.name,
type: that.saleInsuredPersonInfo.idType,
keyword: '日期',
pageNo: '1',
index: '1',
offset: '-150',
pos: '3'
}).then(data => {
this.$toast.clear()
if (JSON.parse(data).state == '1') {
that.base64 = decodeURI(JSON.parse(data).sign)
that.insuredSign.tipsSignStatus = '1'
that.isDisabledComplite = false
}
})
}
}
},
toAirSign(status, keyword, offset) {
@@ -375,67 +348,17 @@ export default {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
},
signDTOS: [
ebizSignDTOS: [
{
signOrRead: 'tip',
signId: that.appntSign.signId,
orderNo: window.localStorage.getItem('orderNo'),
readStatus: '1',
documentCode: that.appntSign.documentCode,
documentStatus: '3',
signType: that.signVal,
documentType: that.appntSign.documentType,
baseEncryp: that.base64,
tipsPolicyUrl: that.tipsPolicyUrl
}
]
}
}
saveInformation(data).then(res => {
// console.log(res)
if (res.result == '0') {
this.$toast.clear()
// console.log(res)
window.localStorage.setItem('detailJump', '')
// let url = config.imgDomain + `/app/returnStream?imgPath=${res.signDTO.policyUrl}`
// axios.get(url).then(res => {
// console.log(res)
// })
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/signatureOfElectronic'
},
routerInfo: {
path: '/sale/signatureOfElectronic'
}
})
} else {
that.$toast(res.resultMessage)
}
})
} else {
this.$toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true, // 禁用背景点击
loadingType: 'spinner',
message: '加载中……'
})
let data = {
orderType: 'SIGN_ORDER',
orderDTO: {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
},
signDTOS: [
{
signOrRead: 'tip',
signId: that.insuredSign.signId,
orderNo: window.localStorage.getItem('orderNo'),
readStatus: '1',
signType: that.signVal,
baseEncryp: that.base64,
tipsPolicyUrl: that.tipsPolicyUrl
policyUrl: that.appntSign.policyUrl
}
]
}
@@ -476,59 +399,17 @@ export default {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
},
signDTOS: [
ebizSignDTOS: [
{
signOrRead: 'tip',
signId: that.appntSign.signId,
orderNo: window.localStorage.getItem('orderNo'),
readStatus: '1',
documentCode: that.appntSign.documentCode,
documentStatus: '3',
signType: that.signVal,
documentType: that.appntSign.documentType,
baseEncryp: that.base64,
tipsPolicyUrl: that.tipsPolicyUrl
}
]
}
}
saveInformation(data).then(res => {
// console.log(res)
if (res.result == '0') {
this.$toast.clear()
// window.localStorage.setItem('insurance-url', res.signDTO.policyUrl)
window.localStorage.setItem('detailJump', '')
// let url = config.imgDomain + `/app/returnStream?imgPath=${res.signDTO.policyUrl}`
// axios.get(url).then(res => {
// console.log(res)
// })
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/signatureOfElectronic',
forbidSwipeBack: '1'
},
routerInfo: {
path: '/sale/signatureOfElectronic'
}
})
} else {
that.$toast(res.resultMessage)
}
})
} else {
let data = {
orderType: 'SIGN_ORDER',
orderDTO: {
orderInfoDTO: {
orderNo: window.localStorage.getItem('orderNo')
},
signDTOS: [
{
signOrRead: 'tip',
signId: that.insuredSign.signId,
orderNo: window.localStorage.getItem('orderNo'),
readStatus: '1',
signType: that.signVal,
baseEncryp: that.base64,
tipsPolicyUrl: that.tipsPolicyUrl
policyUrl: that.appntSign.policyUrl
}
]
}
@@ -557,12 +438,13 @@ export default {
},
computed: {
listenChange() {
const { isOver, radio, appntSign, insuredSign } = this
return { isOver, radio, appntSign, insuredSign }
const { isOver, radio, appntSign } = this
return { isOver, radio, appntSign }
}
},
watch: {
listenChange(val) {
console.log(val)
let that = this
if (!that.isWeixin) {
if (that.signVal == '0' || that.signVal == '2') {
@@ -578,25 +460,15 @@ export default {
that.isDisabledComplite = true
}
} else {
if (val.isOver == true && val.radio != '' && val.insuredSign.tipsSignStatus !== '1') {
if (val.isOver == true && val.radio != '') {
that.isDisableInsured = false
} else {
that.isDisableInsured = true
}
}
// if (val.appntSign.tipsSignStatus == '1' && val.insuredSign.tipsSignStatus == '1') {
// // console.log('jinlaile')
// that.isDisabledComplite = false
// } else {
// // console.log('444444444')
// that.isDisabledComplite = true
// }
if (val.appntSign.tipsSignStatus == '1') {
that.isDisable = true
}
if (val.insuredSign.tipsSignStatus == '1') {
that.isDisableInsured = true
}
} else {
if (that.signVal == '0' || that.signVal == '2') {
if (val.isOver == true && val.radio != '') {