fix(saleFlowProImprove): 修复投保人信息图片路径处理逻辑

- 修正了证件正反面图片路径的判断条件
- 增加了开发环境与生产环境的路径适配处理
- 完善了 mediaDTOS 数据的初始化与赋值逻辑
- 移除了无效的调试代码注释
- 优化了图片存在状态的判断方式
This commit is contained in:
hz
2025-11-27 10:58:57 +08:00
parent a3826fbd35
commit afa75b9cda
2 changed files with 17 additions and 8 deletions

View File

@@ -1984,7 +1984,7 @@ export default {
const isDev = process.env.NODE_ENV === 'development' const isDev = process.env.NODE_ENV === 'development'
if (!applicantBack || !applicantFront || !applicantBack.rgssUrl || !applicantFront.regssUrl) { if (!applicantBack || !applicantFront || !applicantBack.rgssUrl || !applicantFront.rgssUrl) {
return { frontID: { exist: false }, backID: { exist: false } } return { frontID: { exist: false }, backID: { exist: false } }
} }

View File

@@ -606,7 +606,8 @@ export default {
manageComCode: '', //代理人管理机构 52贵州 45广西 manageComCode: '', //代理人管理机构 52贵州 45广西
areaValue: '', //代理人管理机构--省级编号 areaValue: '', //代理人管理机构--省级编号
renovate: '', //是否展示风险测评 renovate: '', //是否展示风险测评
branchType: '' branchType: '',
mediaDTOS: void 0
} }
}, },
created() { created() {
@@ -756,10 +757,10 @@ export default {
this.specilFlag = '1' this.specilFlag = '1'
} }
// ------------------------专为惠企写死--end---------------// // ------------------------专为惠企写死--end---------------//
this.mediaDTOS = res.orderDTO.mediaDTOS
} else { } else {
return this.$toast(res.resultMessage) return this.$toast(res.resultMessage)
} }
this.mediaDTOS = res.orderDTO.mediaDTOS
}) })
} else { } else {
localStorage.setItem('salePageFlag', this.salePageFlag) localStorage.setItem('salePageFlag', this.salePageFlag)
@@ -2005,7 +2006,6 @@ export default {
} }
}, },
getRelatedData(val, from) { getRelatedData(val, from) {
// debugger
if (this.userInfo.idType != '1' && this.userInfo.idType != '2') { if (this.userInfo.idType != '1' && this.userInfo.idType != '2') {
return return
} }
@@ -2151,17 +2151,26 @@ export default {
if (!Array.isArray(this.mediaDTOS) || !this.mediaDTOS.length) return if (!Array.isArray(this.mediaDTOS) || !this.mediaDTOS.length) return
const applicantImage = this.mediaDTOS.filter(dto => dto.subBusinessType === subBusinessType.insured) const applicantImage = this.mediaDTOS.filter(dto => dto.subBusinessType === subBusinessType.insured)
const [applicantFront, applicantBack] = applicantImage.toSorted((dto1, dto2) => dto1.imageInfoType.localeCompare(dto2.imageInfoType)) const [applicantFront, applicantBack] = applicantImage.toSorted((dto1, dto2) => dto1.imageInfoType.localeCompare(dto2.imageInfoType))
const isDev = process.env.NODE_ENV === 'development'
if (!applicantBack || !applicantFront || !applicantBack.rgssUrl || !applicantFront.rgssUrl) {
return { frontID: { exist: false }, backID: { exist: false } }
}
const base = isDev ? 'https://iagentsales-test2.e-guofu.com/' : ''
const frontRgssUrl = isDev ? base + applicantFront.rgssUrl.replace('/opt/ebiz/static', '') : applicantFront.rgssUrl
const backRgssUrl = isDev ? base + applicantBack.rgssUrl.replace('/opt/ebiz/static', '') : applicantBack.rgssUrl
return { return {
frontID: { frontID: {
exist: this.mediaDTOS ? false : false, exist: !!this.mediaDTOS,
imageBase64: '', imageBase64: '',
imagePath: this.mediaDTOS ? applicantFront.rgssUrl : '' imagePath: this.mediaDTOS ? frontRgssUrl : ''
}, },
backID: { backID: {
exist: this.mediaDTOS ? false : false, exist: !!this.mediaDTOS,
imageBase64: '', imageBase64: '',
imagePath: this.mediaDTOS ? applicantBack.rgssUrl : '' imagePath: this.mediaDTOS ? backRgssUrl : ''
} }
} }
}, },