Browse Source

fix:新增进入练习及考试按钮,修复已知漏洞

Tang 3 years ago
parent
commit
2d50de358f
1 changed files with 16 additions and 15 deletions
  1. 16 15
      src/pages/person-center/my-course/index.vue

+ 16 - 15
src/pages/person-center/my-course/index.vue

@@ -49,7 +49,7 @@
           >{{ item.name }}</el-button
         >
       </div>
-      <div v-for="(item, index) in filterList(courseList)" :key="index">
+      <div v-for="(item, index) in courseList" :key="index" v-show="item.subjectId === newActiveSubjectId || !newActiveSubjectId">
         <p class="firstTop hoverStyle" @click="changeStatus(item)">
           <span class="iconStyle">课</span
           ><span class="titles">{{ item.courseName }}</span
@@ -639,20 +639,20 @@ export default {
   },
   computed: {
     ...mapGetters(["userInfo"]),
-    filterList: function () {
-      return function (item) {
-        console.log(this.newActiveSubjectId);
-        let array = [];
-        if (this.newActiveSubjectId) {
-          array = item.filter((items) => {
-            return items.subjectId === this.newActiveSubjectId;
-          });
-        } else {
-          return item;
-        }
-        return array;
-      };
-    },
+    // filterList: function () {
+    //   return function (item) {
+    //     console.log(this.newActiveSubjectId);
+    //     let array = [];
+    //     if (this.newActiveSubjectId) {
+    //       array = item.filter((items) => {
+    //         return items.subjectId === this.newActiveSubjectId;
+    //       });
+    //     } else {
+    //       return item;
+    //     }
+    //     return array;
+    //   };
+    // },
   },
   mounted() {
     this.getRecord();
@@ -951,6 +951,7 @@ export default {
     changeChapterStatus(type, item, courseIndex, index, indexs) {
       return new Promise((resolve, reject) => {
         console.log(item, "定位");
+        console.log(type, item, courseIndex, index, indexs)
         if (item.children && item.children.length > 0) {
           item.showStatus = !item.showStatus;
           return;