Merge branch 'feature/GFRS-1989【待确定】客户核验流程优化' into release/20210105

# Conflicts:
#	package.json
#	src/api/ebiz/sale/sale.js
#	src/assets/js/utils/cacheUtils.js
#	src/assets/js/utils/cryptoJsUtil.js
#	src/assets/js/utils/needCacheKey.js
#	src/config/index.js
#	src/main.js
This commit is contained in:
yang.huaxiang
2021-01-06 11:46:18 +08:00
3 changed files with 139 additions and 5 deletions

View File

@@ -271,3 +271,12 @@ export function saveOrderActiveType(data) {
data data
}) })
} }
// 2.1. 添加客户rid 认证
export function saveCustomerRid(data) {
return request({
url: getUrl('/sale/rid/saveCustomerRid', 1),
method: 'post',
data
})
}

View File

@@ -11,7 +11,7 @@ import config from '@/config'
import noMoreClick from '@/directive/noMoreClick' import noMoreClick from '@/directive/noMoreClick'
import vueHashCalendar from 'vue-hash-calendar' import vueHashCalendar from 'vue-hash-calendar'
import 'vue-hash-calendar/lib/vue-hash-calendar.css' import 'vue-hash-calendar/lib/vue-hash-calendar.css'
import md5 from 'js-md5'; import md5 from 'js-md5'
import cryptoJs from 'crypto-js' import cryptoJs from 'crypto-js'
import cacheUtils from '@/assets/js/utils/cacheUtils' import cacheUtils from '@/assets/js/utils/cacheUtils'

View File

