xuqiaoying 3 лет назад
Родитель
Сommit
5a64217b5d
1 измененных файлов с 26 добавлено и 24 удалено
  1. 26 24
      pages3/polyv/detail.vue

+ 26 - 24
pages3/polyv/detail.vue

@@ -1664,8 +1664,8 @@ export default {
           this.menuAllList = res.data.data
           console.log('请求后的this.menuAllList', this.menuAllList);
           this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
-          return Promise.resolve(this.menuAllList)          
         }
+        return Promise.resolve(this.menuAllList)  
 			})
 		},
 		getbaseprofiletplists() {
@@ -2713,7 +2713,6 @@ export default {
     },
    //播放下一节
     async nextSection(){
-      console.log('结束:', this.menuAllList);
       if(!this.menuAllList.length){
         return
       }
@@ -2724,31 +2723,46 @@ export default {
         return i_sectionId == this.playSectionId && i_chapterId == this.chapterId && i_moduleId == this.moduleId
       })
       let data = this.menuAllList[this.curPlayIndex+1];
-      console.log('data:', data);
       if (!data) {
-        // 如果是多课程
+        // 多课程
         if (this.goodsTeacher.length > 1) {
           let goodsIndex = this.goodsTeacher.findIndex((item) => {
             return item.courseList.find((e) => e.courseId == this.courseId)
           })
-          console.log('goodsIndex:', goodsIndex)
+          // console.log('goodsIndex:', goodsIndex)
           let nextCourse = this.goodsTeacher[goodsIndex + 1]
-          if (!nextCourse) {
+          if (!nextCourse) { // 多课程全部学完
             this.allLearnShow()
           } else {
-            console.log(']]]]]]');
-            this.courseId = this.goodsTeacher[nextCourse].courseList[0].courseId
-            console.log('---学完this.courseId:', this.courseId);
+            // 多课程-学习下一个课程
+            this.courseId = this.goodsTeacher[goodsIndex + 1].courseList[0].courseId
             await this.studyRecordMenuAllList()
-            console.log('---- this.menuAllList:',  this.menuAllList,)
+            this.learnNextSec(this.menuAllList[0])
           }
         } else {
-          //第二个弹窗
+          //单课程,学习结束,弹窗
           this.allLearnShow()
         }
         
       } else {
-        uni.showModal({
+        this.learnNextSec(data)
+      }
+    },
+    // 全部课程已学完
+    allLearnShow() {
+      uni.showModal({
+        title: '温馨提示',
+        content: '当前最后一节视频已学完,请检查所有章节是否学习完成?',
+        showCancel: false,
+        success: (res) => {
+          if (res.confirm) {
+          }
+        }
+      })
+    },
+    // 学习下一节
+    learnNextSec(data) {
+      uni.showModal({
           title: '温馨提示',
           content: '当前节视频已学完,继续学习下一节?',
           success: async (res) => {
@@ -2779,18 +2793,6 @@ export default {
             }
           }
         })
-      }
-    },
-    allLearnShow() {
-      uni.showModal({
-        title: '温馨提示',
-        content: '当前最后一节视频已学完,请检查所有章节是否学习完成?',
-        showCancel: false,
-        success: (res) => {
-          if (res.confirm) {
-          }
-        }
-      })
     },
     //拍照
     openPhoto() {