xuqiaoying пре 3 година
родитељ
комит
843ebc0750
2 измењених фајлова са 18 додато и 6 уклоњено
  1. 2 2
      components/course/courseSection.vue
  2. 16 4
      pages3/polyv/detail.vue

+ 2 - 2
components/course/courseSection.vue

@@ -436,13 +436,13 @@ export default {
 					let oldSectionId = this.playSectionId
 					uni.$emit('changeSection', oldSectionId)
 				}
-				// console.log('===设置播放的节IDthis.menuItem,', this.menuItem, this.playId);
+				console.log('===设置播放的节IDthis.menuItem,', this.menuItem, this.playId, this.courseId);
 				//设置播放的节ID
 				this.$store.commit('setPlaySectionId', {playSectionId  :this.newId});
 				this.$store.commit('setPlayVID', {playVID  :this.menuItem.recordingUrl});
 				this.$store.commit('updatePlayNextId',this.playId)
 				uni.$emit('levelId', this.levelId)
-				uni.$emit('getSection', this.menuItem)
+				uni.$emit('getSection', this.menuItem, this.courseId)
 				uni.$emit('isRebuild',this.isRebuild)
 			}
 			if(this.menuItem.sectionType==2){

+ 16 - 4
pages3/polyv/detail.vue

@@ -790,6 +790,7 @@ export default {
       menuAllList: [],
       popupPhotoShow: false,
       curPlayIndex: 0, // 正在播放的节的下标
+      changeCourseId: 0, // 切换课程的id
     };
   },
   computed: {
@@ -1020,6 +1021,7 @@ export default {
           }
         })
         console.log('===,== this.goodsTeacher', this.goodsTeacher, 'this.courseId:', this.courseId);
+        console.log('==11', this.goodsTeacher[1].courseList[0].courseId);
       }) 
     },
     // 原来onshow里面的内容
@@ -1075,7 +1077,8 @@ export default {
         this.$store.commit("setPlayChannelId", { playChannelId: 0 });
         this.postStudyRecord(0, oldSectionId);
       });
-      uni.$on("getSection", (item) => {
+      uni.$on("getSection", (item, courseId) => {
+        console.log('item:', item, 'courseId:',courseId, 'this.courseId:', this.courseId);
         //清除直播
         this.studyTimer && clearInterval(this.studyTimer)
         this.hasStart = false;
@@ -1085,6 +1088,11 @@ export default {
         this.sectionItem = item;
         this.moduleId = item.moduleId || null
         this.chapterId = item.chapterId || null
+        this.changeCourseId = courseId
+        if (courseId != this.courseId) {
+          this.courseId = courseId
+          this.studyRecordMenuAllList()
+        }
         
         this.$store.commit("setPlayChannelId", { playChannelId: 0 });
         this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
@@ -1646,7 +1654,7 @@ export default {
 		},
 		studyRecordMenuAllList() {
       // study/record/menuAllList
-			this.$api.studyRecordMenuAllList({
+			return this.$api.studyRecordMenuAllList({
 				courseId:this.courseId,
 				gradeId:this.gradeId,
 				goodsId:this.goodsId
@@ -1654,7 +1662,9 @@ export default {
 				let nowTime = Number(new  Date().getTime()/1000).toFixed(0)
         if (res.data.data) {
           this.menuAllList = res.data.data
-				this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);          
+          console.log('请求后的this.menuAllList', this.menuAllList);
+          this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
+          return Promise.resolve(this.menuAllList)          
         }
 			})
 		},
@@ -2726,9 +2736,11 @@ export default {
           if (!nextCourse) {
             this.allLearnShow()
           } else {
+            console.log(']]]]]]');
             this.courseId = this.goodsTeacher[nextCourse].courseList[0].courseId
+            console.log('---学完this.courseId:', this.courseId);
             await this.studyRecordMenuAllList()
-            console.log('---- this.menuAllList:',  this.menuAllList)
+            console.log('---- this.menuAllList:',  this.menuAllList,)
           }
         } else {
           //第二个弹窗