mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-15 21:06:44 +08:00
Merge branch 'feature/GFRS-2069【待确定】白名单管理' into dev
# Conflicts: # src/assets/js/utils/request.js # src/views/ebiz/agentEenter/SignContract.vue # src/views/ebiz/sale/SignatureConfirmation.vue
This commit is contained in:
11
src/api/ebiz/whitelist/index.js
Normal file
11
src/api/ebiz/whitelist/index.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import request from '@/assets/js/utils/request'
|
||||
import getUrl from '@/assets/js/utils/get-url'
|
||||
|
||||
// 白名单查询
|
||||
export function getWhitelist(data) {
|
||||
return request({
|
||||
url: getUrl('/agent/white/getWhiteInfo', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
@@ -98,6 +98,7 @@ let performanceRanking = ['/data/performance/getComList', '/data/performance/get
|
||||
|
||||
// 惠桂保
|
||||
let hgb = ['/sale/order/selectHgb', '/sale/order/getHgbDetail']
|
||||
let whitelist = ['/agent/white/getWhiteInfo']
|
||||
|
||||
let whiteList = [
|
||||
'/customer/agent/getCustomersList',
|
||||
@@ -111,7 +112,8 @@ let whiteList = [
|
||||
...productStore,
|
||||
...renewalManage,
|
||||
...performanceRanking,
|
||||
...hgb
|
||||
...hgb,
|
||||
...whitelist
|
||||
]
|
||||
|
||||
// 创建axios实例
|
||||
|
||||
@@ -79,19 +79,38 @@
|
||||
size="large"
|
||||
>提交</van-button
|
||||
>
|
||||
|
||||
<!-- 短信验证弹窗 -->
|
||||
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
|
||||
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
|
||||
<template #button>
|
||||
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
|
||||
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
|
||||
}}</van-button>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Field, Icon, Button, Dialog } from 'vant'
|
||||
import { agreementQuery, signAgreement } from '@/api/ebiz/agentEenter/agentEenter.js'
|
||||
// import { weixinShare } from '@/assets/js/utils/wxShare.js'
|
||||
import { checkSignInvalid, getSignInvalid } from '@/api/ebiz/sale/sale'
|
||||
import { checkSignInvalid, getSignInvalid, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale'
|
||||
import { getWhitelist } from '@/api/ebiz/whitelist'
|
||||
import { filtSignList } from './js/methods'
|
||||
export default {
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
return {
|
||||
// 人脸验证次数
|
||||
faceAuthCount: 0,
|
||||
isCaptchaModalShow: false,
|
||||
code: '',
|
||||
sid: '',
|
||||
countDownNum: 0,
|
||||
countDownTimer: null,
|
||||
authCode: '',
|
||||
// 是否在微信
|
||||
isWeixin,
|
||||
// 微信分享链接是否失效 false 为未失效 true为已失效
|
||||
@@ -99,9 +118,9 @@ export default {
|
||||
// 微信分享校验值
|
||||
signInvalid: '',
|
||||
agentInfo: {
|
||||
name: '皮伟',
|
||||
idNo: '422801199210070412',
|
||||
createdDate: '2019-09-21'
|
||||
name: '',
|
||||
idNo: '',
|
||||
createdDate: ''
|
||||
},
|
||||
referrerInfo: {
|
||||
orgLabel: ''
|
||||
@@ -117,14 +136,73 @@ export default {
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
mounted() {
|
||||
document.body.style.backgroundColor = '#fff'
|
||||
},
|
||||
beforeRouteLeave(to, from, next) {
|
||||
document.body.style.backgroundColor = ''
|
||||
next()
|
||||
},
|
||||
methods: {
|
||||
async onCaptchaConfirm(action, done) {
|
||||
if (!this.sid) {
|
||||
done(false)
|
||||
return
|
||||
}
|
||||
if (!this.code.trim()) {
|
||||
done(false)
|
||||
return this.$toast('请输入验证码')
|
||||
}
|
||||
try {
|
||||
let res = await autchCodeCheck({
|
||||
smsId: this.sid,
|
||||
code: this.code
|
||||
})
|
||||
console.log(this.sid, this.code)
|
||||
if (res.result === '0') {
|
||||
this.goUrl(this.authCode)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
} catch (error) {
|
||||
this.$toast('网络异常')
|
||||
console.log(error)
|
||||
}
|
||||
this.onCaptchaCancel()
|
||||
done()
|
||||
},
|
||||
onCaptchaCancel() {
|
||||
this.isCaptchaModalShow = false
|
||||
clearInterval(this.countDownTimer)
|
||||
this.countDownTimer = null
|
||||
this.countDownNum = 0
|
||||
this.sid = ''
|
||||
this.code = ''
|
||||
},
|
||||
async getCaptcha() {
|
||||
let data = {
|
||||
operateType: 'appntInfoEntry',
|
||||
type: 'H5',
|
||||
operateCode: this.agentInfo.mobile,
|
||||
system: 'agentApp',
|
||||
operateCodeType: '0'
|
||||
}
|
||||
//获取验证码
|
||||
try {
|
||||
let res = await getAuthCode(data)
|
||||
console.log(res)
|
||||
if (res.result === '0') {
|
||||
this.$toast(res.resultMessage)
|
||||
this.sid = res.sessionId
|
||||
this.countDownNum = 60
|
||||
this.countDownTimer = setInterval(() => {
|
||||
this.countDownNum--
|
||||
if (this.countDownNum <= 0) {
|
||||
clearInterval(this.countDownTimer)
|
||||
this.countDownTimer = null
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
this.$toast('网络异常')
|
||||
}
|
||||
},
|
||||
//初始化信息
|
||||
async init() {
|
||||
if (this.isWeixin) {
|
||||
@@ -253,38 +331,80 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
faceAuth(code) {
|
||||
let that = this
|
||||
async faceAuth(code) {
|
||||
this.authCode = code
|
||||
localStorage.idNo = this.agentInfo.idNo
|
||||
localStorage.idName = this.agentInfo.name
|
||||
/*
|
||||
|
||||
if (code == '0') {
|
||||
if (that.agentInfo.idType == '1') {
|
||||
if (this.agentInfo.idType == '1') {
|
||||
// 人脸识别次数小于3次
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
forbidClick: true, // 禁用背景点击
|
||||
loadingType: 'spinner',
|
||||
message: '加载中……'
|
||||
})
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
businessSource: '2', //业务来源:1-电投,2-入司,3-理赔,4-保全
|
||||
number: that.agentInfo.idNo, //身份证号码
|
||||
name: that.agentInfo.name //姓名
|
||||
}).then(data => {
|
||||
console.log(data)
|
||||
this.$toast.clear()
|
||||
if (JSON.parse(data).state == '1') {
|
||||
that.goUrl(code)
|
||||
}
|
||||
// 判断是否在白名单, 在白名单无需人脸
|
||||
const res = await getWhitelist({
|
||||
idNo: this.agentInfo.idNo,
|
||||
name: this.agentInfo.name,
|
||||
whiteType: 'enter_agent_face_show'
|
||||
})
|
||||
console.log(res.content)
|
||||
if (res.result === '0') {
|
||||
// 用户在白名单内
|
||||
if (res.content && res.content.length) {
|
||||
this.goUrl(code)
|
||||
}
|
||||
// 不再白名单内
|
||||
else {
|
||||
if (this.faceAuthCount < 3) {
|
||||
try {
|
||||
// eslint-disable-next-line no-undef
|
||||
const authRes = await EWebBridge.webCallAppInJs('face_auth', {
|
||||
businessSource: '2', //业务来源:1-电投,2-入司,3-理赔,4-保全
|
||||
number: this.agentInfo.idNo, //身份证号码
|
||||
name: this.agentInfo.name //姓名
|
||||
})
|
||||
// const authRes = await this.fakeFaceAuth(true)
|
||||
console.log(authRes)
|
||||
if (authRes.state == '1') {
|
||||
this.goUrl(code)
|
||||
} else {
|
||||
that.goUrl(code)
|
||||
this.$toast('人脸识别失败')
|
||||
// 人脸验证失败更新faceAuthCount
|
||||
this.faceAuthCount++
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
} else {
|
||||
that.goUrl(code)
|
||||
this.isCaptchaModalShow = true
|
||||
}
|
||||
*/
|
||||
this.goUrl(code) //TEST调试专用
|
||||
}
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
} else {
|
||||
this.goUrl(code)
|
||||
}
|
||||
} else {
|
||||
this.goUrl(code)
|
||||
}
|
||||
},
|
||||
fakeFaceAuth(expect) {
|
||||
console.log('模拟调用人脸识别')
|
||||
return new Promise(function(resolve, reject) {
|
||||
setTimeout(() => {
|
||||
console.log('模拟人脸识别完成')
|
||||
if (expect) {
|
||||
resolve({ state: '0' })
|
||||
} else {
|
||||
reject({ state: '0' })
|
||||
}
|
||||
}, 2000)
|
||||
})
|
||||
},
|
||||
goUrl(code) {
|
||||
let path = ''
|
||||
@@ -342,11 +462,23 @@ export default {
|
||||
[Field.name]: Field,
|
||||
[Icon.name]: Icon,
|
||||
[Button.name]: Button
|
||||
},
|
||||
filters: {
|
||||
countDownText(val) {
|
||||
if (isNaN(parseFloat(val))) {
|
||||
return val
|
||||
} else {
|
||||
return `${val} s`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
#app .van-cell:not(:last-child)::after {
|
||||
border: none;
|
||||
}
|
||||
.signContract-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -6,32 +6,6 @@
|
||||
<van-cell title="申请类型" :value="list.applyTypeName"></van-cell>
|
||||
</van-cell-group>
|
||||
<div>
|
||||
<!-- <van-collapse v-model="activeNames" class="mt10" v-if="!isWeixin">
|
||||
<van-collapse-item name="1">
|
||||
<div slot="title">
|
||||
受托人
|
||||
<span class="ml20">{{ list.mandatorName }}</span>
|
||||
</div>
|
||||
<p class="mb20">以下内容需要您按照顺序阅读并签字确认:</p>
|
||||
<p>需签署:</p>
|
||||
<p class="mb20">
|
||||
<span class="text" :class="{ red: list.mandatorSignState == 1 }">{{ list.name }}</span>
|
||||
<img :src="src" v-if="list.mandatorSignState == '1'" />
|
||||
</p>
|
||||
<p class="start">点击【开始】按钮,进行相关操作</p>
|
||||
<div class="flex justify-content-a mt20">
|
||||
<van-button
|
||||
type="danger"
|
||||
size="normal"
|
||||
style="width: 157px;"
|
||||
plain
|
||||
v-no-more-click="1000"
|
||||
@click="start_ocr(4)"
|
||||
:disabled="list.mandatorSignState == 1"
|
||||
>开始</van-button>
|
||||
</div>
|
||||
</van-collapse-item>
|
||||
</van-collapse>-->
|
||||
<van-collapse v-model="activeNames" class="mt10 pb50">
|
||||
<van-collapse-item name="2">
|
||||
<div slot="title">
|
||||
@@ -75,21 +49,35 @@
|
||||
<div class="bottom-btn bg-white" v-if="!isWeixin && list.applyerSignState == 1">
|
||||
<van-button type="danger" size="large" @click="next" v-no-more-click="1000" v-if="!isWeixin" :disabled="list.applyerSignState == 0">提交</van-button>
|
||||
</div>
|
||||
<!-- <UploadImageFile :typeface="idcardData.typeface" :realName="idcardData.idcardName" :idno="idcardData.idcardNumber" @sendimage="sendimage"></UploadImageFile> -->
|
||||
<Read v-show="readShow" @confirm="goToNext" />
|
||||
|
||||
<!-- 短信验证弹窗 -->
|
||||
<van-dialog v-model="isCaptchaModalShow" title="提示" show-cancel-button :before-close="onCaptchaConfirm" @cancel="onCaptchaCancel">
|
||||
<van-field v-model="code" type="number" :maxlength="6" center clearable label="短信验证码" placeholder="请输入短信验证码">
|
||||
<template #button>
|
||||
<van-button size="small" type="danger" :disabled="countDownNum !== 0" @click="getCaptcha">{{
|
||||
countDownNum === 0 ? '获取验证码' : countDownNum | countDownText
|
||||
}}</van-button>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import UploadImageFile from '@/components/ebiz/sale/UploadImageFile'
|
||||
import Read from '@/components/ebiz/claims/Read'
|
||||
import { Cell, CellGroup, Collapse, CollapseItem, Dialog } from 'vant'
|
||||
import { getToken, getSignInvalid, checkSignInvalid, getRecognitionUrl, getRecognitionResult } from '@/api/ebiz/sale/sale'
|
||||
import { getSignInvalid, checkSignInvalid, getRecognitionUrl, getRecognitionResult, getAuthCode, autchCodeCheck } from '@/api/ebiz/sale/sale'
|
||||
import { progressDetail, submit } from '@/api/ebiz/claims/claims'
|
||||
import { weixinShare } from '@/assets/js/utils/wxShare.js'
|
||||
import { getWhitelist } from '@/api/ebiz/whitelist'
|
||||
export default {
|
||||
data() {
|
||||
let isWeixin = this.$utils.device().isWeixin //判断环境
|
||||
return {
|
||||
isCaptchaModalShow: false,
|
||||
sid: '',
|
||||
code: '',
|
||||
countDownNum: 0,
|
||||
countDownTimer: null,
|
||||
// 折叠面板
|
||||
activeNames: ['1', '2'],
|
||||
// 是否在微信
|
||||
@@ -123,7 +111,6 @@ export default {
|
||||
[Collapse.name]: Collapse,
|
||||
[CollapseItem.name]: CollapseItem,
|
||||
[Dialog.name]: Dialog,
|
||||
// UploadImageFile: UploadImageFile,
|
||||
Read
|
||||
},
|
||||
created() {
|
||||
@@ -131,6 +118,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
if (!this.$route.query.edit || localStorage.claimFrom == null) {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('webview_left_button', {
|
||||
img: this.$assetsUrl + 'images/del-close@3x.png',
|
||||
intercept: '1' //是否拦截原生返回事件 1是 其他否
|
||||
@@ -143,6 +131,72 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getCaptcha() {
|
||||
let data = {
|
||||
operateType: 'appntInfoEntry',
|
||||
type: 'H5',
|
||||
operateCode: this.agentInfo.mobile,
|
||||
system: 'agentApp',
|
||||
operateCodeType: '0'
|
||||
}
|
||||
// 获取验证码
|
||||
try {
|
||||
let res = await getAuthCode(data)
|
||||
console.log(res)
|
||||
if (res.result === '0') {
|
||||
this.$toast(res.resultMessage)
|
||||
this.sid = res.sessionId
|
||||
this.countDownNum = 60
|
||||
this.countDownTimer = setInterval(() => {
|
||||
this.countDownNum--
|
||||
if (this.countDownNum <= 0) {
|
||||
clearInterval(this.countDownTimer)
|
||||
this.countDownTimer = null
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
this.$toast('网络异常')
|
||||
}
|
||||
},
|
||||
async onCaptchaConfirm(action, done) {
|
||||
if (!this.sid) {
|
||||
done(false)
|
||||
return
|
||||
}
|
||||
if (!this.code.trim()) {
|
||||
done(false)
|
||||
return this.$toast('请输入验证码')
|
||||
}
|
||||
try {
|
||||
let res = await autchCodeCheck({
|
||||
smsId: this.sid,
|
||||
code: this.code
|
||||
})
|
||||
console.log(this.sid, this.code)
|
||||
if (res.result === '0') {
|
||||
this.goUrl(this.authCode)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
} catch (error) {
|
||||
this.$toast('网络异常')
|
||||
console.log(error)
|
||||
}
|
||||
this.onCaptchaCancel()
|
||||
done()
|
||||
},
|
||||
onCaptchaCancel() {
|
||||
this.isCaptchaModalShow = false
|
||||
clearInterval(this.countDownTimer)
|
||||
this.countDownTimer = null
|
||||
this.countDownNum = 0
|
||||
this.sid = ''
|
||||
this.code = ''
|
||||
},
|
||||
// 初始化
|
||||
async init() {
|
||||
if (this.isWeixin) {
|
||||
@@ -159,8 +213,6 @@ export default {
|
||||
}
|
||||
let signInvalid = sessionStorage.getItem('signInvalid')
|
||||
let rs = await this.checkSignInvalid(signInvalid)
|
||||
console.log('```````````````')
|
||||
console.log(rs)
|
||||
if (rs == '1') {
|
||||
this.isInvalid = false
|
||||
} else {
|
||||
@@ -229,6 +281,7 @@ export default {
|
||||
},
|
||||
// 微信分享
|
||||
share(code) {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
@@ -250,7 +303,7 @@ export default {
|
||||
})
|
||||
},
|
||||
// 人脸识别
|
||||
start_ocr(val) {
|
||||
async start_ocr(val) {
|
||||
//3申请人需要空签 4受托人
|
||||
console.log(val)
|
||||
let that = this
|
||||
@@ -260,7 +313,6 @@ export default {
|
||||
if (that.list.applyerCertiType != '1') {
|
||||
this.showRead()
|
||||
} else {
|
||||
// this.idcardData.typeface = !this.idcardData.typeface
|
||||
this.idcardData.idcardName = this.list.applyerName
|
||||
this.idcardData.idcardNumber = this.list.applyerCertiCode
|
||||
this.getRecognitionUrl()
|
||||
@@ -273,26 +325,48 @@ export default {
|
||||
if (that.list.applyerCertiType != '1') {
|
||||
this.showRead()
|
||||
} else {
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
const res = await getWhitelist({
|
||||
idNo: this.list.applyerCertiCode,
|
||||
name: this.list.applyerName,
|
||||
whiteType: 'claim_face_show'
|
||||
})
|
||||
if (res.result === '0') {
|
||||
// 用户在白名单内
|
||||
if (res.content && res.content.length) {
|
||||
this.showRead()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
// 人脸验证失败次数小于3
|
||||
if (this.faceAuthCount <= 3) {
|
||||
// eslint-disable-next-line no-undef
|
||||
const authRes = await EWebBridge.webCallAppInJs('face_auth', {
|
||||
//身份证号码
|
||||
number: that.list.applyerCertiCode,
|
||||
//姓名
|
||||
name: that.list.applyerName,
|
||||
businessSource: '3'
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
this.showRead()
|
||||
}
|
||||
})
|
||||
|
||||
if (JSON.parse(authRes).state == '1') {
|
||||
this.showRead()
|
||||
} else {
|
||||
this.faceAuthCount++
|
||||
}
|
||||
} else {
|
||||
// 切换短信验证
|
||||
this.isCaptchaModalShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getRecognitionUrl(val, num) {
|
||||
getRecognitionUrl() {
|
||||
localStorage.setItem('faceAuthWeXin-requestId', '')
|
||||
localStorage.setItem('faceAuthWeXin-bizToken', '')
|
||||
return new Promise((resolve, reject) => {
|
||||
// this.$route.fullPath
|
||||
return new Promise(() => {
|
||||
let data = { realName: this.idcardData.idcardName, idno: this.idcardData.idcardNumber, redirectUrl: location.origin + '/#' + this.$route.fullPath }
|
||||
console.log('获取URL请求参数', data)
|
||||
getRecognitionUrl(data).then(
|
||||
@@ -317,9 +391,6 @@ export default {
|
||||
.then(res => {
|
||||
console.log('getRecognitionResult', res)
|
||||
if (res.result == '0') {
|
||||
// this.recognizeResult = res.content.result
|
||||
// this.recognizeMessage = res.content.result == '1' ? res.content.resultMessage : ''
|
||||
// this.sendimage(true)
|
||||
this.showRead()
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
@@ -392,30 +463,15 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
/*if (localStorage.claimFrom) {
|
||||
that.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/claims/Success',
|
||||
forbidSwipeBack: '1',
|
||||
backToFirst: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/claims/Success'
|
||||
}
|
||||
})
|
||||
},
|
||||
filters: {
|
||||
countDownText(val) {
|
||||
if (isNaN(parseFloat(val))) {
|
||||
return val
|
||||
} else {
|
||||
that.$jump({
|
||||
flag: 'h5',
|
||||
extra: {
|
||||
url: location.origin + '/#/claims/Fail',
|
||||
forbidSwipeBack: '1'
|
||||
},
|
||||
routerInfo: {
|
||||
path: '/claims/Fail'
|
||||
return `${val} s`
|
||||
}
|
||||
})
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,6 +255,7 @@ 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() {
|
||||
@@ -342,6 +343,19 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
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') {
|
||||
return this.$dialog
|
||||
@@ -460,7 +474,6 @@ export default {
|
||||
},
|
||||
// 获取消息和阅读状态
|
||||
realPeopelCheck() {
|
||||
let that = this
|
||||
this.$toast.loading({
|
||||
// 持续展示 toast
|
||||
duration: 0,
|
||||
@@ -492,6 +505,7 @@ export default {
|
||||
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') {
|
||||
@@ -608,16 +622,12 @@ export default {
|
||||
// 人脸识别
|
||||
async start_ocr(val) {
|
||||
// val 0投保人 1被保险人 2本人
|
||||
/////
|
||||
console.log(this.isWeixin, 'this.isWeixin')
|
||||
console.log(val, '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.$route.query.saleInsuredInfo).idType != '1' || JSON.parse(this.$route.query.saleInsuredInfo).age < '18') {
|
||||
if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '1') {
|
||||
that.goUrl()
|
||||
} else {
|
||||
@@ -632,9 +642,6 @@ export default {
|
||||
}
|
||||
// 人脸识别
|
||||
if (this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||
// this.idcardData.typeface = !this.idcardData.typeface
|
||||
// this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name
|
||||
// this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredInfo).idNo
|
||||
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).name
|
||||
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idNo
|
||||
this.recognition()
|
||||
@@ -646,8 +653,10 @@ export default {
|
||||
} else {
|
||||
window.localStorage.setItem('sign-val', val)
|
||||
window.localStorage.setItem('sign-insured', JSON.stringify(that.insuredSign))
|
||||
if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idType != '1' || JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age < '18') {
|
||||
// if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1') {
|
||||
if (
|
||||
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idType != '1' ||
|
||||
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age < '18'
|
||||
) {
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
//RID 状态--有效
|
||||
@@ -661,9 +670,6 @@ export default {
|
||||
}
|
||||
// 人脸识别
|
||||
if (this.faceAuthCount.insured < this.smsAuthNum) {
|
||||
// this.idcardData.typeface = !this.idcardData.typeface
|
||||
// this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredPersonInfo).name
|
||||
// this.idcardData.idcardNumber = JSON.parse(this.$route.query.saleInsuredPersonInfo).idNo
|
||||
this.idcardData.realName = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).name
|
||||
this.idcardData.idno = JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).idNo
|
||||
this.recognition()
|
||||
@@ -678,7 +684,6 @@ export default {
|
||||
window.localStorage.setItem('sign-val', val)
|
||||
window.localStorage.setItem('sign-appnt', JSON.stringify(that.appntSign))
|
||||
if (this.saleInsuredInfo.idType != '1') {
|
||||
// if (this.saleInsuredInfo.idType != '1' || this.saleInsuredInfo.age < '18') {
|
||||
that.goUrl()
|
||||
} else {
|
||||
//RID 状态--有效
|
||||
@@ -690,18 +695,31 @@ export default {
|
||||
return
|
||||
}
|
||||
}
|
||||
// 白名单校验
|
||||
const res = await getWhitelist({
|
||||
idNo: this.saleInsuredInfo.idNo,
|
||||
name: this.saleInsuredInfo.name,
|
||||
whiteType: 'sale_face_show'
|
||||
})
|
||||
console.log('白名单查询结果: ', res)
|
||||
if (res.result === '0') {
|
||||
// 在白名单内
|
||||
if (res.content && res.content.length) {
|
||||
this.goUrl()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
if (this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||
// 原人脸识别
|
||||
// EWebBridge.webCallAppInJs('face_auth', {
|
||||
// businessSource: '1', //业务来源:1-电投,2-入司,3-理赔,4-保全
|
||||
// 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') {
|
||||
// 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 //姓名
|
||||
})
|
||||
if (JSON.parse(authRes).state == '1') {
|
||||
// 保存rid 数据
|
||||
that.saveCustomerRidInfo('appnt_rid', 'B')
|
||||
that.goUrl()
|
||||
@@ -712,7 +730,6 @@ export default {
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.operaFlag = 'appnt'
|
||||
this.realPeopelCheck()
|
||||
@@ -721,7 +738,6 @@ export default {
|
||||
} else {
|
||||
window.localStorage.setItem('sign-val', val)
|
||||
window.localStorage.setItem('sign-insured', JSON.stringify(that.insuredSign))
|
||||
// if (this.saleInsuredPersonInfo.idType != '1') {
|
||||
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '18') {
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
@@ -734,19 +750,34 @@ export default {
|
||||
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) {
|
||||
// 调原生人脸识别
|
||||
// EWebBridge.webCallAppInJs('face_auth', {
|
||||
// businessSource: '1', //业务来源:1-电投,2-入司,3-理赔,4-保全
|
||||
// number: that.saleInsuredPersonInfo.idNo, //身份证号码
|
||||
// name: that.saleInsuredPersonInfo.name //姓名
|
||||
// })
|
||||
new Promise(resolve => {
|
||||
console.log('--跳过人脸识别--返回识别成功')
|
||||
resolve(JSON.stringify({ state: '1' }))
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
// eslint-disable-next-line no-undef
|
||||
const authRes = await EWebBridge.webCallAppInJs('face_auth', {
|
||||
businessSource: '1', //业务来源:1-电投,2-入司,3-理赔,4-保全
|
||||
number: that.saleInsuredPersonInfo.idNo, //身份证号码
|
||||
name: that.saleInsuredPersonInfo.name //姓名
|
||||
})
|
||||
if (JSON.parse(authRes).state == '1') {
|
||||
that.saveCustomerRidInfo('insured_rid', 'B')
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
@@ -756,7 +787,6 @@ export default {
|
||||
this.realPeopelCheck()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.operaFlag = 'insured'
|
||||
this.realPeopelCheck()
|
||||
@@ -821,7 +851,6 @@ export default {
|
||||
let that = this
|
||||
let path = ''
|
||||
if (that.insuredSign[0].documentStatus == 0) {
|
||||
debugger
|
||||
path = 'insuranceInformation'
|
||||
} else {
|
||||
path = 'SignatureOfElectronic'
|
||||
@@ -866,6 +895,7 @@ export default {
|
||||
localStorage.productCode
|
||||
)
|
||||
if (this.changeCard) {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
@@ -877,10 +907,6 @@ export default {
|
||||
localStorage.orderNo +
|
||||
'&token=' +
|
||||
localStorage.token +
|
||||
// '&saleInsuredInfo=' +
|
||||
// encodeURI(localStorage.saleInsuredInfo) +
|
||||
// '&saleInsuredPersonInfo=' +
|
||||
// encodeURI(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) +
|
||||
'&relationToAppnt=' +
|
||||
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt +
|
||||
'&shareCode=' +
|
||||
@@ -894,6 +920,7 @@ export default {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// eslint-disable-next-line no-undef
|
||||
EWebBridge.webCallAppInJs('bridge', {
|
||||
flag: 'share',
|
||||
extra: {
|
||||
@@ -905,10 +932,6 @@ export default {
|
||||
localStorage.orderNo +
|
||||
'&token=' +
|
||||
localStorage.token +
|
||||
// '&saleInsuredInfo=' +
|
||||
// encodeURI(localStorage.saleInsuredInfo) +
|
||||
// '&saleInsuredPersonInfo=' +
|
||||
// encodeURI(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) +
|
||||
'&relationToAppnt=' +
|
||||
JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).relationToAppnt +
|
||||
'&shareCode=' +
|
||||
@@ -1146,7 +1169,6 @@ export default {
|
||||
this.realPeopleRidInfo.insureRidFlag = res.orderDTO.insuredDTOs[0].ridStatus
|
||||
//存code区分万能型产品
|
||||
let productCode, riskName
|
||||
console.log('isDoubleMailRisk', that.orderInfo.isDoubleMailRisk)
|
||||
let isDoubleMailRisk = that.orderInfo.isDoubleMailRisk
|
||||
if (isDoubleMailRisk == '1') {
|
||||
productCode = 'GFRS_M0017'
|
||||
@@ -1159,8 +1181,6 @@ export default {
|
||||
this.riskName = riskName
|
||||
localStorage.setItem('riskName', riskName)
|
||||
|
||||
console.log('riskName', that.orderInfo.isDoubleMailRisk)
|
||||
// nsuredDTOs[0].riskDTOLst
|
||||
if (this.relationToAppnt != '1') {
|
||||
this.activeNames.push(res.orderDTO.insuredDTOs.length + 1)
|
||||
} else {
|
||||
@@ -1238,7 +1258,6 @@ export default {
|
||||
}
|
||||
},
|
||||
getSignInvalid() {
|
||||
// let that = this
|
||||
this.$toast.loading({
|
||||
duration: 0, // 持续展示 toast
|
||||
|
||||
@@ -1270,7 +1289,7 @@ export default {
|
||||
let data = {
|
||||
sign: signInvalid
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise(resolve => {
|
||||
checkSignInvalid(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
that.$toast.clear()
|
||||
@@ -1282,10 +1301,7 @@ export default {
|
||||
},
|
||||
// 微信人脸验证后 返回值 操作
|
||||
sendimage(e) {
|
||||
// let that = this
|
||||
if (e == '0') {
|
||||
// this.$toast.clear()
|
||||
// this.$toast('人脸检测成功')
|
||||
// 1 为被保险人
|
||||
if (window.sessionStorage.shareCode == '1') {
|
||||
// 被保人微信端人脸识别成功
|
||||
@@ -1329,7 +1345,7 @@ export default {
|
||||
},
|
||||
|
||||
getRecognitionUrl() {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise(() => {
|
||||
this.idcardData.redirectUrl = location.origin + this.replaceSearch()
|
||||
let data = {
|
||||
realName: this.idcardData.realName,
|
||||
@@ -1337,10 +1353,8 @@ export default {
|
||||
redirectUrl: this.idcardData.redirectUrl,
|
||||
businessSource: this.idcardData.businessSource
|
||||
}
|
||||
console.log('获取URL请求参数', data)
|
||||
getRecognitionUrl(data).then(
|
||||
res => {
|
||||
console.log('getRecognitionUrl', res)
|
||||
if (res.result == '0') {
|
||||
localStorage.setItem('faceAuthWeXin-requestId', JSON.stringify(res.content.requestId))
|
||||
localStorage.setItem('faceAuthWeXin-bizToken', JSON.stringify(res.content.bizToken))
|
||||
@@ -1356,10 +1370,9 @@ export default {
|
||||
})
|
||||
},
|
||||
getRecognitionResult(requestId, bizToken) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise(() => {
|
||||
getRecognitionResult({ requestId, bizToken }).then(
|
||||
res => {
|
||||
console.log('getRecognitionResult', res)
|
||||
if (res.result == '0') {
|
||||
this.recognizeResult = res.result
|
||||
} else {
|
||||
@@ -1447,7 +1460,6 @@ export default {
|
||||
[Cell.name]: Cell,
|
||||
[CellGroup.name]: CellGroup,
|
||||
[Collapse.name]: Collapse,
|
||||
// UploadImageFile: UploadImageFile,
|
||||
[CollapseItem.name]: CollapseItem,
|
||||
[Dialog.name]: Dialog,
|
||||
[Field.name]: Field,
|
||||
|
||||
Reference in New Issue
Block a user