Browse Source

Merge branch 'xqy_h5' of http://120.79.166.78:19005/zhongzheng-edu/saas_miniprogram into xqy_h5

谢杰标 2 years ago
parent
commit
8121402a9c
1 changed files with 21 additions and 17 deletions
  1. 21 17
      pages3/polyv/detail.vue

+ 21 - 17
pages3/polyv/detail.vue

@@ -3041,7 +3041,7 @@ export default {
       this.uploadLock = true;
 
       let compareFaceData = await this.faceRecognition();
-			// console.log(compareFaceData,'compareFaceData')
+			console.log(compareFaceData,'compareFaceData')
       this.compareFaceData = compareFaceData
       if (compareFaceData >= 80) {
         const waitYS = await this.imageInfos();
@@ -3092,7 +3092,7 @@ export default {
     },
     reTake() {
       this.isTaking = true;
-      // #ifdef MP-WEIXIN
+      // #ifdef H5
       this.faceUrl = "";
       this.getUserMedia({
         video: {
@@ -3129,6 +3129,7 @@ export default {
       });
       // #endif
       // #ifdef H5
+      console.log('===确认拍照:', document);
       const canvas = document.createElement("canvas");
       console.log('canvas:', canvas);
       canvas.width = 400;
@@ -3551,6 +3552,7 @@ export default {
       return !!(document.webkitIsFullScreen || this.fullele());
     },
     getUserMedia(constraints, success, error) {
+      console.log('getUserMedia===', constraints, );
       if (window.navigator.mediaDevices.getUserMedia) {
         // 最新的标准API
         window.navigator.mediaDevices
@@ -3570,31 +3572,33 @@ export default {
     },
     photographSuccess(stream) {
       // 兼容webkit核心浏览器
-      // this.isTaking = true;
-      // this.takePhotoModal = true;
+      this.isTaking = true
+      this.photoPopup = true
       this.$nextTick(() => {
+        console.log('video:', document);
         const video = document.getElementById("video");
         // 将视频流设置为video元素的源
-        console.log('video1:',video, stream);
+        console.log('video1:',video, 'stream:',stream);
         video.srcObject = stream;
         this.mediaStreamTrack =
           typeof stream.stop === "function" ? stream : stream.getTracks()[0];
-        // video.play();
+        video.play();
       });
     },
     photographError(err) {
-      this.$confirm(
-        "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
-        "提示",
-        {
-          showConfirmButton: false,
-          closeOnClickModal: false,
-          showCancelButton: false,
-          closeOnPressEscape: false,
-          distinguishCancelAndClose: false,
-          showClose: false,
+      uni.showModal({
+        title: '提示',
+        content: '课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。',
+				cancelText:'取消',
+				confirmText:'确定',
+        success: (res) => {
+          if (res.confirm) {
+            uni.navigateBack()
+          } else if (res.cancel) {
+          }
         }
-      );
+			})
+
     },
   },
 };