Browse Source

bugfix 视频拍照相关

谢杰标 2 years ago
parent
commit
48c12f588c
2 changed files with 16 additions and 11 deletions
  1. 3 1
      components/course/courseSection.vue
  2. 13 10
      pages3/polyv/detail.vue

+ 3 - 1
components/course/courseSection.vue

@@ -446,8 +446,10 @@ export default {
       if (this.$method.isGoLogin()) {
       if (this.$method.isGoLogin()) {
         return;
         return;
       }
       }
+      if(this.menuItem.id==this.playSectionId){
+        return
+      }
       this.clickLock = true;
       this.clickLock = true;
-
       if (this.learningOrder == 2 && !this.menuItem.isRebuild && !this.isLive) {
       if (this.learningOrder == 2 && !this.menuItem.isRebuild && !this.isLive) {
         //要按从头到尾顺序学习, 且不是重修课程
         //要按从头到尾顺序学习, 且不是重修课程
         if (this.preItem) {
         if (this.preItem) {

+ 13 - 10
pages3/polyv/detail.vue

@@ -1012,6 +1012,7 @@ export default {
       // /course/courseList查询商品下的课程列表
       // /course/courseList查询商品下的课程列表
       this.courseList = [];
       this.courseList = [];
       this.menuList = [];
       this.menuList = [];
+      this.photoConfig = false
       this.$api
       this.$api
         .courseCourseList({
         .courseCourseList({
           pageNum: 1,
           pageNum: 1,
@@ -1164,7 +1165,7 @@ export default {
       if (this.playSecIsLearn && this.erJianErZao) {
       if (this.playSecIsLearn && this.erJianErZao) {
         this.pauseTime = Date.now();
         this.pauseTime = Date.now();
         this.pauseTimer = setInterval(() => {
         this.pauseTimer = setInterval(() => {
-          if (Date.now() - this.pauseTime > 60 * 1000) {
+          if (Date.now() - this.pauseTime > 15 * 60 * 1000) {
             let text = this.photoPopup ? "拍照停留" : "暂停";
             let text = this.photoPopup ? "拍照停留" : "暂停";
             this.photoPopup = false;
             this.photoPopup = false;
             uni.showModal({
             uni.showModal({
@@ -1179,15 +1180,12 @@ export default {
                   location.reload();
                   location.reload();
                   // #endif
                   // #endif
                   // #ifdef MP-WEIXIN
                   // #ifdef MP-WEIXIN
-                  let pages = getCurrentPages();
-                  pages[pages.length - 1].onload();
+                  this.courseCourseList();
                   // #endif
                   // #endif
                 }
                 }
               },
               },
             });
             });
-            clearInterval(this.pauseTimer);
-
-            this.pauseTimer = null;
+            this.clearPauseTimer()
           }
           }
         }, 5000);
         }, 5000);
       }
       }
@@ -1311,6 +1309,12 @@ export default {
       });
       });
       this.updateChapterOpen(true);
       this.updateChapterOpen(true);
     },
     },
+    clearPauseTimer(){
+      if (this.pauseTimer) {
+        clearInterval(this.pauseTimer);
+        this.pauseTimer = null;
+      }
+    },
     // 原来onUnload里面的内容
     // 原来onUnload里面的内容
     originUnload() {
     originUnload() {
       if (this.playSectionId > 0 && this.hasStart) {
       if (this.playSectionId > 0 && this.hasStart) {
@@ -1332,10 +1336,7 @@ export default {
         clearInterval(this.studyTimer);
         clearInterval(this.studyTimer);
         this.hasStart = false;
         this.hasStart = false;
       }
       }
-      if (this.pauseTimer) {
-        clearInterval(this.pauseTimer);
-        this.pauseTimer = null;
-      }
+      this.clearPauseTimer()
       if (this.barTimer) {
       if (this.barTimer) {
         clearInterval(this.barTimer);
         clearInterval(this.barTimer);
         this.barTimer = null;
         this.barTimer = null;
@@ -3085,6 +3086,7 @@ export default {
         //开始播放
         //开始播放
         this.timer && clearInterval(this.timer);
         this.timer && clearInterval(this.timer);
         if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
         if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
+          this.clearPauseTimer()
           this.timer = setInterval(this.timeEvent, 1000); //定时器
           this.timer = setInterval(this.timeEvent, 1000); //定时器
         }
         }
       }
       }
@@ -3799,6 +3801,7 @@ export default {
           //开始播放
           //开始播放
           this.timer && clearInterval(this.timer);
           this.timer && clearInterval(this.timer);
           if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
           if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
+            this.clearPauseTimer()
             this.timer = setInterval(this.timeEvent, 1000); //定时器
             this.timer = setInterval(this.timeEvent, 1000); //定时器
           }
           }