Commit 8078359a authored by 李晓兵's avatar 李晓兵

'合同签约银行卡识别'

parent 86606b37
......@@ -19,10 +19,10 @@
<div class="info-header">
<p>请上传银行卡照片</p>
<div v-if="!bankImg" class="bank-pic">
<img src="@/assets/constractSigning/bank.png" alt="" @click="ocrShow('bankCard', '')">
<img src="@/assets/constractSigning/bank.png" alt="" @click="ocrShow()">
</div>
<div v-if="bankImg" class="bank-pic2">
<img :src="bankImg" alt="" @click="ocrShow('bankCard', '')">
<img :src="bankImg" alt="" @click="ocrShow()">
</div>
</div>
<list-item :item-height="44" class="info-center">
......@@ -100,21 +100,21 @@ export default {
},
methods: {
// ocr识别入口
ocrShow (ocrType, type) {
ocrShow () {
let vm = this
hlsPopup.showActionSheet({
titleText: '请选择照片',
buttonArray: ['拍照', '从相册取'],
callback: index => {
if (index === 0) {
vm.openCamera(ocrType, type)
vm.openCamera()
} else {
vm.takePicture(ocrType, type)
vm.takePicture()
}
},
})
},
openCamera (ocrType, type) {
openCamera () {
let vm = this
let cameraoptions = {
quality: 60,
......@@ -125,18 +125,16 @@ export default {
if (!imgdata) {
hlsPopup.showLongCenter('请拍照')
} else {
if (ocrType === 'bankCard') {
vm.bankImg = imgdata
vm.bankCardIdentify(imgdata)
}
}
}
let error = function () {
hlsPopup.showLongCenter(error)
}
hlsUtil.openCamera(cameraoptions, success, error)
},
takePicture (ocrType, type) {
takePicture () {
let vm = this
var cameraoptions = {
quality: 70,
......@@ -148,12 +146,10 @@ export default {
if (imgUrl.length === 0) {
hlsPopup.showLongCenter('请选择一张图片')
} else {
if (ocrType === 'bankCard') {
vm.bankImg = imgUrl[0]
vm.bankCardIdentify(imgUrl[0])
}
}
}
let error = function () {
hlsPopup.showLongCenter(error)
}
......
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