Commit 94676e95 authored by 李晓兵's avatar 李晓兵

'身份证修改'

parent 41e5d6a4
...@@ -100,38 +100,38 @@ ...@@ -100,38 +100,38 @@
> >
</item> </item>
<item> <item>
<div slot="name" class="required">身份证有效期从</div> <div slot="name" class="required">户籍地址</div>
<input <textarea
slot="content" slot="content"
v-model="baseInfo.id_card_date_from" ref="myTestarea"
v-model="baseInfo.address_on_resident_booklit"
readonly readonly
cols="30"
rows="1"
placeholder="上传身份证自动填充" placeholder="上传身份证自动填充"
class="auto" class="auto"
> @input="addRows(baseInfo.address_on_resident_booklit)"
/>
</item> </item>
<item> <item>
<div slot="name" class="required">身份证有效期</div> <div slot="name" class="required">身份证有效期</div>
<input <input
slot="content" slot="content"
v-model="baseInfo.id_card_date_to" v-model="baseInfo.id_card_date_from"
readonly readonly
placeholder="上传身份证自动填充" placeholder="上传身份证自动填充"
class="auto" class="auto"
> >
</item> </item>
<item> <item>
<div slot="name" class="required">户籍地址</div> <div slot="name" class="required">身份证有效期到</div>
<textarea <input
slot="content" slot="content"
ref="myTestarea" v-model="baseInfo.id_card_date_to"
v-model="baseInfo.address_on_resident_booklit"
readonly readonly
cols="30"
rows="1"
placeholder="上传身份证自动填充" placeholder="上传身份证自动填充"
class="auto" class="auto"
@input="addRows(baseInfo.address_on_resident_booklit)" >
/>
</item> </item>
<item> <item>
<div slot="name" class="required">手机号码</div> <div slot="name" class="required">手机号码</div>
...@@ -597,16 +597,16 @@ export default { ...@@ -597,16 +597,16 @@ export default {
}) })
switch (cdd_item) { switch (cdd_item) {
case 'NP_ID_CARD_F': // 承租人身份证正面 case 'NP_ID_CARD_F': // 承租人身份证正面
vm.idCardFront = item.url vm.idCardFront = res.lists[0].url
break break
case 'NP_ID_CARD_B': // 承租人身份证背面 case 'NP_ID_CARD_B': // 承租人身份证背面
vm.idCardBack = item.url vm.idCardBack = res.lists[0].url
break break
case 'MATE_ID_CARD_F': // 配偶身份证正面 case 'MATE_ID_CARD_F': // 配偶身份证正面
vm.idCardFrontSp = item.url vm.idCardFrontSp = res.lists[0].url
break break
case 'MATE_ID_CARD_B': // 配偶身份证背面 case 'MATE_ID_CARD_B': // 配偶身份证背面
vm.idCardBackSp = item.url vm.idCardBackSp = res.lists[0].url
break break
default: default:
vm.dowload_list.push(res.lists) vm.dowload_list.push(res.lists)
...@@ -999,11 +999,9 @@ export default { ...@@ -999,11 +999,9 @@ export default {
hlsPopup.showLongCenter('请拍照') hlsPopup.showLongCenter('请拍照')
} else { } else {
if (ocrType === 'idCard') { if (ocrType === 'idCard') {
// vm.idCardEditFlag = true // 身份证图片状态已修改 type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata, 'idCard'), vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgdata, vm.idCardBackIdentify(imgdata, 'idCard'), vm.idCardBackEditFlag = true)
type === 'front' ? (vm.idCardFront = imgdata, vm.idCardIdentify(imgdata,'idCard'),vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgdata,vm.idCardBackIdentify(imgdata,'idCard'),vm.idCardBackEditFlag = true)
} else if (ocrType === 'idCardSp') { // 配偶身份证识别 } else if (ocrType === 'idCardSp') { // 配偶身份证识别
vm.idCardSpEditFlag = true // 身份证图片状态已修改 type === 'front' ? (vm.idCardFrontSp = imgdata, vm.idCardIdentify(imgdata, 'idCardSp'), vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgdata, vm.idCardBackIdentify(imgdata, 'idCardSp'), vm.idCardBackSpEditFlag = true)
type === 'front' ? (vm.idCardFrontSp = imgdata, vm.idCardIdentify(imgdata,'idCardSp'),vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgdata,vm.idCardBackIdentify(imgdata,'idCardSp'),vm.idCardBackSpEditFlag = true)
} else if (ocrType === 'bankCard') { } else if (ocrType === 'bankCard') {
vm.bankImg = imgdata vm.bankImg = imgdata
vm.bankCardIdentify(imgdata) vm.bankCardIdentify(imgdata)
...@@ -1028,11 +1026,9 @@ export default { ...@@ -1028,11 +1026,9 @@ export default {
hlsPopup.showLongCenter('请选择一张图片') hlsPopup.showLongCenter('请选择一张图片')
} else { } else {
if (ocrType === 'idCard') { if (ocrType === 'idCard') {
vm.idCardEditFlag = true // 身份证图片状态已修改 type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0], 'idCard'), vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgUrl[0], vm.idCardBackIdentify(imgUrl[0], 'idCard'), vm.idCardBackEditFlag = true)
type === 'front' ? (vm.idCardFront = imgUrl[0], vm.idCardIdentify(imgUrl[0],'idCard'),vm.idCardFrontEditFlag = true) : (vm.idCardBack = imgUrl[0],vm.idCardBackIdentify(imgUrl[0],'idCard'),vm.idCardBackEditFlag = true) } else if (ocrType === 'idCardSp') { // 配偶身份证识别
}else if (ocrType === 'idCardSp') { // 配偶身份证识别 type === 'front' ? (vm.idCardFrontSp = imgUrl[0], vm.idCardIdentify(imgUrl[0], 'idCardSp'), vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgUrl[0], vm.idCardBackIdentify(imgUrl[0], 'idCardSp'), vm.idCardBackSpEditFlag = true)
vm.idCardSpEditFlag = true // 身份证图片状态已修改
type === 'front' ? (vm.idCardFrontSp = imgUrl[0], vm.idCardIdentify(imgUrl[0],'idCardSp'),vm.idCardFrontSpEditFlag = true) : (vm.idCardBackSp = imgUrl[0],vm.idCardBackIdentify(imgUrl[0],'idCardSp'),vm.idCardBackSpEditFlag = true)
} else if (ocrType === 'bankCard') { } else if (ocrType === 'bankCard') {
vm.bankImg = imgUrl[0] vm.bankImg = imgUrl[0]
vm.bankCardIdentify(imgUrl[0]) vm.bankCardIdentify(imgUrl[0])
...@@ -1045,40 +1041,40 @@ export default { ...@@ -1045,40 +1041,40 @@ export default {
vm.hlsUtil.takePicture(cameraoptions, success, error) vm.hlsUtil.takePicture(cameraoptions, success, error)
}, },
// 身份证识别 // 身份证识别
idCardIdentify (fileUrl,cardType) { idCardIdentify (fileUrl, cardType) {
let vm = this let vm = this
hlsPopup.showLoading('正在识别') hlsPopup.showLoading('正在识别')
let url = process.env.ocrPath + '/baidu/ocr/idCard' let url = process.env.ocrPath + '/baidu/ocr/idCard'
hlsUtil.baiduOcr(fileUrl, url, function (res) { hlsUtil.baiduOcr(fileUrl, url, function (res) {
hlsPopup.hideLoading() hlsPopup.hideLoading()
let result = res.result.words_result let result = res.result.words_result
if(cardType === 'idCard'){ if (cardType === 'idCard') {
vm.baseInfo.bp_name = result.姓名.words vm.baseInfo.bp_name = result.姓名.words
vm.baseInfo.id_card_no = result.公民身份号码.words vm.baseInfo.id_card_no = result.公民身份号码.words
vm.baseInfo.address_on_resident_booklit = result.住址.words vm.baseInfo.address_on_resident_booklit = result.住址.words
}else{ } else {
vm.baseInfo.bp_name_sp = result.姓名.words vm.baseInfo.bp_name_sp = result.姓名.words
vm.baseInfo.id_card_no_sp = result.公民身份号码.words vm.baseInfo.id_card_no_sp = result.公民身份号码.words
} }
}) })
}, },
// 身份证背面识别 // 身份证背面识别
idCardBackIdentify (fileUrl,cardType) { idCardBackIdentify (fileUrl, cardType) {
let vm = this let vm = this
hlsPopup.showLoading('正在识别') hlsPopup.showLoading('正在识别')
let url = process.env.ocrPath + '/baidu/ocr/idCardBack' let url = process.env.ocrPath + '/baidu/ocr/idCardBack'
hlsUtil.baiduOcr(fileUrl, url, function (res) { hlsUtil.baiduOcr(fileUrl, url, function (res) {
hlsPopup.hideLoading() hlsPopup.hideLoading()
let result = res.result.words_result let result = res.result.words_result
if(cardType === 'idCard'){ if (cardType === 'idCard') {
vm.baseInfo.id_card_date_from = result.签发日期.words vm.baseInfo.id_card_date_from = result.签发日期.words
vm.baseInfo.id_card_date_to = result.失效日期.words vm.baseInfo.id_card_date_to = result.失效日期.words
}else{ } else {
vm.baseInfo.id_card_date_from_sp = result.签发日期.words vm.baseInfo.id_card_date_from_sp = result.签发日期.words
vm.baseInfo.id_card_date_to_sp = result.失效日期.words vm.baseInfo.id_card_date_to_sp = result.失效日期.words
} }
}) })
}, },
// 银行卡识别 // 银行卡识别
bankCardIdentify (fileUrl) { bankCardIdentify (fileUrl) {
let vm = this let vm = this
......
This diff is collapsed.
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