谢杰标 2 vuotta sitten
vanhempi
commit
3e9c847533

+ 23 - 5
components/course/courseChapter.vue

@@ -170,10 +170,10 @@ export default {
   created() {},
   mounted() {
     // console.log('needOpen:', this.needOpen, this.chapterOpen);
-    if (this.needOpen && this.chapterOpen) {
-      this.updateChapterOpen(false);
-      this.openChapter(this.menuItem);
-    }
+    // if (this.needOpen && this.chapterOpen) {
+    //   this.updateChapterOpen(false);
+    //   this.openChapter(this.menuItem);
+    // }
   },
   onPageShow() {
     if (this.isBuy) {
@@ -566,7 +566,7 @@ export default {
       // 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);
+        console.log(item.id, 69);
         //获取章下面所有节试卷列表-course/sectionExamList
 
         this.$method.isLogin() &&
@@ -743,6 +743,24 @@ export default {
       return isAllLearn ? 1 : -1;
     },
   },
+  watch: {
+    courseId: {
+      handler(val) {
+        console.log(
+          "🚀 ~ file: courseChapter.vue:749 ~ handler ~ val:",
+          val,
+          this.needOpen
+        );
+        if (this.needOpen) {
+          this.down = true;
+          this.list = [];
+          this.updateChapterOpen(false);
+          this.openChapter(this.menuItem);
+        }
+      },
+      immediate: true,
+    },
+  },
 };
 </script>
 

+ 14 - 2
components/course/courseModule.vue

@@ -221,6 +221,7 @@ export default {
         });
     },
     getBuyChapterList(moduleId, courseId) {
+      console.log(moduleId, courseId, "moduleId, courseId");
       // course/chapterList
       this.$api
         .reChapterList({
@@ -340,11 +341,22 @@ export default {
       return isAllLearn ? 1 : -1;
     },
   },
+  mounted() {
+    // if (this.needOpen && this.chapterOpen) {
+    //   this.openModule(this.menuItem);
+    // }
+  },
   watch: {
     courseId: {
       handler(val) {
-        console.log("🚀 ~ file: courseModule.vue:346 ~ handler ~ val:", val)
-        if (this.needOpen && this.chapterOpen) {
+        console.log(
+          "🚀 ~ file: courseModule.vue:346 ~ handler ~ val:",
+          val,
+          this.menuItem
+        );
+        if (this.needOpen) {
+          this.down = true;
+          this.list = [];
           this.openModule(this.menuItem);
         }
       },

+ 1 - 1
pages3/polyv/detail.vue

@@ -2637,7 +2637,6 @@ export default {
         });
     },
     getMenuList() {
-      let self = this;
       this.$api
         .reMenuList({
           courseId: this.courseId,
@@ -2654,6 +2653,7 @@ export default {
               item.menuType = item.type;
             }
             this.menuList = res.data.rows;
+            console.log(this.menuList,789)
             this.reStart = true;
           }
         });