xuqiaoying 2 年之前
父節點
當前提交
1f0e195504
共有 2 個文件被更改,包括 46 次插入45 次删除
  1. 7 7
      pages/index/index.vue
  2. 39 38
      pages3/polyv/detail.vue

+ 7 - 7
pages/index/index.vue

@@ -456,13 +456,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(); // 判断有没有关注公众号

+ 39 - 38
pages3/polyv/detail.vue

@@ -849,42 +849,42 @@ export default {
     
   },
   onShow() {
-    this.photoPopup = true;
-    this.isTaking = true;
-    console.log('photoPopup:', this.photoPopup, 'isTaking:', this.isTaking, 'window:', window, 'navigator:', navigator);
-    console.log('window.navigator.mediaDevices', navigator.mediaDevices, navigator.mediaDevices.getUserMedia, navigator.getUserMedia,
-      navigator.webkitGetUserMedia, navigator.mozGetUserMedia);
-    if (
-          (window.navigator.mediaDevices &&
-            window.navigator.mediaDevices.getUserMedia) ||
-          window.navigator.getUserMedia ||
-          window.navigator.webkitGetUserMedia ||
-          window.navigator.mozGetUserMedia
-        ) {
-          console.log( "getUserMedia----");
-          // 调用用户媒体设备, 访问摄像头
-          this.getUserMedia(
-            {
-              video: {
-                width: 400,
-                height: 300,
-              },
-            },
-            this.photographSuccess,
-            this.photographError
-          );
-        } else {
-          console.log('1111没有摄像');
-          this.photographError();
-        }
-    // console.log('this.option:', this.option);
-    // if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
-    //   return;
-    // }
-    // console.log('onshow返回之后');
-    // this.courseCourseList();
-    // this.informId && this.clickOfficial() // 从公众号消息点击进来上报一次
-    // this.$store.getters.dictObj;
+    // this.photoPopup = true;
+    // this.isTaking = true;
+    // console.log('photoPopup:', this.photoPopup, 'isTaking:', this.isTaking, 'window:', window, 'navigator:', navigator);
+    // console.log('window.navigator.mediaDevices', window.navigator.mediaDevices, '1:', window.navigator.mediaDevices.getUserMedia, '2:',window.navigator.getUserMedia,
+    //   '3:', window.navigator.webkitGetUserMedia, '4:', window.navigator.mozGetUserMedia);
+    // if (
+    //       (window.navigator.mediaDevices &&
+    //         window.navigator.mediaDevices.getUserMedia) ||
+    //       window.navigator.getUserMedia ||
+    //       window.navigator.webkitGetUserMedia ||
+    //       window.navigator.mozGetUserMedia
+    //     ) {
+    //       console.log( "getUserMedia----");
+    //       // 调用用户媒体设备, 访问摄像头
+    //       this.getUserMedia(
+    //         {
+    //           video: {
+    //             width: 400,
+    //             height: 300,
+    //           },
+    //         },
+    //         this.photographSuccess,
+    //         this.photographError
+    //       );
+    //     } else {
+    //       console.log('1111没有摄像');
+    //       this.photographError();
+    //     }
+    console.log('this.option:', this.option);
+    if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
+      return;
+    }
+    console.log('onshow返回之后');
+    this.courseCourseList();
+    this.informId && this.clickOfficial() // 从公众号消息点击进来上报一次
+    this.$store.getters.dictObj;
   },
   onUnload() {
     console.log('onUnloadonUnloadonUnloadonUnload');
@@ -2944,8 +2944,8 @@ export default {
         // #endif
       }
       this.enableAutoRotation = false;
-      // this.photoPopup = true;
-      // this.isTaking = true;
+      this.photoPopup = true;
+      this.isTaking = true;
       // #ifdef MP-WEIXIN
       uni.setKeepScreenOn({
         keepScreenOn: true,
@@ -3595,6 +3595,7 @@ export default {
       }
     },
     photographSuccess(stream) {
+      console.log('有摄像头---');
       // 兼容webkit核心浏览器
       this.isTaking = true
       this.photoPopup = true