谢杰标 2 년 전
부모
커밋
9f67c4c8e7
4개의 변경된 파일65개의 추가작업 그리고 35개의 파일을 삭제
  1. 14 5
      components/course/courseChapter.vue
  2. 0 1
      components/course/courseModule.vue
  3. 2 1
      components/course/courseSection.vue
  4. 49 28
      pages3/polyv/detail.vue

+ 14 - 5
components/course/courseChapter.vue

@@ -283,7 +283,7 @@ export default {
       let learnNum = await this.goodsTodayStudySectionNum();
       // 检查用户是否学习过节 - /grade/grade/checkGoodsStudy
       let hasLearn = await this.gradeCheckGoodsStudy(id);
-     
+
       if (this.sectionMaxNum > 0) {
         if (learnNum >= this.sectionMaxNum && !hasLearn) {
           uni.showToast({
@@ -362,12 +362,22 @@ export default {
             title: "请按顺序学完视频课程再进行练习和测试",
           });
         }
-      } else if (this.learningOrder == 2 && !item.rebuild) {
-        let canLearn = this.list[index - 1].learning == 1;
+      } else if (this.learningOrder == 2) {
+        //  !item.rebuild
         let rows = this.menuAllList;
+        const index = this.menuAllList.findIndex((e) => {
+          let i_sectionId = e.sectionId || 0;
+          let i_chapterId = e.chapterId || 0;
+          let i_moduleId = e.moduleId || 0;
+          return (
+            i_sectionId == item.sectionId &&
+            i_chapterId == item.chapterId &&
+            i_moduleId == item.moduleId
+          );
+        });
         let isStop = false;
         let newRows = [];
-        for (let i = 0; i < rows.length; i++) {
+        for (let i = 0; i < index; i++) {
           let moduleTrue = rows[i].moduleId == moduleId;
           let chapterTrue = rows[i].chapterId == chapterId;
           if (moduleTrue && chapterTrue) {
@@ -390,7 +400,6 @@ export default {
         let isAllLearn = newRows.every((item) => {
           return item.studyStatus == 1;
         });
-
         if (isAllLearn) {
           //之前的都学完了
 

+ 0 - 1
components/course/courseModule.vue

@@ -262,7 +262,6 @@ export default {
       let isAllLearn = newRows.every((item) => {
         return item.studyStatus == 1;
       });
-
       if (isAllLearn) {
         uni.navigateTo({
           url:

+ 2 - 1
components/course/courseSection.vue

@@ -452,7 +452,8 @@ export default {
         return;
       }
       this.clickLock = true;
-      if (this.learningOrder == 2 && !this.menuItem.isRebuild && !this.isLive) {
+      // && !this.menuItem.isRebuild
+      if (this.learningOrder == 2 && !this.isLive) {
         //要按从头到尾顺序学习, 且不是重修课程
         if (this.preItem) {
           // let rows = await this.studyRecordMenuAllList();

+ 49 - 28
pages3/polyv/detail.vue

@@ -365,6 +365,7 @@
                 :orderGoodsId="orderGoodsId"
                 :sectionMaxNum="goodsData.sectionMaxNum"
                 :courseId="courseId"
+                :learningOrder="businessData.goodsLearningOrder"
                 :goodsId="goodsId"
                 :gradeId="gradeId"
                 :isRebuild="true"
@@ -381,6 +382,7 @@
               <courseChapter
                 :orderGoodsId="orderGoodsId"
                 :courseId="courseId"
+                :learningOrder="businessData.goodsLearningOrder"
                 :sectionMaxNum="goodsData.sectionMaxNum"
                 @playEnd="sectionPlayEnd($event, index)"
                 :gradeId="gradeId"
@@ -398,6 +400,7 @@
               <courseSection
                 :orderGoodsId="orderGoodsId"
                 :courseId="courseId"
+                :learningOrder="businessData.goodsLearningOrder"
                 :sectionMaxNum="goodsData.sectionMaxNum"
                 @playEnd="sectionPlayEnd($event, index)"
                 :gradeId="gradeId"
@@ -1645,8 +1648,45 @@ export default {
         });
         this.sectionItem = sectionItem;
         this.playVideo(sectionItem);
+      } else if (sectionItem.doType == 2) {
+        uni.showModal({
+          title: "温馨提示",
+          content: "当前节视频已学完,即将进入考试?",
+          showCancel: false,
+          success: (res) => {
+            if (res.confirm) {
+              this.toQuestionBank(sectionItem);
+            }
+          },
+        });
+        return;
       }
     },
+    toQuestionBank(sectionItem) {
+      uni.navigateTo({
+        url:
+          "/pages2/class/questionBank?courseId=" +
+          this.courseId +
+          "&gradeId=" +
+          this.gradeId +
+          "&isFromVideo=1&id=" +
+          sectionItem.id +
+          "&goodsid=" +
+          this.goodsId +
+          "&moduleId=" +
+          (sectionItem.moduleId || 0) +
+          "&chapterId=" +
+          (sectionItem.chapterId || 0) +
+          "&orderGoodsId=" +
+          this.orderGoodsId +
+          "&type=" +
+          (sectionItem.type == 4 ? 1 : 3) +
+          "&learning=" +
+          sectionItem.studyStatus +
+          "&isBackVideo=" +
+          1,
+      });
+    },
     studyRecordQueryLiveLast() {
       // /study/record/queryLiveLast
       this.$api
@@ -1657,13 +1697,16 @@ export default {
         })
         .then((res) => {
           let { data } = res.data;
-          console.log(data, 7789);
           if (!data.sectionId) {
             data = this.menuAllList[0];
           } else {
-            // if(data.learning==1){
-            //   return
-            // }
+            if (
+              data.learning == 1 &&
+              this.businessData.goodsLearningOrder == 2
+            ) {
+              let next = this.menuAllList.find((e) => e.studyStatus != 1);
+              next && (data = next);
+            }
           }
           this.initPlayVideo(data);
           // if (res.data.data) {
@@ -3277,29 +3320,7 @@ export default {
             content: "当前节视频已学完,是否进入考试?",
             success: (res) => {
               if (res.confirm) {
-                uni.navigateTo({
-                  url:
-                    "/pages2/class/questionBank?courseId=" +
-                    this.courseId +
-                    "&gradeId=" +
-                    this.gradeId +
-                    "&isFromVideo=1&id=" +
-                    data.id +
-                    "&goodsid=" +
-                    this.goodsId +
-                    "&moduleId=" +
-                    (data.moduleId || 0) +
-                    "&chapterId=" +
-                    (data.chapterId || 0) +
-                    "&orderGoodsId=" +
-                    this.orderGoodsId +
-                    "&type=" +
-                    (data.type == 4 ? 1 : 3) +
-                    "&learning=" +
-                    data.studyStatus +
-                    "&isBackVideo=" +
-                    1,
-                });
+                this.toQuestionBank(data);
               }
             },
           });
@@ -3642,7 +3663,7 @@ export default {
       // '/goods/'+ data,
       this.$api.goodsDetail(this.goodsId).then(async (res) => {
         this.goodsData = res.data.data;
-        await this.checkFinishRequiredCourse();
+        // await this.checkFinishRequiredCourse();
         if (self.goodsData.buyNote) {
           this.baseHandoutTipList();
         }