mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-22 04:46:43 +08:00
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:
@@ -271,3 +271,12 @@ export function saveOrderActiveType(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 2.1. 添加客户rid 认证
|
||||
export function saveCustomerRid(data) {
|
||||
return request({
|
||||
url: getUrl('/sale/rid/saveCustomerRid', 1),
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import config from '@/config'
|
||||
import noMoreClick from '@/directive/noMoreClick'
|
||||
import vueHashCalendar from 'vue-hash-calendar'
|
||||
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 cacheUtils from '@/assets/js/utils/cacheUtils'
|
||||
|
||||
|
||||
@@ -248,11 +248,13 @@ import {
|
||||
getAuthCode,
|
||||
autchCodeCheck,
|
||||
getRecognitionUrl,
|
||||
getRecognitionResult
|
||||
getRecognitionResult,
|
||||
saveCustomerRid
|
||||
} from '@/api/ebiz/sale/sale'
|
||||
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'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -332,7 +334,11 @@ export default {
|
||||
changeCard: localStorage.changeCard,
|
||||
salePageFlag: '-10',
|
||||
recognizeResult: '', //微信端-人脸识别结果
|
||||
recognizeMessage: '' //微信端-人脸识别失败原因
|
||||
recognizeMessage: '', //微信端-人脸识别失败原因
|
||||
realPeopleRidInfo: {
|
||||
appntRidFlag: null,
|
||||
insureRidFlag: null
|
||||
}
|
||||
}
|
||||
},
|
||||
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() {
|
||||
//清理计时器
|
||||
@@ -543,6 +580,7 @@ export default {
|
||||
},
|
||||
//提交变更申请
|
||||
async changeSubmit() {
|
||||
let that = this
|
||||
if (null == this.sid) {
|
||||
this.$toast('请先进行发送短信验证码')
|
||||
return
|
||||
@@ -553,8 +591,10 @@ export default {
|
||||
})
|
||||
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 {
|
||||
@@ -566,7 +606,7 @@ export default {
|
||||
this.clearTimer()
|
||||
},
|
||||
// 人脸识别
|
||||
start_ocr(val) {
|
||||
async start_ocr(val) {
|
||||
// val 0投保人 1被保险人 2本人
|
||||
/////
|
||||
console.log(this.isWeixin, 'this.isWeixin')
|
||||
@@ -581,6 +621,16 @@ export default {
|
||||
if (JSON.parse(this.$CacheUtils.getLocItem('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
|
||||
}
|
||||
}
|
||||
// 人脸识别
|
||||
if (this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||
// this.idcardData.typeface = !this.idcardData.typeface
|
||||
// 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') {
|
||||
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
|
||||
}
|
||||
}
|
||||
// 人脸识别
|
||||
if (this.faceAuthCount.insured < this.smsAuthNum) {
|
||||
// this.idcardData.typeface = !this.idcardData.typeface
|
||||
// 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') {
|
||||
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
|
||||
}
|
||||
}
|
||||
if (this.faceAuthCount.appnt < this.smsAuthNum) {
|
||||
// 原人脸识别
|
||||
console.log(this.faceAuthCount, 'faceAuthCount')
|
||||
@@ -632,6 +701,8 @@ export default {
|
||||
name: that.saleInsuredInfo.name //姓名
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
// 保存rid 数据
|
||||
that.saveCustomerRidInfo('appnt_rid', 'B')
|
||||
that.goUrl()
|
||||
} else {
|
||||
that.faceAuthCount.appnt++
|
||||
@@ -653,6 +724,16 @@ export default {
|
||||
if (this.saleInsuredPersonInfo.idType != '1' || this.saleInsuredPersonInfo.age < '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
|
||||
}
|
||||
}
|
||||
// 人脸识别
|
||||
if (this.faceAuthCount.insured < this.smsAuthNum) {
|
||||
// 调原生人脸识别
|
||||
EWebBridge.webCallAppInJs('face_auth', {
|
||||
@@ -661,6 +742,7 @@ export default {
|
||||
name: that.saleInsuredPersonInfo.name //姓名
|
||||
}).then(data => {
|
||||
if (JSON.parse(data).state == '1') {
|
||||
that.saveCustomerRidInfo('insured_rid', 'B')
|
||||
that.insuredUrl()
|
||||
} else {
|
||||
that.faceAuthCount.insured++
|
||||
@@ -960,7 +1042,8 @@ export default {
|
||||
message: '加载中……'
|
||||
})
|
||||
let data = {
|
||||
orderNo: window.localStorage.getItem('orderNo')
|
||||
orderNo: window.localStorage.getItem('orderNo'),
|
||||
getOtherType: 'RID'
|
||||
}
|
||||
localStorage.setItem('riskName', '')
|
||||
return new Promise(resolve => {
|
||||
@@ -1053,6 +1136,9 @@ export default {
|
||||
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
|
||||
console.log('isDoubleMailRisk', that.orderInfo.isDoubleMailRisk)
|
||||
@@ -1197,8 +1283,12 @@ export default {
|
||||
// this.$toast('人脸检测成功')
|
||||
// 1 为被保险人
|
||||
if (window.sessionStorage.shareCode == '1') {
|
||||
// 被保人微信端人脸识别成功
|
||||
this.saveCustomerRidInfo('insured_rid', 'B')
|
||||
this.insuredUrl()
|
||||
} else {
|
||||
// 投保人微信端人脸识别成功
|
||||
this.saveCustomerRidInfo('appnt_rid', 'B')
|
||||
this.goUrl()
|
||||
}
|
||||
} else {
|
||||
@@ -1279,6 +1369,41 @@ export default {
|
||||
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-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() {
|
||||
|
||||
Reference in New Issue
Block a user