谢杰标 2 anos atrás
pai
commit
6b824b8ea4
1 arquivos alterados com 6 adições e 14 exclusões
  1. 6 14
      pages3/polyv/detail.vue

+ 6 - 14
pages3/polyv/detail.vue

@@ -1166,7 +1166,9 @@ export default {
       if (this.playSecIsLearn && this.erJianErZao) {
         this.pauseTime = Date.now();
         this.pauseTimer = setInterval(() => {
+          console.log("暂停时间", Date.now() - this.pauseTime);
           if (Date.now() - this.pauseTime > 15 * 60 * 1000) {
+            // 15 * 60 * 1000
             let text = this.photoPopup ? "拍照停留" : "暂停";
             this.photoPopup = false;
             uni.showModal({
@@ -1238,6 +1240,7 @@ export default {
           oldSectionId
         );
         this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
+        this.clearPauseTimer();
         this.hasStart = false;
         this.photoConfig = false;
         this.photoIndex = 0;
@@ -1272,19 +1275,11 @@ export default {
         this.$store.commit("setPlaySectionId", {
           playSectionId: item.sectionId || item.menuId,
         });
-        console.log(
-          "清除直播节点胡:",
-          this.moduleId,
-          this.chapterId,
-          this.playSectionId,
-          this.hasStart
-        );
         //获取拍照历史
         this.getPhotoLastRecord();
         this.playVideo(item);
       });
       uni.$on("levelId", (item) => {
-        console.log("点击节获取的各层级ID", item);
         let arr = item.split("-");
         //点击节获取的各层级ID
         this.moduleId = arr[0];
@@ -1312,6 +1307,7 @@ export default {
     },
     clearPauseTimer() {
       if (this.pauseTimer) {
+        this.pauseTime = 0;
         clearInterval(this.pauseTimer);
         this.pauseTimer = null;
       }
@@ -2127,7 +2123,6 @@ export default {
       return {};
     },
     loadedmetadata(event) {
-      console.log(465456)
       if (this.hasStart) {
         // 防止loadedmetadata事件第二次触发
         return;
@@ -3074,7 +3069,6 @@ export default {
     async onStateChange(newstate, oldstate) {
       polyvPlayerContext = this.selectComponent("#playerVideo");
       if (newstate.detail.newstate == "playing") {
-        this.pauseTime = 0;
         if (this.needSeek) {
           // var polyvPlayerContext = this.selectComponent("#playerVideo");
           if (this.recordObj.videoCurrentTime) {
@@ -3340,7 +3334,7 @@ export default {
             // console.log('拍照确定提交', this.photoHistoryList);
             this.postStudyRecord(); //提交记录
             if (this.erJianErZao && this.isReach) {
-              console.log("1校验")
+              console.log("1校验");
               await this.postStudyRecord(1);
               this.photoPopup = false;
               this.uploadLock = false;
@@ -3739,7 +3733,6 @@ export default {
     // 播放视频
     loadPlayer() {
       const polyvPlayer = window.polyvPlayer;
-      this.pauseTime = 0;
       this.$api.polyvVideoSign(this.vid).then(async (res) => {
         this.player = await polyvPlayer({
           wrap: "#player",
@@ -3768,7 +3761,6 @@ export default {
         });
 
         polyvPlayerContext = this.player;
-        console.log("this.player:", this.player);
 
         this.player.on("s2j_onPlayStart", async (vid) => {
           // 视频初次播放时触发
@@ -3828,8 +3820,8 @@ export default {
           //开始播放
           this.timer && clearInterval(this.timer);
           if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
-            this.isReach = false;
             this.clearPauseTimer();
+            this.isReach = false;
             this.timer = setInterval(this.timeEvent, 1000); //定时器
           }