This commit is contained in:
Taric Xin
2022-02-16 11:15:38 +08:00
parent 6cea9b6086
commit af9a1c4bf4
2 changed files with 29 additions and 3 deletions

View File

@ -133,7 +133,6 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit {
if (res) {
this.billEvaluateList = res;
console.log(this.billEvaluateList);
}
});
}
@ -420,10 +419,13 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit {
});
}
changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string) {
changeUpload({ file, fileList, type }: any, data: any, key: string, key2: string, id: string) {
if (type === 'success') {
data[key] = file.response.data?.fullFileWatermarkPath;
data[key2] = file.response.data?.fullFilePath;
if (id === 'certificateBackFront' || id === 'certificateBack') {
this.checkIdCard(file.response.data?.fullFilePath, id === 'certificateBackFront' ? 'front' : 'back', 0);
}
}
}
@ -452,4 +454,28 @@ export class UserCenterComponentsDriverDetailComponent implements OnInit {
goBack() {
window.history.go(-1);
}
// 识别身份证 参数isFrontfront-正面、back-背面type0-申请人身份证1-法定代表人身份证
checkIdCard(imgurl: any, isFront: string, type: number) {
const params = {
idCardUrl: imgurl,
side: isFront
};
this.service.request(this.service.$api_ocr_recognize_id_card, params).subscribe(res => {
if (res) {
// 企业管理员证件照
if (type === 0) {
if (isFront === 'front') {
// 正面
if (res.name) {
this.userIdentityDetail.name = res.name;
}
if (res.number) {
this.userIdentityDetail.certificateNumber = res.number;
}
}
}
}
});
}
}