@@ -248,11 +248,13 @@ import {
getAuthCode, getAuthCode,
autchCodeCheck, autchCodeCheck,
getRecognitionUrl, getRecognitionUrl,
getRecognitionResult getRecognitionResult,
saveCustomerRid
} from '@/api/ebiz/sale/sale' } from '@/api/ebiz/sale/sale'
import { checkPhone } from '@/api/ebiz/customer/customer' import { checkPhone } from '@/api/ebiz/customer/customer'
import { weixinShare } from '@/assets/js/utils/wxShare.js' import { weixinShare } from '@/assets/js/utils/wxShare.js'
import IndexBar from '@/components/ebiz/sale/IndexBar' import IndexBar from '@/components/ebiz/sale/IndexBar'
import Formatter from '@/assets/js/utils/date-utils.js'
export default { export default {
data() { data() {
@@ -332,7 +334,11 @@ export default {
changeCard: localStorage.changeCard, changeCard: localStorage.changeCard,
salePageFlag: '-10', salePageFlag: '-10',
recognizeResult: '', //微信端-人脸识别结果 recognizeResult: '', //微信端-人脸识别结果
recognizeMessage: '' //微信端-人脸识别失败原因 recognizeMessage: '', //微信端-人脸识别失败原因
realPeopleRidInfo: {
appntRidFlag: null,
insureRidFlag: null
}
} }
}, },
methods: { methods: {
@@ -501,6 +507,37 @@ export default {
}) })
}) })
}, },
// 手机号鉴权
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() { async authConfirm() {
//清理计时器 //清理计时器
@@ -543,6 +580,7 @@ export default {
}, },
//提交变更申请 //提交变更申请
async changeSubmit() { async changeSubmit() {
let that = this
if (null == this.sid) { if (null == this.sid) {
this.$toast('请先进行发送短信验证码') this.$toast('请先进行发送短信验证码')
return return
@@ -553,8 +591,10 @@ export default {
}) })
if (res.result == 0) { if (res.result == 0) {
if ('appnt' == this.operaFlag) { if ('appnt' == this.operaFlag) {
that.saveCustomerRidInfo('appnt_rid', 'A')
this.goUrl() this.goUrl()
} else if ('insured' == this.operaFlag) { } else if ('insured' == this.operaFlag) {
that.saveCustomerRidInfo('insured_rid', 'A')
this.insuredUrl() this.insuredUrl()
} }
} else { } else {
@@ -566,7 +606,7 @@ export default {
this.clearTimer() this.clearTimer()
}, },
// 人脸识别 // 人脸识别
start_ocr(val) { async start_ocr(val) {
// val 0投保人 1被保险人 2本人 // val 0投保人 1被保险人 2本人
///// /////
console.log(this.isWeixin, 'this.isWeixin') console.log(this.isWeixin, 'this.isWeixin')
@@ -581,6 +621,16 @@ export default {
if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '1') { if (JSON.parse(this.$CacheUtils.getLocItem('saleInsuredInfo')).idType != '1') {
that.goUrl() that.goUrl()
} else { } else {
//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) { if (this.faceAuthCount.appnt < this.smsAuthNum) {
// this.idcardData.typeface = !this.idcardData.typeface // this.idcardData.typeface = !this.idcardData.typeface
// this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name // this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredInfo).name
@@ -600,6 +650,16 @@ export default {
// if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1') { // if (JSON.parse(this.$route.query.saleInsuredPersonInfo).idType != '1') {
that.insuredUrl() that.insuredUrl()
} else { } else {
//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) { if (this.faceAuthCount.insured < this.smsAuthNum) {
// this.idcardData.typeface = !this.idcardData.typeface // this.idcardData.typeface = !this.idcardData.typeface
// this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredPersonInfo).name // this.idcardData.idcardName = JSON.parse(this.$route.query.saleInsuredPersonInfo).name
@@ -621,6 +681,15 @@ export default {
// if (this.saleInsuredInfo.idType != '1' || this.saleInsuredInfo.age < '18') { // if (this.saleInsuredInfo.idType != '1' || this.saleInsuredInfo.age < '18') {
that.goUrl() that.goUrl()
} else { } else {
//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) { if (this.faceAuthCount.appnt < this.smsAuthNum) {
// 原人脸识别 // 原人脸识别
console.log(this.faceAuthCount, 'faceAuthCount') console.log(this.faceAuthCount, 'faceAuthCount')
@@ -632,6 +701,8 @@ export default {
name: that.saleInsuredInfo.name //姓名 name: that.saleInsuredInfo.name //姓名
}).then(data => { }).then(data => {
if (JSON.parse(data).state == '1') { if (JSON.parse(data).state == '1') {
// 保存rid 数据
that.saveCustomerRidInfo('appnt_rid', 'B')
that.goUrl() that.goUrl()
} else { } else {
that.faceAuthCount.appnt++ that.faceAuthCount.appnt++
@@ -653,6 +724,16 @@ export default {
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '18') { if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '18') {
that.insuredUrl() that.insuredUrl()
} else { } else {
//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) { if (this.faceAuthCount.insured < this.smsAuthNum) {
// 调原生人脸识别 // 调原生人脸识别
EWebBridge.webCallAppInJs('face_auth', { EWebBridge.webCallAppInJs('face_auth', {
@@ -661,6 +742,7 @@ export default {
name: that.saleInsuredPersonInfo.name //姓名 name: that.saleInsuredPersonInfo.name //姓名
}).then(data => { }).then(data => {
if (JSON.parse(data).state == '1') { if (JSON.parse(data).state == '1') {
that.saveCustomerRidInfo('insured_rid', 'B')
that.insuredUrl() that.insuredUrl()
} else { } else {
that.faceAuthCount.insured++ that.faceAuthCount.insured++
@@ -960,7 +1042,8 @@ export default {
message: '加载中……' message: '加载中……'
}) })
let data = { let data = {
orderNo: window.localStorage.getItem('orderNo') orderNo: window.localStorage.getItem('orderNo'),
getOtherType: 'RID'
} }
localStorage.setItem('riskName', '') localStorage.setItem('riskName', '')
return new Promise(resolve => { return new Promise(resolve => {
@@ -1053,6 +1136,9 @@ export default {
that.recmd = res.orderDTO.recmdDTO that.recmd = res.orderDTO.recmdDTO
that.orderInfo = res.orderDTO.orderInfoDTO that.orderInfo = res.orderDTO.orderInfoDTO
that.insured = res.orderDTO.insuredDTOs that.insured = res.orderDTO.insuredDTOs
// 初始化RID状态
this.realPeopleRidInfo.appntRidFlag = res.orderDTO.appntDTO.ridStatus
this.realPeopleRidInfo.insureRidFlag = res.orderDTO.insuredDTOs[0].ridStatus
//存code区分万能型产品 //存code区分万能型产品
let productCode, riskName let productCode, riskName
console.log('isDoubleMailRisk', that.orderInfo.isDoubleMailRisk) console.log('isDoubleMailRisk', that.orderInfo.isDoubleMailRisk)
@@ -1197,8 +1283,12 @@ export default {
// this.$toast('人脸检测成功') // this.$toast('人脸检测成功')
// 1 为被保险人 // 1 为被保险人
if (window.sessionStorage.shareCode == '1') { if (window.sessionStorage.shareCode == '1') {
// 被保人微信端人脸识别成功
this.saveCustomerRidInfo('insured_rid', 'B')
this.insuredUrl() this.insuredUrl()
} else { } else {
// 投保人微信端人脸识别成功
this.saveCustomerRidInfo('appnt_rid', 'B')
this.goUrl() this.goUrl()
} }
} else { } else {
@@ -1279,6 +1369,41 @@ export default {
localStorage.setItem('faceAuthWeXin-requestId', '') localStorage.setItem('faceAuthWeXin-requestId', '')
localStorage.setItem('faceAuthWeXin-bizToken', '') 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-01-01' : 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-01-01' : 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)
})
} }
}, },
created() { created() {