Sfoglia il codice sorgente

视频拍照和章卷的拍照记录加similarity匹配相似度参数

xuqiaoying 3 anni fa
parent
commit
de291530c7

+ 2 - 2
src/axios.js

@@ -5,8 +5,8 @@ import { Message } from 'element-ui'
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://192.168.1.7:5055'    //dev
-// export const BASE_URL = 'http://192.168.1.24:5055'    //dev
-export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
+export const BASE_URL = 'http://192.168.1.24:5055'    //dev
+// export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //测试
 export const tenantId = '867735392558919680'

+ 6 - 3
src/pages/course-detail/index.vue

@@ -3067,7 +3067,8 @@ export default {
       courseTotal: 0, 
       teaIndex: 0,
       sectionExamList:[],//节试卷集合
-      sectionExam:[]//节试卷集合
+      sectionExam:[], //节试卷集合
+      compareFaceData: 0, // 拍照匹配相似度
     };
   },
   computed: {
@@ -3399,7 +3400,7 @@ export default {
     async takeOk() {
       this.loading = true;
       let compareFaceData = await this.faceRecognition();
-
+      this.compareFaceData = compareFaceData
       if (compareFaceData >= 80) {
         const waitYS = await this.imageInfos();
         this.postCoursePhotoRecord()
@@ -6334,7 +6335,9 @@ export default {
         orderGoodsId: parseInt(this.orderGoodsId),
       };
 
-      console.log(data, "data");
+      if (this.ossAvatarUrl) {
+        data.similarity = this.compareFaceData // 相似度
+      }
       if (status > 0) {
         data.status = status;
       }

+ 7 - 14
src/pages/course-exam/index.vue

@@ -1215,6 +1215,7 @@ export default {
       loading: false,
       type: 0, //type:1章卷,2节卷,3模考卷
       bankType: 0,
+      compareFaceData: 0, // 拍照匹配相似度
     };
   },
   async mounted() {
@@ -1428,7 +1429,6 @@ export default {
           window.navigator.webkitGetUserMedia ||
           window.navigator.mozGetUserMedia
         ) {
-          console.log(this.getUserMedia, "getUserMedia");
           // 调用用户媒体设备, 访问摄像头
           this.getUserMedia(
             {
@@ -1449,7 +1449,7 @@ export default {
     async takeOk() {
       this.loading = true;
       let compareFaceData = await this.faceRecognition();
-
+      this.compareFaceData = compareFaceData
       if (compareFaceData == 0) {
         this.$message({
           type: "warning",
@@ -1483,12 +1483,14 @@ export default {
         photo: self.ossAvatarUrl,
         recordId: self.recordId,
       };
-      console.log(data, "拍照提交");
+      if (this.ossAvatarUrl) {
+        data.similarity = this.compareFaceData // 相似度
+      }
       this.$request
         .studyExamPhotoRecord(data)
         .then((res) => {
           this.hasTake = true;
-          console.log(res, "拍照提交结果");
+          // console.log(res, "拍照提交结果");
           self.ossAvatarUrl = "";
           //拍照
           if (this.lastTime) {
@@ -1584,7 +1586,6 @@ export default {
             gradeId: this.gradeId,
           })
           .then((res) => {
-            console.log(res, "res");
             resolve(res.data);
           })
           .catch((err) => {
@@ -1652,7 +1653,7 @@ export default {
       this.$nextTick(() => {
         const video = document.getElementById("video");
         // 将视频流设置为video元素的源
-        console.dir(video);
+        // console.dir(video);
         video.srcObject = stream;
         this.mediaStreamTrack =
           typeof stream.stop === "function" ? stream : stream.getTracks()[0];
@@ -1935,7 +1936,6 @@ export default {
                 item.ques[indexs] &&
                 (item.ques[indexs].text || item.ques[indexs].imageList.length)
               ) {
-                console.log("chil");
                 return true;
               } else {
                 return false;
@@ -1974,7 +1974,6 @@ export default {
       question.ques.imageList = question.ansText.imageList;
       question.ques.text = question.ansText.text;
 
-      console.log(question.ques);
     },
     ansSubmitChild(question, questionIndex, jsonIndex) {
       if (
@@ -2032,9 +2031,6 @@ export default {
       //单选
       if (this.questionList[index].ques) {
         if (item.type == 1) {
-          console.log(
-            this.questionList[index].ques == this.questionList[index].ans
-          );
           return this.questionList[index].ques == this.questionList[index].ans;
           //多选
         } else if (item.type == 2) {
@@ -2176,14 +2172,12 @@ export default {
 
             if (isOver) {
               count++;
-              console.log(item, 444);
             }
           }
         } else if (item.type == 5) {
           //简答题
           if (hasSpecail) {
             if (item.ques && (item.ques.text || item.ques.imageList.length)) {
-              console.log(5, item);
               count++;
             }
           }
@@ -2335,7 +2329,6 @@ export default {
                   checkboxScore = 0;
                 }
               });
-            console.log(checkboxScore);
 
             //没选错
             if (checkboxScore) {

+ 5 - 1
src/pages/live-detail/index.vue

@@ -2784,6 +2784,7 @@ export default {
       disName: false, // 姓名是否禁止输入
       disCard: false, // 身份证是否禁止输入
       clickSectionItem: {}, // 点击节的内容
+      compareFaceData: 0, // 拍照匹配相似度
     };
   },
   computed: {
@@ -3011,7 +3012,7 @@ export default {
     async takeOk() {
       this.loading = true;
       let compareFaceData = await this.faceRecognition();
-
+      this.compareFaceData = compareFaceData
       if (compareFaceData >= 80) {
         const waitYS = await this.imageInfos();
         this.postCoursePhotoRecord()
@@ -5834,6 +5835,9 @@ export default {
         videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
         orderGoodsId: this.orderGoodsId,
       };
+      if (this.ossAvatarUrl) {
+        data.similarity = this.compareFaceData // 相似度
+      }
       if (status > 0) {
         data.status = status;
       }