Browse Source

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

xuqiaoying 3 years ago
parent
commit
8048238bca
4 changed files with 22 additions and 17 deletions
  1. 2 2
      common/request.js
  2. 5 2
      pages2/class/questionBank.vue
  3. 5 7
      pages3/live/detail.vue
  4. 10 6
      pages3/polyv/detail.vue

+ 2 - 2
common/request.js

@@ -9,8 +9,8 @@ var num = 1
 // 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'    //后端本地更新到222
-// export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
+// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 5 - 2
pages2/class/questionBank.vue

@@ -857,6 +857,7 @@ export default {
       isTaking: true, //是否正在拍照
       needPhoto: false, //是否需要拍照
       examType: 0, // 3-模块,1-章,2-节
+      compareFaceData: 0, // 拍照匹配相似度
     };
   },
   async onLoad(option) {
@@ -982,6 +983,9 @@ export default {
         photo: self.ossAvatarUrl,
         recordId: self.recordId,
       };
+      if (this.ossAvatarUrl) {
+        data.similarity = this.compareFaceData // 相似度
+      }
       console.log(data, "拍照提交");
       this.$api.studyExamPhotoRecord(data).then((res) => {
         console.log(res, "拍照提交结果");
@@ -1128,7 +1132,6 @@ export default {
           encoding: "base64",
           position: 0,
           success: (res) => {
-            console.log(res);
             let base64 = "data:image/jpg;base64," + res.data;
 
             this.$api
@@ -1138,7 +1141,6 @@ export default {
                 gradeId: this.gradeId,
               })
               .then((res) => {
-                console.log(res, "res");
                 resolve(res.data.data);
               });
           },
@@ -1150,6 +1152,7 @@ export default {
     },
     async submitPhoto() {
       let compareFaceData = await this.faceRecognition();
+      this.compareFaceData = compareFaceData
       console.log(compareFaceData, "compareFaceData");
       if (compareFaceData == 0) {
         uni.showToast({

+ 5 - 7
pages3/live/detail.vue

@@ -737,6 +737,7 @@ export default {
       s_courseList: [], // 筛选后的
       subList: [],
       subIndex: 0,
+      compareFaceData: 0, // 拍照匹配相似度
     };
   },
   computed: {
@@ -1742,6 +1743,9 @@ export default {
           currentTime > 0 ? currentTime : self.studyDuration
         ),
       };
+      if (this.ossAvatarUrl) {
+        data.similarity = this.compareFaceData // 相似度
+      }
       if (status > 0) {
         data.status = status;
       }
@@ -2021,13 +2025,7 @@ export default {
           encoding: "base64",
           position: 0,
           success: (res) => {
-            console.log(res);
             let base64 = "data:image/jpg;base64," + res.data;
-						console.log({
-                imageA: base64,
-                orderGoodsId: this.orderGoodsId,
-                gradeId: this.gradeId,
-              },'base64Data')
             this.$api
               .faceCertificationCompareFace({
                 imageA: base64,
@@ -2035,7 +2033,6 @@ export default {
                 gradeId: this.gradeId,
               })
               .then((res) => {
-                console.log(res, "res");
                 resolve(res.data.data);
               });
           },
@@ -2053,6 +2050,7 @@ export default {
       this.uploadLock = true;
 
       let compareFaceData = await this.faceRecognition();
+      this.compareFaceData = compareFaceData
 			console.log(compareFaceData,'compareFaceData')
       if (compareFaceData >= 80) {
         const waitYS = await this.imageInfos();

+ 10 - 6
pages3/polyv/detail.vue

@@ -734,6 +734,7 @@ export default {
       // teaIndex: 0,
       teacherIndex: 0,
       newActiveSubjectId: "", //当前选中ID
+      compareFaceData: 0, // 拍照匹配相似度
     };
   },
   computed: {
@@ -2399,6 +2400,9 @@ export default {
           currentTime > 0 ? currentTime : self.studyDuration
         ),
       };
+      if (this.ossAvatarUrl) {
+        data.similarity = this.compareFaceData // 相似度
+      }
       if (status > 0) {
         data.status = status;
       }
@@ -2675,13 +2679,12 @@ export default {
           encoding: "base64",
           position: 0,
           success: (res) => {
-            console.log(res);
             let base64 = "data:image/jpg;base64," + res.data;
-						console.log({
-                imageA: base64,
-                orderGoodsId: this.orderGoodsId,
-                gradeId: this.gradeId,
-              },'base64Data')
+						// console.log({
+            //     imageA: base64,
+            //     orderGoodsId: this.orderGoodsId,
+            //     gradeId: this.gradeId,
+            //   },'base64Data')
             this.$api
               .faceCertificationCompareFace({
                 imageA: base64,
@@ -2708,6 +2711,7 @@ export default {
 
       let compareFaceData = await this.faceRecognition();
 			console.log(compareFaceData,'compareFaceData')
+      this.compareFaceData = compareFaceData
       if (compareFaceData >= 80) {
         const waitYS = await this.imageInfos();
         this.postCoursePhotoRecord()