修改上传图片分类, 优化接口报错处理

This commit is contained in:
mengxiaolong
2020-08-07 18:08:32 +08:00
parent 7b9915c12f
commit e90dc72a15
2 changed files with 68 additions and 30 deletions

View File

@@ -14,7 +14,10 @@
{{ supplement.descriptionInsurant }}
</p>
</div>
<van-uploader :after-read="insurantUpload" name="id" v-model="supplement.idImgList" />
<p class="uploadTitle">身份证正面照片</p>
<van-uploader :max-count="1" :after-read="insurantUpload" name="insurantIdCardA" v-model="supplement.insurantIdCardA" />
<p class="uploadTitle">身份证背面照片</p>
<van-uploader :max-count="1" :after-read="insurantUpload" name="insurantIdCardB" v-model="supplement.insurantIdCardB" />
</div>
</div>
<div class="updateInfo">
@@ -26,7 +29,12 @@
{{ supplement.descriptionPolicyholder }}
</p>
</div>
<van-uploader :after-read="policyHolderUpload" name="copy" v-model="supplement.copyImgList" />
<p class="uploadTitle">身份证正面照片</p>
<van-uploader :max-count="1" :after-read="policyHolderUpload" name="policyholderIdCardA" v-model="supplement.policyholderIdCardA" />
<p class="uploadTitle">身份证背面照片</p>
<van-uploader :max-count="1" :after-read="policyHolderUpload" name="policyholderIdCardB" v-model="supplement.policyholderIdCardB" />
<p class="uploadTitle">银行卡照片</p>
<van-uploader :max-count="1" :after-read="policyHolderUpload" name="policyholderBankCardA" v-model="supplement.policyholderBankCardA" />
</div>
</div>
</div>
@@ -145,10 +153,13 @@ export default {
// 投保人问题描述
descriptionPolicyholder: '',
// 被保人身份证明
idImgList: [],
insurantIdCardA: [],
insurantIdCardB: [],
insurantUploadResult: [],
// 投保人身份证明等资料
copyImgList: [],
policyholderIdCardA: [],
policyholderIdCardB: [],
policyholderBankCardA: [],
policyholderUploadResult: []
},
newContract: {
@@ -192,19 +203,29 @@ export default {
}
},
methods: {
async policyHolderUpload(file) {
async policyHolderUpload(file, detail) {
// 微信端将上传的图片保存到localstorage中供签名回调使用
if (this.isWeixin) {
localStorage.setItem(detail.name, file.content)
}
let res = await this.afterRead(file)
this.supplement.policyholderUploadResult.push({
rgssUrl: res.path
})
},
async insurantUpload(file) {
async insurantUpload(file, detail) {
if (this.isWeixin) {
localStorage.setItem(detail.name, file.content)
}
let res = await this.afterRead(file)
this.supplement.insurantUploadResult.push({
rgssUrl: res.path
})
},
async cardUpload(file) {
async cardUpload(file, detail) {
if (this.isWeixin) {
localStorage.setItem(detail.name, file.content)
}
let res = await this.afterRead(file)
this.transfer.cardUploadResult.push({
rgssUrl: res.path
@@ -522,6 +543,11 @@ export default {
}
</script>
<style lang="scss" scoped>
.uploadTitle {
font-size: 14px;
margin-bottom: 0.5em;
}
.bottom-btn {
z-index: 1;
}
@@ -620,7 +646,6 @@ export default {
}
p {
line-height: 22px;
padding-bottom: 7px;
}
}
}

View File

@@ -119,7 +119,7 @@ export default {
data() {
return {
active: 0,
pendingListLoading: false,
pendingListLoading: true,
processedListLoading: false,
pendingListFinished: false,
processedListFinished: false,
@@ -149,6 +149,7 @@ export default {
this.searchValue = ''
},
async loadMore() {
try {
const rs = await getQuestionList({
type: this.active,
pageInfo: {
@@ -162,9 +163,15 @@ export default {
if (this.active === 0) {
this.pendingListLoading = false
this.pendingList.push(...rs.content.list)
this.pendingList.sort((prev, next) => {
return -(new Date(prev.createdTime).getTime() - new Date(next.createdTime).getTime())
})
} else {
this.processedListLoading = false
this.processedList.push(...rs.content.list)
this.processedList.sort((prev, next) => {
return -(new Date(prev.createdTime).getTime() - new Date(next.createdTime).getTime())
})
}
if (rs.content.pageNum >= rs.content.pages && this.active === 0) {
this.pendingListFinished = true
@@ -177,6 +184,12 @@ export default {
this.pendingListLoading = false
this.processedListLoading = false
}
} catch (reson) {
this.pendingListLoading = false
this.pendingListFinished = true
this.processedListLoading = false
this.processedListFinished = true
}
},
changeProblemList() {
this.currentPage = 1