edit
This commit is contained in:
@ -318,7 +318,7 @@
|
||||
<ng-template #uploadTemplate let-data="data" let-status="status" let-key="key" let-key2="key2" let-hover="hover">
|
||||
<nz-upload class="avatar-uploader" [nzAction]="uploadURl" nzName="multipartFile" nzListType="picture-card"
|
||||
[nzShowUploadList]="false" nzFileType="image/png,image/jpeg,image/jpg,image/gif"
|
||||
[nzDisabled]="!status || disabledUpload" (nzChange)="changeUpload($event,data,key,key2)">
|
||||
[nzDisabled]="!status || disabledUpload" (nzChange)="changeUpload($event,data,key,key2,hover)">
|
||||
<ng-container *ngIf="!data[key] && status">
|
||||
<i class="upload-icon" nz-icon [nzType]="service.http.loading ? 'loading' : 'plus'"></i>
|
||||
<div class="ant-upload-text">上传</div>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
// 识别身份证 参数isFront:front-正面、back-背面;type:0-申请人身份证,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user