|
|
@@ -885,6 +885,7 @@ export default {
|
|
|
compareFaceData: 0, // 拍照匹配相似度
|
|
|
learning: -1, // 1合格,0不合格
|
|
|
originShowDialog: false,
|
|
|
+ uploadLock: false, //上传图片
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -899,7 +900,6 @@ export default {
|
|
|
},
|
|
|
async onLoad(option) {
|
|
|
this.examType = option.type
|
|
|
- console.log('examType:', this.examType)
|
|
|
this.id = option.id;
|
|
|
this.goodsId = option.goodsid;
|
|
|
this.chapterId = option.chapterId;
|
|
|
@@ -1113,6 +1113,8 @@ export default {
|
|
|
title: "上传接口报错" + error,
|
|
|
icon: "none",
|
|
|
});
|
|
|
+ this.uploadLock = false
|
|
|
+ this.openPhoto()
|
|
|
return;
|
|
|
},
|
|
|
});
|
|
|
@@ -1226,28 +1228,57 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async submitPhoto() {
|
|
|
+ if (this.uploadLock) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.uploadLock = true
|
|
|
+
|
|
|
let compareFaceData = await this.faceRecognition();
|
|
|
this.compareFaceData = compareFaceData
|
|
|
- if (compareFaceData == 0) {
|
|
|
+ // if (compareFaceData == 0) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: "人脸匹配不通过,请重新拍照上传",
|
|
|
+ // icon: "none",
|
|
|
+ // duration: 2000,
|
|
|
+ // });
|
|
|
+
|
|
|
+ // // setTimeout(() => {
|
|
|
+ // // this.uploadLock = false;
|
|
|
+ // // this.openPhoto();
|
|
|
+ // // }, 2000);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+
|
|
|
+ if (compareFaceData >= 80) {
|
|
|
+ const waitYS = await this.imageInfos();
|
|
|
+ this.postStudyRecord(); //提交记录
|
|
|
+ this.photoPopup = false;
|
|
|
+ } else {
|
|
|
uni.showToast({
|
|
|
title: "人脸匹配不通过,请重新拍照上传",
|
|
|
icon: "none",
|
|
|
duration: 2000,
|
|
|
});
|
|
|
|
|
|
- // setTimeout(() => {
|
|
|
- // this.uploadLock = false;
|
|
|
- // this.openPhoto();
|
|
|
- // }, 2000);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (compareFaceData >= 80) {
|
|
|
- const waitYS = await this.imageInfos();
|
|
|
- this.postStudyRecord(); //提交记录
|
|
|
- this.photoPopup = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadLock = false
|
|
|
+ this.openPhoto()
|
|
|
+ }, 2000);
|
|
|
}
|
|
|
},
|
|
|
+ //拍照
|
|
|
+ openPhoto() {
|
|
|
+ // this.enableAutoRotation = false;
|
|
|
+ this.photoPopup = true;
|
|
|
+ this.isTaking = true;
|
|
|
+ uni.setKeepScreenOn({
|
|
|
+ keepScreenOn: true,
|
|
|
+ });
|
|
|
+ uni.authorize({
|
|
|
+ scope: "scope.camera",
|
|
|
+ success() {},
|
|
|
+ });
|
|
|
+ },
|
|
|
//确认拍照
|
|
|
takePhoto() {
|
|
|
var self = this;
|