xuqiaoying преди 2 години
родител
ревизия
7a734e840d
променени са 4 файла, в които са добавени 50 реда и са изтрити 103 реда
  1. 2 10
      components/course/courseChapter.vue
  2. 1 9
      components/course/courseModule.vue
  3. 1 53
      components/course/courseSection.vue
  4. 46 31
      pages3/polyv/detail.vue

+ 2 - 10
components/course/courseChapter.vue

@@ -159,19 +159,11 @@ export default {
   created() {
   },
   mounted() {
-    console.log('needOpen:', this.needOpen, this.chapterOpen);
+    // console.log('needOpen:', this.needOpen, this.chapterOpen);
     if (this.needOpen && this.chapterOpen) {
       this.updateChapterOpen(false);
       this.openChapter(this.menuItem);
     }
-    uni.$off('openEmit')
-		uni.$once('openEmit', (data) => {
-      console.log('------章-data:', data);
-      if (data.chapterId && data.chapterId > 0) {
-        this.openChapter(data)
-      }
-			
-		})
   },
   onPageShow() {
     if (this.isBuy) {
@@ -527,7 +519,7 @@ export default {
       });
     },
     async openChapter(item) {
-      console.log('---zhang',this.menuItem, this.down, item.courseId, item.moduleId);
+      // console.log('---zhang',this.menuItem, this.down, item.courseId, item.moduleId);
       this.down = !this.down;
       if (!this.down && this.list.length == 0) {
         // console.log(item.id, 69);

+ 1 - 9
components/course/courseModule.vue

@@ -137,17 +137,10 @@ export default {
 		};
 	},
 	mounted() {
-		console.log('模块的needOpen:', this.needOpen, 'chapterOpen:', this.chapterOpen);
+		// console.log('模块的needOpen:', this.needOpen, 'chapterOpen:', this.chapterOpen);
 		if(this.needOpen && this.chapterOpen) {
 			this.openModule(this.menuItem)
 		}
-		uni.$off('openEmit')
-		uni.$once('openEmit', (data) => {
-			console.log('------木块-data:', data);
-			if (data.moduleId && data.moduleId > 0) {
-				this.openModule(data)
-			}
-		})
 	},
 	methods: {
 		playEnd(isRebuild) {
@@ -157,7 +150,6 @@ export default {
 			this.$emit('toDo',item)
 		},
 		openModule(item){
-			console.log('打kai模块');
 			this.down = !this.down
 			if(!this.down&&this.list.length==0){
 				if(this.isBuy){

+ 1 - 53
components/course/courseSection.vue

@@ -42,7 +42,6 @@
 				<!-- 学习中 -->
 				<view v-if="playSectionId==newId && playNextId==playId" class="learnings">
 					<image src="/pages3/static/imgs/learning_icon.gif" class="learning_icon"></image>
-					<text>学习中</text>
 				</view>
 			</view>
 			<view style="font-size: 20rpx;color: #FF3B30;"  v-if="menuItem.liveStartTime && menuItem.sectionType != 3 && isBuy">
@@ -189,7 +188,7 @@ export default {
 		let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
 		let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}${this.isRebuild?'isRebuild':''}`;
 		this.playId = playNextId;
-		console.log('playNextId:', this.playNextId, 'playId:', this.playId);
+		// console.log('playNextId:', this.playNextId, 'playId:', this.playId);
 		uni.$off('playNext'+playNextId) //绑定前先移除之前的事件
 		uni.$once('playNext'+playNextId, async (data) => {
 			//到时会触发每个节的监听事件,只允许当前节的接收
@@ -223,56 +222,9 @@ export default {
 				    }
 				});
 			} else {
-				console.log('播放结束--节的');
 				this.$emit('playEnd',{isRebuild:this.isRebuild})
 			}
 		});
-		uni.$off('playNextSection') //绑定前先移除之前的事件
-		// uni.$once('playNextSection', (data) => {
-		// 	console.log('监听到播放结束的点:', data, this.menuAllList);
-		// 	let nextItem = {}
-		// 	if (data + 1 == this.menuAllList.length) {
-		// 		this.$u.toast('已学完所有视频课程!')
-		// 		return
-		// 	} else {
-		// 		nextItem = this.menuAllList[data + 1]
-		// 	}
-		// 	console.log('nextItem:', nextItem)
-		// 	uni.showModal({
-		// 		title: '温馨提示',
-		// 		content: '当前节视频已学完,继续学习下一节?',
-		// 		success: (res) => {
-		// 			if (res.confirm) {
-		// 				//设置播放的节ID
-		// 				if(this.playSectionId>0){
-		// 					console.log('切换视频1111', this.playSectionId);
-		// 					//切换视频
-		// 					uni.$emit('changeSection', this.playSectionId)
-		// 				}
-		// 				this.newId = nextItem.sectionId
-		// 				this.playId = `moduleId${nextItem.moduleId || 0}chapterId${nextItem.chapterId || 0}sectionId${nextItem.sectionId || 0}`
-		// 				this.$store.commit('setPlaySectionId', {playSectionId: nextItem.sectionId});
-		// 				this.$store.commit('setPlayVID', {playVID: nextItem.recordingUrl}); // nextItem.recordingUrl
-		// 				this.$store.commit('updatePlayNextId',this.playId)
-
-		// 				console.log('====');
-		// 				let ids = this.levelId.split('-');
-		// 				ids[2] = nextItem.sectionId 
-		// 				uni.$emit('levelId', ids.join('-'))
-		// 				uni.$emit('getSection', nextItem)
-		// 				this.$emit('playEnd',{isRebuild:this.isRebuild})
-						
-		// 			} else {
-		// 				//设置播放的节ID
-		// 				this.$store.commit('setPlaySectionId', {playSectionId: nextItem.sectionId});
-		// 				this.$store.commit('setPlayVID', {playVID: nextItem.recordingUrl});
-		// 				let ids = this.levelId.split('-');
-		// 				ids[2] = nextItem.sectionId 
-		// 				this.$emit('playEnd',{isRebuild:this.isRebuild})
-		// 			}
-		// 		}
-		// 	});
-		// })
 	},
 	methods: {
 		isLast() {
@@ -699,10 +651,6 @@ export default {
 		}
 	}
 	.learnings {
-		font-size: 24rpx;
-		color: #0A7DDA;
-		display: flex;
-		align-items: center;
 		margin-right: 8rpx;
 		.learning_icon {
 			width: 40rpx;

+ 46 - 31
pages3/polyv/detail.vue

@@ -2451,7 +2451,6 @@ export default {
               fromRebuild: this.isRebuild,
             }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
             uni.$emit("playNext" + playNextId); //通知播放结束
-            uni.$emit('playNextSection', this.curPlayIndex) // 播放下一节
           }
 
           self.ossAvatarUrl = "";
@@ -2687,50 +2686,66 @@ export default {
       }
     },
    //播放下一节
-   async nextSection(){
-    console.log("放完了",this.menuAllList)
+    nextSection(){
+    // console.log("放完了",this.menuAllList)
       if(!this.menuAllList.length){
         return
       }
-      console.log('this.sectionId:', this.sectionId, 'this.chapterId:', this.chapterId, 'this.moduleId:', this.moduleId);
-      //第一个弹窗
+      // console.log('this.sectionId:', this.sectionId, 'this.chapterId:', this.chapterId, 'this.moduleId:', this.moduleId);      
       this.curPlayIndex = this.menuAllList.findIndex((item) => {
         let i_sectionId = item.sectionId || 0
         let i_chapterId = item.chapterId || 0
         let i_moduleId = item.moduleId || 0
         return i_sectionId == this.playSectionId && i_chapterId == this.chapterId && i_moduleId == this.moduleId
       })
-      console.log('查找到的curItem:', this.curPlayIndex);
+      // console.log('查找到的curItem:', this.curPlayIndex);
       let data = this.menuAllList[this.curPlayIndex+1];
       if (!data) {
         //第二个弹窗
-      }
-      console.log("放下一个", data)
-      this.moduleId = data.moduleId
-      this.chapterId = data.chapterId
-      this.sectionId = data.sectionId
-      if(data.sectionType == 1) { //录播
-        this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
-        this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
+        uni.showModal({
+          title: '温馨提示',
+          content: '当前最后一节视频已学完 请检查所有章节是否学习完成?',
+          showCancel: false,
+          success: (res) => {
+            if (res.confirm) {
+            }
+          }
+        })
+      } else {
+        uni.showModal({
+          title: '温馨提示',
+          content: '当前节视频已学完,继续学习下一节?',
+          success: async (res) => {
+            if (res.confirm) {
+              console.log("放下一个", data)
+              this.moduleId = data.moduleId
+              this.chapterId = data.chapterId
+              this.sectionId = data.sectionId
+              if(data.sectionType == 1) { //录播
+                this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
+                this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
 
-        this.sectionItem = data;
-        await this.getPhotoLastRecord() // 获取拍照历史
-        this.playVideo(data)
-      } else if(data.sectionType == 2) { //直播
-        this.studyRecordGetLastLive();
-      } else if(data.sectionType == 3) { //回放
-        this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
-        this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
-        this.sectionItem = data
-        this.playVideo(data)
+                this.sectionItem = data;
+                await this.getPhotoLastRecord() // 获取拍照历史
+                this.playVideo(data)
+              } else if(data.sectionType == 2) { //直播
+                this.studyRecordGetLastLive();
+              } else if(data.sectionType == 3) { //回放
+                this.$store.commit("setPlaySectionId", { playSectionId: data.sectionId })
+                this.$store.commit("setPlayVID", { playVID: data.recordingUrl })
+                this.sectionItem = data
+                this.playVideo(data)
+              }
+              let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
+              this.$store.commit("updatePlayNextId", playNextId);
+              this.updateChapterOpen(true)
+              this.reStart = false
+              this.getMenuList()
+            }
+          }
+        })
       }
-      let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
-      this.$store.commit("updatePlayNextId", playNextId);
-      // this.updateChapterOpen(true)
-      // this.$emit('openModuleTwo', data)\
-      data.id = data.moduleId
-      uni.$emit('openEmit', data)
-   },
+  },
 
     //拍照
     openPhoto() {