浏览代码

笔记跳转重构完成

谢杰标 2 年之前
父节点
当前提交
17039aefa2
共有 1 个文件被更改,包括 19 次插入48 次删除
  1. 19 48
      pages3/polyv/detail.vue

+ 19 - 48
pages3/polyv/detail.vue

@@ -29,7 +29,6 @@
           @loadedmetadata="loadedmetadata"
           @timeupdate="timeupdate"
         ></my-player>
-      
       </view>
       <view class="course_name">
         <view class="course_titles">
@@ -912,7 +911,7 @@ export default {
     }
     this.option = option;
     let { skipPort, id, goodsId, orderGoodsId, gradeId, informId } = option;
-    console.log("🚀 ~ file: detail.vue:928 ~ onLoad ~ id:", option)
+    console.log("🚀 ~ file: detail.vue:928 ~ onLoad ~ id:", option);
     if (skipPort) {
       await this.$method.skipLogin(skipPort);
     }
@@ -1139,11 +1138,10 @@ export default {
       await this.studyRecordMenuAllList();
       // 消息过来 定位某个节
       if (this.option.noteSecond) {
-        this.initPlayVideo({
+        this.jumpNote({
           sectionType: 1,
           ...this.option,
-          videoCurrentTime: Number(this.option.noteSecond),
-        });
+        })
         return;
       }
       this.studyRecordQueryLiveLast();
@@ -1411,7 +1409,7 @@ export default {
         this.noticeShow = false;
         if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
           this.autoplay = true;
-          this.$refPlv.resumeVideo()
+          this.refPlv.resumeVideo();
         }
       }
     },
@@ -2108,27 +2106,16 @@ export default {
     },
 
     jumpNote(item) {
+      this.$u.toast("即将跳到笔记位置");
       this.noteId = item.noteId;
-      //没视频播放
-      if (this.playSectionId == 0) {
-        this.$u.toast("即将跳到笔记位置");
-        this.$store.commit("setPlaySectionId", {
-          playSectionId: item.sectionId || item.menuId,
+      if (this.playSectionId != item.sectionId) {
+        this.initPlayVideo({
+          sectionType: 1,
+          ...item,
+          videoCurrentTime: Number(item.noteSecond),
         });
-        this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
-        this.playNoteVideo(item);
       } else {
-        //正在看当前笔记视频
-        this.$u.toast("即将跳到笔记位置");
-        //跳到笔记时刻
-        // #ifdef MP-WEIXIN
-        polyvPlayerContext.seek(item.noteSecond);
-        polyvPlayerContext.play();
-        // #endif
-        // #ifdef H5
-        polyvPlayerContext.j2s_seekVideo(0);
-        polyvPlayerContext.j2s_resumeVideo();
-        // #endif
+        this.refPlv.seekVideo(item.noteSecond)
       }
     },
     postNote() {
@@ -2145,28 +2132,10 @@ export default {
         this.$u.toast("暂无班级数据");
         return;
       }
-      let noteDate = this.$method.getZeroTime();
-      let noteSecond = 0;
-      // #ifdef MP-WEIXIN
-      noteSecond = polyvPlayerContext.getCurrentTime();
-      // #endif
-      // #ifdef H5
-      noteSecond = polyvPlayerContext.j2s_getCurrentTime();
-      // #endif
+      let noteSecond = this.refPlv.playCurrentTime();
       if (!noteSecond) {
-        if (noteSecond == 0) {
-          //播放结束
-          // #ifdef MP-WEIXIN
-          noteSecond = polyvPlayerContext.getDuration();
-          // #endif
-          // #ifdef H5
-          noteSecond = polyvPlayerContext.j2s_getCurrentTime();
-          // #endif
-        }
-        if (!noteSecond) {
-          this.$u.toast("视频暂未开始");
-          return;
-        }
+        this.$u.toast("视频暂未开始");
+        return;
       }
       let data = {
         gradeId: this.gradeId,
@@ -2174,7 +2143,7 @@ export default {
         sectionId: this.playSectionId,
         courseId: this.courseId,
         noteText: this.noteValue,
-        noteDate: noteDate,
+        noteDate: this.$method.getZeroTime(),
         noteSecond: noteSecond,
         orderGoodsId: this.orderGoodsId,
       };
@@ -2579,7 +2548,7 @@ export default {
       this.clearPauseTimer();
       if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
         this.isReach = false;
-        this.timeEvent(); 
+        this.timeEvent();
       }
     },
     playing() {
@@ -2872,7 +2841,7 @@ export default {
             this.photoPopup = false;
             this.uploadLock = false;
             this.enableAutoRotation = true;
-            this.$refPlv.resumeVideo()
+            this.refPlv.resumeVideo();
           })
           .catch((err) => {
             console.log("拍照记录接口的err", err);
@@ -3111,6 +3080,8 @@ export default {
       this.current = index;
       if (index == 3) {
         this.getAnswerList();
+      } else if (index == 2) {
+        this.getNoteList();
       }
     },
     clickMulu() {