|
@@ -1529,6 +1529,7 @@ export default {
|
|
|
ossAvatarUrl: "", //照片地址
|
|
|
nowTime: 0,
|
|
|
faceUrl: "",
|
|
|
+ loading: null,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -1545,20 +1546,15 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async takeOk() {
|
|
|
+ this.loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: "上传中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(0, 0, 0, 0.1)",
|
|
|
+ target: document.querySelector(".section__body"),
|
|
|
+ });
|
|
|
let compareFaceData = await this.faceRecognition();
|
|
|
|
|
|
- if (compareFaceData == 0) {
|
|
|
- this.$message({
|
|
|
- type: "warning",
|
|
|
- message: "人脸匹配不通过,请重新拍照上传",
|
|
|
- });
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- this.reTake();
|
|
|
- }, 2000);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
if (compareFaceData >= 80) {
|
|
|
const waitYS = await this.imageInfos();
|
|
|
this.postCoursePhotoRecord()
|
|
@@ -1567,13 +1563,20 @@ export default {
|
|
|
this.postStudyRecord(); //提交记录
|
|
|
//恢复播放
|
|
|
|
|
|
+ this.loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "拍照成功",
|
|
|
+ });
|
|
|
this.takePhotoModal = false;
|
|
|
+ this.isTaking = false;
|
|
|
var polyvPlayerContext = this.player;
|
|
|
if (polyvPlayerContext) {
|
|
|
polyvPlayerContext.j2s_resumeVideo();
|
|
|
}
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
+ this.loading.close();
|
|
|
console.log(err, "err");
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
@@ -1581,14 +1584,18 @@ export default {
|
|
|
});
|
|
|
this.reTake();
|
|
|
});
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "人脸匹配不通过,请重新拍照上传",
|
|
|
+ });
|
|
|
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "拍照成功",
|
|
|
- });
|
|
|
- this.takePhotoModal = false;
|
|
|
- this.isTaking = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading.close();
|
|
|
+ this.reTake();
|
|
|
+ }, 2000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
imageInfos() {
|
|
@@ -1655,6 +1662,13 @@ export default {
|
|
|
.then((res) => {
|
|
|
console.log(res, "res");
|
|
|
resolve(res.data);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.loading.close();
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: err.msg,
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
},
|