From 2055a078285a98da354f6a4ff2faae72b0a7c323 Mon Sep 17 00:00:00 2001 From: mengxiaolong Date: Fri, 11 Dec 2020 14:07:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BB=B6=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=97=A0=E5=8F=8D=E5=BA=94=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/questions/QuestionsDetail.vue | 84 ++++++++------------ 1 file changed, 35 insertions(+), 49 deletions(-) diff --git a/src/views/ebiz/questions/QuestionsDetail.vue b/src/views/ebiz/questions/QuestionsDetail.vue index 711d31e4e..1035b866d 100644 --- a/src/views/ebiz/questions/QuestionsDetail.vue +++ b/src/views/ebiz/questions/QuestionsDetail.vue @@ -132,6 +132,7 @@ export default { data() { let isWeixin = this.$utils.device().isWeixin return { + uploadIndex: 0, releationType: null, imageList: [], imageResultList: [], @@ -182,14 +183,30 @@ export default { }, methods: { // 补充资料问题件被保人上传身份证照片 - async uploadSupplementImg() { + async uploadSupplementImg(file) { + file.index = this.uploadIndex + this.uploadIndex++ + this.$toast.loading({ + duration: 0 + }) + const res = await this.afterRead(file) + let result = { + rgssUrl: res.path, + imageInfoType: 1, + subBusinessType: '0', + index: this.uploadIndex + } + this.imageResultList.push(result) if (this.isWeixin) { - localStorage.setItem('supplementImages', JSON.stringify(this.imageList)) + localStorage.setItem('imageResultList', JSON.stringify(this.imageResultList)) } }, - deleteSupplementImg() { + deleteSupplementImg(file) { + this.imageResultList = this.imageResultList.filter(result => { + return result.index !== file.index + }) if (this.isWeixin) { - localStorage.setItem('supplementImages', JSON.stringify(this.imageList)) + localStorage.setItem('imageResultList', JSON.stringify(this.imageResultList)) } return true }, @@ -226,6 +243,10 @@ export default { localStorage.setItem('agreementChecked', true) } + if (this.isWeixin && this.issueType === '828601') { + localStorage.setItem('imageResultList', JSON.stringify(this.imageResultList)) + } + // 新契约问题件签名前必须输入回复内容 if (this.issueType === 'TB89') { let reply = this.newContract.feedback.trim() @@ -401,47 +422,6 @@ export default { // 校验补充资料 if (this.issueType === '828601') { if (!this.checkSupplementData()) return this.$toast('请上传补充资料') - this.$toast.loading({ - duration: 0 - }) - this.imageResultList.splice(0) - /** - * 上传补充资料 - * 微信端特殊处理: - * 因为微信端签名会跳转页面, 为了签名回跳回显用户填过的信息, 用户填写过的信息都会被保存在localstorage中 - * 补充资料图片是以base64格式存储, 所以需要转换为file之后再上传 - */ - if (this.isWeixin) { - for (let image of this.imageList) { - let file = this.dataURLtoFile(image.content, '.png') - let res = await this.afterRead({ file: file }) - if (res.result === '0') { - let result = { - rgssUrl: res.path, - imageInfoType: 1, - subBusinessType: '0' - } - this.imageResultList.push(result) - } else { - return this.$toast(res.resultMessage) - } - } - } else { - for (let image of this.imageList) { - let res = await this.afterRead({ file: image.file }) - if (res.result === '0') { - let result = { - rgssUrl: res.path, - imageInfoType: 1, - subBusinessType: '0' - } - this.imageResultList.push(result) - } else { - return this.$toast(res.resultMessage) - } - } - } - this.$toast.clear() } // 转账不成功 if (this.issueType === '818901') { @@ -665,7 +645,7 @@ export default { localStorage.removeItem('problemCard') localStorage.removeItem('problemBankCode') // 补充资料问题件保存数据 - localStorage.removeItem('supplementImages') + localStorage.removeItem('imageResultList') } // localstorage存在投保人签名信息 @@ -721,9 +701,15 @@ export default { { // 微信签名后回显补充资料照片 - if (localStorage.getItem('supplementImages')) { - let images = JSON.parse(localStorage.getItem('supplementImages')) - this.imageList.push(...images) + if (localStorage.getItem('imageResultList')) { + let images = JSON.parse(localStorage.getItem('imageResultList')) + this.imageResultList = images + for (let image of images) { + this.imageList.push({ + url: image.rgssUrl, + index: image.index + }) + } } } } From d1d648feeb979e29d2963d7c1d05b9a63f6eb5a9 Mon Sep 17 00:00:00 2001 From: mengxiaolong Date: Fri, 11 Dec 2020 14:27:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=AB=AF=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ebiz/questions/QuestionsDetail.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/ebiz/questions/QuestionsDetail.vue b/src/views/ebiz/questions/QuestionsDetail.vue index 1035b866d..37a551a90 100644 --- a/src/views/ebiz/questions/QuestionsDetail.vue +++ b/src/views/ebiz/questions/QuestionsDetail.vue @@ -706,7 +706,7 @@ export default { this.imageResultList = images for (let image of images) { this.imageList.push({ - url: image.rgssUrl, + url: config.imgDomain + `/returnImageStream?a=b.jpg&imgPath=${encodeURIComponent(image.rgssUrl)}`, index: image.index }) }