mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 15:06:45 +08:00
feat(ebiz): 优化身份认证影像上传校验逻辑
- 新增 validateRoleImage 方法用于校验角色相关影像是否完整 - 调整注册子任务逻辑,区分本地上传和云端图片校验场景 - 在上传图片时设置 updateImage 标志位以触发列表检测 - 完善受益人信息处理流程,确保 bnfId 正确赋值 - 修复部分条件下未正确返回校验结果的问题
This commit is contained in:
@@ -141,22 +141,40 @@ export default {
|
||||
},
|
||||
inject: ['nextStepProcesserContainer'],
|
||||
methods: {
|
||||
validateRoleImage(orderDetail) {
|
||||
if (orderDetail.result !== '0') return false
|
||||
const { orderDTO } = orderDetail
|
||||
const { mediaDTOS } = orderDTO
|
||||
return Array.isArray(mediaDTOS) && mediaDTOS.filter(item => item.subBusinessType === this.role).length === 2
|
||||
},
|
||||
registerSubTask() {
|
||||
if (!this.subTask) return
|
||||
this.nextStepProcesserContainer.registerPreTask(this.subTask, async () => {
|
||||
if (this.list.length <= 2) {
|
||||
setTimeout(() => this.$toast('请补充完整影像信息'), 600)
|
||||
return false
|
||||
const result = getOrderDetail({ orderNo: this.$route.query.orderNo })
|
||||
|
||||
// 如果触发上传图片行为, 就开始进行列表检测
|
||||
if (this.updateImage) {
|
||||
if (this.list.length <= 2) {
|
||||
setTimeout(() => this.$toast('请补充完整影像信息'), 600)
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
// 如果没有上传图片,对云端图片进行检测
|
||||
if (!this.validateRoleImage(result)) {
|
||||
setTimeout(() => this.$toast('请补充完整影像信息'), 600)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// 针对 受益人进行特殊的处理, 下一步前的前置处理
|
||||
if (this.role === this.user.beneficiary) {
|
||||
const result = getOrderDetail({ orderNo: this.$route.query.orderNo })
|
||||
if (result.result !== '0') return
|
||||
if (result.result !== '0') return false
|
||||
const idNo = this.userInfo['idNo']
|
||||
const beneficiaries = result.orderDTO.insuredDTOs[0].bnfDTOs
|
||||
if (!Array.isArray(beneficiaries)) return
|
||||
if (!Array.isArray(beneficiaries)) return false
|
||||
|
||||
const beneficiary = beneficiaries.find(beneficiary => beneficiary.idNo === idNo)
|
||||
// 通过 idNo 获取对应的 idNo 受益人, 然后获取 bnfId , 对照片参数补充完整
|
||||
this.list.forEach(item => {
|
||||
item.subBusinessNo = beneficiary.bnfId
|
||||
})
|
||||
@@ -179,7 +197,8 @@ export default {
|
||||
})
|
||||
|
||||
const result = JSON.parse(data)
|
||||
|
||||
// 检测图片上传的 single, 跟下一步处理有相关内容
|
||||
this.updateImage = true
|
||||
if (result.code === '1') {
|
||||
if (isFront) {
|
||||
this.handleFrontScanResult(result.content)
|
||||
|
||||
Reference in New Issue
Block a user