Browse Source

fix:跳转回放页面的时候直接跳直播页面

xuqiaoying 3 years ago
parent
commit
22cf164e96
2 changed files with 18 additions and 7 deletions
  1. 16 5
      src/pages/live-detail/index.vue
  2. 2 2
      src/pages/living-room/index.vue

+ 16 - 5
src/pages/live-detail/index.vue

@@ -2783,6 +2783,7 @@ export default {
       liveLast: null,
       disName: false, // 姓名是否禁止输入
       disCard: false, // 身份证是否禁止输入
+      clickSectionItem: {}, // 点击节的内容
     };
   },
   computed: {
@@ -2858,6 +2859,7 @@ export default {
         }, 1000);
       }
     } else {
+      console.log('------')
       this.studyRecordQueryLiveLast();
     }
     // let noteSecond = this.$route.query.noteSecond;
@@ -2956,6 +2958,7 @@ export default {
               this.playSectionId = res.data.sectionId;
               this.vid = res.data.recordingUrl;
               this.sectionItem = res.data;
+              console.log('回放啊')
               this.playVideo(res.data);
             }
           }
@@ -4764,6 +4767,7 @@ export default {
      */
     async getResource(section) {
       console.log('回放回放', section)
+      this.clickSectionItem = section
       //逻辑
 
       if (section.type == 2) {
@@ -4956,13 +4960,14 @@ export default {
         }
         this.clickLock = true;
         if (
-          this.playSectionId &&
+          section.sectionType != 3 && this.playSectionId &&
           (this.playSectionId == section.sectionId ||
             this.playSectionId == section.menuId) &&
           this.moduleId == (section.moduleId || 0) &&
           this.chapterId == (section.chapterId || 0)
         ) {
           //切换为同一频道不作为
+          console.log('---====', this.moduleId, this.chapterId)
           this.clickLock = false;
           return;
         }
@@ -5193,10 +5198,12 @@ export default {
     },
 
     async playVideo(option) {
-      console.log(option, "<-----option");
-      if (option.sectionType == 1 || option.sectionType == 3) {
-        //录播和回放
-        if (option.sectionType == 3) {
+      console.log(option, "<-----option", this.clickSectionItem);
+
+      if (option.sectionType == 3) {
+        console.log('huifang')
+        // 回放
+        if (Object.keys(this.clickSectionItem).length) { //this.clickSectionItem 判断点击节才跳转, 不判断的话一进来页面到这里就直接跳转了
           this.$router.push({
             path: "/living-room/" + option.liveUrl,
             query: {
@@ -5212,8 +5219,12 @@ export default {
               vid: option.recordingUrl, // 回放vid
             }          
           })
+          this.clickSectionItem = {}
           return
         }
+      }
+      if (option.sectionType == 1) {
+        //录播
         //设置播放的节ID
 
         //提交保存观看历史

+ 2 - 2
src/pages/living-room/index.vue

@@ -467,7 +467,7 @@ export default {
           })
           .then((res) => {
             if (!res.data) {
-              this.signModal = true;
+              // this.signModal = true;
             }
           });
       }
@@ -776,7 +776,7 @@ export default {
   .top-line {
     margin: 10px 0;
     overflow: hidden;
-    padding: 0px 45px;
+    // padding: 0px 45px;
     .title {
       font-size: 18px;
       float: left;