Bläddra i källkod

Merge branch 'dev' into x_bf_1

谢杰标 2 år sedan
förälder
incheckning
3d44addb70
1 ändrade filer med 16 tillägg och 14 borttagningar
  1. 16 14
      src/pages/course-detail/index.vue

+ 16 - 14
src/pages/course-detail/index.vue

@@ -2437,17 +2437,15 @@ export default {
       };
     },
     isLastVideo() {
-      // try {
-      //   let { sectionId, chapterId } = this.sectionItem;
-      //   let _m = this.menuList;
-      //   let lastVideo = _m.slice(-1)[0].list.slice(-1)[0].list.slice(-1)[0];
-      //   return (
-      //     sectionId == lastVideo.sectionId && chapterId == lastVideo.chapterId
-      //   );
-      // } catch (error) {
-      //   return false;
-      // }
-      return false;
+      try {
+        let { sectionId, chapterId } = this.sectionItem;
+        let lastVideo =this.allVideoList.slice(-1)[0];
+        return (
+          sectionId == lastVideo.sectionId && chapterId == lastVideo.chapterId
+        );
+      } catch (error) {
+        return false;
+      }
     },
   },
   async mounted() {
@@ -2531,10 +2529,15 @@ export default {
     ...mapMutations(["getCartCount"]),
     ...mapActions(["getUserInfo"]),
     pauseVideo() {
+      let _p = this.player
       if (document.visibilityState === "hidden") {
-        this.player && this.player.j2s_pauseVideo();
+        _p  && _p .j2s_pauseVideo();
       } else {
-        this.player && this.player.j2s_resumeVideo();
+        if (_p) {
+          if(parseInt(_p .j2s_getCurrentTime())<_p .j2s_getDuration()){
+             this.player.j2s_resumeVideo();
+          }
+        }
       }
     },
     handleClick(tab) {
@@ -4726,7 +4729,6 @@ export default {
             this.photoHistoryList.length == 0
           ) {
             //开启直播拍照
-
             polyvPlayerContext.j2s_pauseVideo();
             this.openPhoto();
           } else {