谢杰标 %!s(int64=3) %!d(string=hai) anos
pai
achega
8e3cf7569b

+ 3 - 54
src/pages/person-center/learn-center/GoodsItem.vue

@@ -156,21 +156,12 @@ export default {
     async toCourse() {
       let item = this.goodsInfo;
       // // 二建继教
-      // if (this.is2Education && !(await this.userConfirmInfoDetail())) {
-      //   return;
-      // }
+      if (this.is2Education && !(await this.userConfirmInfoDetail())) {
+        return;
+      }
       // if (item.rebuild == 0) {
       //   return this.$emit("openRebuld", item);
       // }
-      // let rebuildStatus = await this.courseGoodsRebuildStatus(
-      //   item.goodsId,
-      //   item.gradeId
-      // );
-
-      // if (rebuildStatus == 0) {
-      //   this.$refs.rebuildModal.showModal(item);
-      //   return;
-      // }
 
       this.$router.push({
         path: `/my-course-detail/${item.goodsId}`,
@@ -220,48 +211,6 @@ export default {
           });
       });
     },
-    async exceedLearnNum(courseLists, section) {
-      let learnNum = await this.goodsTodayStudySectionNum(section);
-      let hasLearn = await this.gradeCheckGoodsStudy(courseLists, section);
-
-      if (this.goodsData.sectionMaxNum > 0) {
-        if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
-          this.$message({
-            type: "warning",
-            message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
-          });
-          return false;
-        }
-      }
-      return true;
-    },
-    gradeCheckGoodsStudy(courseItem, option) {
-      return new Promise((resolve) => {
-        this.$request
-          .gradeCheckGoodsStudy({
-            goodsId: this.goodsData.goodsId,
-            gradeId: courseItem.gradeId,
-            moduleId: option.moduleId || 0,
-            chapterId: option.chapterId || 0,
-            sectionId: option.sectionId || option.menuId,
-          })
-          .then((res) => {
-            resolve(res.data);
-          });
-      });
-    },
-    goodsTodayStudySectionNum(option) {
-      return new Promise((resolve) => {
-        this.$request
-          .goodsTodayStudySectionNum({
-            goodsId: this.goodsData.goodsId,
-            gradeId: option.gradeId,
-          })
-          .then((res) => {
-            resolve(res.data);
-          });
-      });
-    },
   },
   computed: {
     goodsType() {

+ 13 - 11
src/pages/person-center/learn-center/goodsList.vue

@@ -45,14 +45,16 @@
         <template v-if="tab.name == '888'">
           <div
             class="goods-box"
-            v-for="tab in tabList.slice(1)"
-            :key="tab.lable"
+            v-for="item in tabList.slice(1)"
+            :key="item.lable"
           >
-            <h3>{{ tab.lable }}</h3>
-            <List-box :list="courseList"></List-box>
+            <template v-if="dataList[item.key].length">
+              <h3>{{ item.lable }}</h3>
+              <List-box :list="dataList[item.key]"></List-box
+            ></template>
           </div>
         </template>
-        <List-box v-else></List-box>
+        <List-box v-else :list="dataList[tab.key]"></List-box>
       </el-tab-pane>
     </el-tabs>
   </div>
@@ -68,11 +70,11 @@ export default {
       params: { businessId: "", educationTypeId: "", type: "888" },
       tabList: [
         { lable: "全部", name: "888" },
-        { lable: "视频", name: "1" },
-        { lable: "直播", name: "2" },
-        { lable: "题库", name: "6" },
+        { lable: "视频", name: "1", key: "courseList" },
+        { lable: "直播", name: "2", key: "liveList" },
+        { lable: "题库", name: "6", key: "examList" },
       ],
-      dataList: [],
+      dataList: { courseList: [], liveList: [], examList: [] },
       courseList: [],
     };
   },
@@ -114,13 +116,13 @@ export default {
       this.$request
         .courseGoodsList({ pageNum: 1, pageSize: 10 })
         .then((res) => {
-          this.courseList = res.rows;
+          this.dataList.courseList = res.rows;
         });
     },
   },
   created() {
     this.getEducationTypeList();
-    this.courseGoodsList()
+    this.courseGoodsList();
   },
   components: {
     ListBox,