task#13627,识别身份证反面,将签发机关和有效期限保存传输
This commit is contained in:
@ -138,6 +138,7 @@ import {myMixins} from "@/utils/myMixins"
|
||||
import {saveDriver, uploadImage, ocrHandler} from "@/api/mine"
|
||||
import TwoCommonBtn from "@/components/twoBtnCommon.vue"
|
||||
import CellGroup from "@/components/cellGroup.vue"
|
||||
import {formatDate} from "@/utils/common"
|
||||
export default {
|
||||
name: "driverAdd",
|
||||
mixins:[myMixins],
|
||||
@ -165,6 +166,9 @@ export default {
|
||||
iconList: [],
|
||||
driverInfo: {},
|
||||
drivingLicenceName: '',
|
||||
idCardAuthority:'',
|
||||
idCardValidStartTime:'',
|
||||
idCardValidEndTime:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -223,6 +227,8 @@ export default {
|
||||
formData.append("file" , file.file);
|
||||
let res = await uploadImage(formData)
|
||||
this.identityCardContrary = res.data;
|
||||
await this.idCardBackOcrHandler();
|
||||
console.log("this.identityCardContrary",this.identityCardContrary)
|
||||
},
|
||||
async drivingLicenceFrontHandler(file) { // 上传驾驶证主页
|
||||
const formData = new FormData();
|
||||
@ -257,6 +263,21 @@ export default {
|
||||
this.$toast('身份证信息与驾驶证信息不匹配')
|
||||
}
|
||||
},
|
||||
async idCardBackOcrHandler() { // 身份证反面 ocr识别
|
||||
let res = await ocrHandler({
|
||||
ocrType: 1,
|
||||
imageUrl: this.identityCardContrary,
|
||||
cardSide: 'BACK'
|
||||
});
|
||||
this.idCardAuthority=res.data.authority
|
||||
let date=res.data.validDate.split('-')
|
||||
this.idCardValidStartTime=formatDate(date[0]) +' '+ '00:00:00';
|
||||
if(date[1] == '长期'){
|
||||
this.idCardValidEndTime='2099-12-12' +' '+ '00:00:00';
|
||||
}else{
|
||||
this.idCardValidEndTime=formatDate(date[1]) +' '+ '00:00:00';
|
||||
}
|
||||
},
|
||||
async drivingLicenceOcrHandler() { // 驾驶证正面 ocr识别
|
||||
this.driverInfo.drivingLicenceValidityDate = '';
|
||||
this.driverInfo.drivingBeginDate = '';
|
||||
@ -328,6 +349,9 @@ export default {
|
||||
drivingLicenceContrary: this.drivingLicenceContrary,
|
||||
icon: this.icon,
|
||||
drivingLicenceName: this.drivingLicenceName,
|
||||
idCardAuthority:this.idCardAuthority,
|
||||
idCardValidStartTime:this.idCardValidStartTime,
|
||||
idCardValidEndTime:this.idCardValidEndTime,
|
||||
...this.driverInfo
|
||||
})
|
||||
if(this.id){
|
||||
|
Reference in New Issue
Block a user