|
@@ -170,6 +170,15 @@
|
|
|
<u-upload
|
|
|
:show-progress="false"
|
|
|
:max-size="2097152"
|
|
|
+ :ref="
|
|
|
+ item.fieldKey === 'recent_photos'
|
|
|
+ ? 'recent_photos'
|
|
|
+ : item.fieldKey === 'idcard_face_photo'
|
|
|
+ ? 'idcard_face_photo'
|
|
|
+ : item.fieldKey === 'idcard_national_photo'
|
|
|
+ ? 'idcard_national_photo'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
@on-list-change="
|
|
|
item.fieldKey === 'recent_photos'
|
|
|
? changePhotoListHeader1($event)
|
|
@@ -302,6 +311,7 @@ import Handwriting from '@/common/signature.js';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ gradeId:0,
|
|
|
errorType: ['message'],
|
|
|
agreementModal:true,
|
|
|
goodsData:{},
|
|
@@ -509,6 +519,7 @@ export default {
|
|
|
async onLoad(option) {
|
|
|
this.orderGoodsId = Number(option.orderGoodsId)
|
|
|
this.goodsId = Number(option.id);
|
|
|
+ this.gradeId = Number(option.gradeId)
|
|
|
await this.getGoodsDetail()
|
|
|
this.getInfo();
|
|
|
},
|
|
@@ -742,6 +753,32 @@ export default {
|
|
|
this.openVerify = true;
|
|
|
this.resultForm(1);
|
|
|
},
|
|
|
+ faceCertificationIDCardOCR(cardSide,url) {
|
|
|
+ return new Promise(resolve => {
|
|
|
+ let fileSystem = uni.getFileSystemManager();
|
|
|
+ fileSystem.readFile({
|
|
|
+ filePath: url,
|
|
|
+ encoding: 'base64',
|
|
|
+ position: 0,
|
|
|
+ success:(res) => {
|
|
|
+ console.log(res)
|
|
|
+ let base64 = 'data:image/jpg;base64,' + res.data;
|
|
|
+ console.log(base64)
|
|
|
+ this.$api.faceCertificationIDCardOCR({
|
|
|
+ cardSide:cardSide, //1人像 2 国徽
|
|
|
+ cardImageBase64:base64,
|
|
|
+ gradeId:this.gradeId
|
|
|
+ }).then(res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.error(err,'err')
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
async changePhotoListHeader1(lists, name) {
|
|
|
console.log(lists)
|
|
|
if (lists.length) {
|
|
@@ -761,12 +798,24 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async changePhotoListHeader2(lists, name) {
|
|
|
- console.log(lists)
|
|
|
if (lists.length) {
|
|
|
this.fileList2 = lists;
|
|
|
- console.log(lists,'lists2')
|
|
|
if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
|
|
|
- this.$set(this.form, 'idcard_face_photo', await this.$method.imageInfos(lists[0].url));
|
|
|
+ let url = lists[0].url
|
|
|
+ this.$refs.idcard_face_photo[0].remove(0)
|
|
|
+ let res = await this.faceCertificationIDCardOCR(1,url);
|
|
|
+
|
|
|
+ if(res.data.code == 500) {
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title:'请上传正确清晰的身份证人像面照片'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.idcard_face_photo[0].lists = [{
|
|
|
+ url:this.$method.splitImgHost(res.data.data.IdImgPath)
|
|
|
+ }];
|
|
|
+ this.$set(this.form, 'idcard_face_photo', res.data.data.IdImgPath,1000);
|
|
|
}
|
|
|
} else {
|
|
|
this.fileList2 = [];
|
|
@@ -777,12 +826,24 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async changePhotoListHeader3(lists, name) {
|
|
|
- console.log(lists)
|
|
|
if (lists.length) {
|
|
|
this.fileList3 = lists;
|
|
|
- console.log(lists,'lists3')
|
|
|
if (lists[0].url.indexOf('//tmp') !== -1 || lists[0].url.indexOf('//temp') !== -1) {
|
|
|
- this.$set(this.form, 'idcard_national_photo', await this.$method.imageInfos(lists[0].url));
|
|
|
+ console.log('//tem')
|
|
|
+ let url = lists[0].url
|
|
|
+ this.$refs.idcard_national_photo[0].remove(0)
|
|
|
+ let res = await this.faceCertificationIDCardOCR(2,url);
|
|
|
+ if(res.data.code == 500) {
|
|
|
+ uni.showToast({
|
|
|
+ icon:'none',
|
|
|
+ title:'请上传正确清晰的身份证国徽面照片'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.idcard_national_photo[0].lists = [{
|
|
|
+ url:this.$method.splitImgHost(res.data.data.IdImgPath)
|
|
|
+ }];
|
|
|
+ this.$set(this.form, 'idcard_national_photo', this.$method.splitImgHost(res.data.data.IdImgPath,1000));
|
|
|
}
|
|
|
} else {
|
|
|
this.fileList3 = [];
|