Commit 328a7445 authored by 李晓兵's avatar 李晓兵

'法人身份证上传'

parent f178653a
......@@ -53,6 +53,9 @@
<div v-if="idCardFront && !isApproved" @click="ocrShow('idCard', 'front')">
<img :src="idCardFront" style="width: 100%;height: 100%;margin: 0" >
</div>
<div v-if="idCardFront && isApproved">
<img :src="idCardFront" style="width: 100%;height: 100%;margin: 0" @click="showBigPicture(idCardFront)">
</div>
<div v-if="!idCardBack" @click="ocrShow('idCard', 'back')">
<img src="@/assets/userBind/back.png" >
<p>反面</p>
......@@ -60,6 +63,9 @@
<div v-if="idCardBack && !isApproved" @click="ocrShow('idCard', 'back')">
<img :src="idCardBack" style="width: 100%;height: 100%;margin: 0" >
</div>
<div v-if="idCardBack && isApproved">
<img :src="idCardBack" style="width: 100%;height: 100%;margin: 0" @click="showBigPicture(idCardBack)">
</div>
</div>
</div>
<list-item :item-height="44" class="second-part">
......@@ -199,15 +205,15 @@
<div class="img-content">
<!--待上传图片列表-->
<div v-for="(item, index) in upload_list" v-if="item.check_id==list.check_id" :key="index" class="card-upload">
<img :src="item.picture" >
<div class="close" @click="delete_pic(item.attachment_id)">
<img :src="item.picture" @click="showBigPicture(item.picture)">
<div class="close" @click="remove_pic(item.attachment_id,index)">
<img src="@/assets/userBind/deleteIcon.png">
</div>
</div>
<!--从服务器上下载的图片-->
<div v-for="item in dowload_list">
<div v-for="(pic, index) in item" v-if="pic.check_id==list.check_id" :key="index" class="card-upload">
<img :src="pic.url" >
<img :src="pic.url" @click="showBigPicture(pic.url)">
<div class="close" @click="delete_pic(pic.attachment_id)">
<img src="@/assets/userBind/deleteIcon.png">
</div>
......@@ -368,9 +374,7 @@ export default {
bankImg: '', // 银行卡图片
cddItemList: [], // 资料清单列表
idCardCheck_id: '', // 身份证check_id
bankCardCheck_id: '', // 银行卡check_id
idCardImgList: [], // 存身份证图片列表
bankCardImgList: [], // 存上传银行卡图片列表
idCardEditFlag: false, // 身份证修改标识,为true则标识已修改,后续需要重新上传此照片
}
},
......@@ -454,7 +458,7 @@ export default {
}
})
},
load_picture (check_id, index) {
load_picture (check_id, index, cdd_item) {
let vm = this
let url = process.env.basePath + 'attachment_list_query' + '&index' + index // 附件查询
let param = {
......@@ -467,7 +471,14 @@ export default {
res.lists.forEach(item => {
item['url'] = process.env.filePath + 'attachment_id=' + item.attachment_id + '&access_token=' + window.localStorage.access_token
})
vm.dowload_list.push(res.lists)
switch (cdd_item) {
case 'NP_ID_CARD':
vm.idCardBack = res.lists[0].url
vm.idCardFront = res.lists[1].url
break
default:
vm.dowload_list.push(res.lists)
}
} else {
hlsPopup.showLongCenter(res.message)
}
......@@ -502,16 +513,13 @@ export default {
case 'NP_ID_CARD':
vm.idCardCheck_id = item.check_id
break
case 'BANK_CARD':
vm.bankCardCheck_id = item.check_id
break
default:
vm.cddItemList.push(item)
}
})
// 查询图片
listTemp.forEach((item, index) => {
vm.load_picture(item.check_id, index)
vm.load_picture(item.check_id, index, item.cdd_item)
})
if (vm.idCardEditFlag) { // 身份证图片已修改,重新上传
var list = []
......@@ -706,40 +714,67 @@ export default {
hlsPopup.hideLoading()
}
},
// 删除图片
delete_pic (attachment_id) {
hlsPopup.showLongCenter('接口还没写')
/* let vm = this
let url = process.env.basePath + 'attachment_list_query'
// 移除图片
remove_pic (attachment_id, index) {
let vm = this
var delete_list = []
let obj = {'attachment_id': attachment_id}
delete_list.push(obj)
let url = process.env.basePath + 'app_delete_attment' // 附件删除
let param = {
attachment_id: attachment_id,
'picturelist': delete_list,
}
hlsPopup.showLoading('请稍候')
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
vm.hlsHttp.post(url, param).then(function (res) {
hlsPopup.hideLoading()
if (res.result === 'S') {
} else {
hlsPopup.showLongCenter(res.message)
hlsPopup.showLongCenter('删除成功!')
vm.remove_upload_list(attachment_id, index)
} else if (res.result === 'E') {
hlsPopup.showShortCenter(res.message)
}
}) */
})
},
/* uploadIdCardFront () {
remove_upload_list (attachment_id, index) {
let vm = this
let url = process.env.basePath + 'attachment_upload'
vm.upload_list.remove(index)
vm.upload_list.sort()
},
// 删除图片
delete_pic (attachment_id) {
let vm = this
var delete_list = []
let obj = {'attachment_id': attachment_id}
delete_list.push(obj)
let url = process.env.basePath + 'app_delete_attment' // 附件删除
let param = {
file_path: this.upload_list[0].filePath,
source_type: '',
pkvalue: window.localStorage.getItem('user_id'),
user_id: window.localStorage.getItem('user_id'),
'picturelist': delete_list,
}
hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
hlsPopup.hideLoading()
if (res.result === 'S') {
console.log(res.response.attachment_id)
hlsPopup.showLongCenter('删除成功!')
vm.remove_dowload_list(attachment_id)
} else if (res.result === 'E') {
hlsPopup.showShortCenter(res.message)
}
})
}, */
},
remove_dowload_list (attachment_id) {
let vm = this
for (let i = 0; i < vm.dowload_list.length; i++) {
let list = vm.dowload_list[i]
for (let j = 0; j < list.length; j++) {
let li = list[j]
if (parseFloat(li.attachment_id) === parseFloat(attachment_id)) {
list.remove(j)
break
}
}
}
vm.dowload_list.sort()
},
ocrShow (ocrType, type) {
let vm = this
hlsPopup.showActionSheet({
......@@ -1178,6 +1213,13 @@ export default {
}
})
},
// 查看大图
showBigPicture (pic) {
let vm = this
vm.hlsPopup.showBigPicture({
imgUrl: pic,
})
},
},
}
</script>
......
This diff is collapsed.
......@@ -17,6 +17,23 @@ export default {
isLoading: false,
SHOW_TIMES: 2000,
IS_SHOW_MASK: true,
/**
* 移除数组的某个元素
* @param dx 下标
* @returns {boolean}
*/
remove: function (dx) {
debugger
if (isNaN(dx) || dx > this.length) {
return false
}
for (var i = 0, n = 0; i < this.length; i++) {
if (this[i] != this[dx]) {
this[n++] = this[i]
}
}
this.length -= 1
},
/**
* 锁屏函数 超过10s后自动解屏用于防止屏幕锁死
* 自动截屏成弹出错误提示框
......@@ -249,12 +266,11 @@ export default {
ShowPicturePlugin.show({
imgUrl: imgObject.imgUrl,
width: imgObject.width,
imgList: imgObject.imgList,
startPosition: imgObject.startPosition,
})
}
},
/**
* 下拉框 支持级联操作 需指定 parent 属性
* @param selectOption.list Array [{"code": "NP","code_name": "个人"}]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment