aaa 4 سال پیش
والد
کامیت
8d67b2731b
3فایلهای تغییر یافته به همراه17 افزوده شده و 6 حذف شده
  1. 2 2
      src/views/home/index.vue
  2. 13 3
      src/views/home/learn/page-learn-child.vue
  3. 2 1
      src/views/home/learn/page-learn.vue

+ 2 - 2
src/views/home/index.vue

@@ -74,10 +74,10 @@ export default {
       this.$store.commit("updateUserItemStore", {
         field: "userInfo",
         value: {
-          id: "testuser-ztdxxDGdNj",
+          id: "testuser-DHjjEuxXbN",
           encodedPassword: "string",
           userStatus: "suspended",
-          userName: "testuser-ztdxxDGdNj",
+          userName: "testuser-DHjjEuxXbN",
           email: "test@gmail.com",
           firstName: "一",
           lastName: "张",

+ 13 - 3
src/views/home/learn/page-learn-child.vue

@@ -31,7 +31,7 @@
                 <div>
                   {{
                     formateDateTimeFun(contentItem.createdTime) ||
-                      contentItem.createdTime
+                    contentItem.createdTime
                   }}
                 </div>
                 <div>
@@ -81,6 +81,12 @@ export default {
           this.getContentList();
         }
       }
+    },
+    active(val, oldVal) {
+      if (val !== oldVal) {
+        console.log("--active--" + this.active);
+        this.getContentList();
+      }
     }
   },
   methods: {
@@ -94,6 +100,12 @@ export default {
       let path = {
         categoryId: this.learnChildList[this.choosedChildIndex].id
       };
+      console.log(
+        "--active--" +
+          this.active +
+          "--categoryId--" +
+          this.learnChildList[this.choosedChildIndex].id
+      );
       this.$_http
         .get(
           this.$pathParams(
@@ -103,8 +115,6 @@ export default {
         )
         .then(res => {
           this.contentList = res.data;
-          //   移除第一个
-          this.contentList.shift();
           console.log("--child--", this.contentList);
           this.finished = true;
         })

+ 2 - 1
src/views/home/learn/page-learn.vue

@@ -51,14 +51,15 @@ export default {
     },
     //   查询子目录
     getChildList() {
+      this.learnChildList = [];
       let path = {
         categoryId: this.learnRootList[this.choosedRootIndex].id
       };
       this.$_http
         .get(this.$pathParams(this.$_API.JTXT_GET_CATEGORIES_CATEGROYID, path))
         .then(res => {
-          console.log(res);
           this.learnChildList = res.data;
+          console.log("--child--" + JSON.stringify(this.learnChildList));
           //   移除第一个根目录
           this.learnChildList.shift();
         })