xuqiaoying 2 éve
szülő
commit
bc202e75c4
2 módosított fájl, 28 hozzáadás és 24 törlés
  1. 7 7
      pages/index/index.vue
  2. 21 17
      pages3/polyv/detail.vue

+ 7 - 7
pages/index/index.vue

@@ -341,13 +341,13 @@ export default {
 		} else {
 			console.log('没有code');
 			// 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名,就拿到code了
-			if (!uni.getStorageSync('h5_code')) {
-				location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
-				return
-			} else {
-				// this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
-				// this.OfficialLogin()
-			}
+			// if (!uni.getStorageSync('h5_code')) {
+			// 	location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
+			// 	return
+			// } else {
+			// 	// this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
+			// 	// this.OfficialLogin()
+			// }
 		}
 		// #endif
 		this.getInfo() // 判断有没有关注公众号		

+ 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) {
+          }
         }
-      );
+			})
+
     },
   },
 };