Pārlūkot izejas kodu

修复点播直播顺序,新增商品列表页全部按钮

Tang 2 gadi atpakaļ
vecāks
revīzija
462d6c2fea

+ 8 - 1
src/pages/bank-list/index.vue

@@ -31,7 +31,7 @@
                 </div>
               </div>
             </div>
-            <div class="course-classify__list" v-if="businessList.length > 0">
+            <div class="course-classify__list" v-if="businessList.length > 0 && params.educationTypeId">
               <div class="left-item">培训项目:</div>
               <div class="right-item">
                 <div class="list">
@@ -263,7 +263,14 @@ export default {
     },
 
     getEducationTypeList() {
+      let alls = {
+        educationName: "全部",
+        id: "",
+        status: 1,
+        sort: 0,
+      };
       this.$request.educationTypeList().then((res) => {
+        res.rows.unshift(alls);
         this.typeList = res.rows;
         if (!this.params.educationTypeId) {
           this.params.educationTypeId = res.rows[0].id;

+ 22 - 8
src/pages/course-detail/components/CourseTree.vue

@@ -842,10 +842,12 @@ export default {
         section.type != 2 &&
         this.isActive(section) &&
         section.sectionType != 3
+        && section.sectionType != 2
       ) {
         return;
       }
-      if (!(await this.orderTopTobottom(section, type, courseIndex))) {
+      if (!(await this.orderTopTobottom(section, type, courseIndex)) && section.sectionType != 2) {
+        console.log(section, type, courseIndex)
         this.clickLock = false;
         this.$message({
           type: "warning",
@@ -1068,7 +1070,9 @@ export default {
         });
     },
     async orderTopTobottom(section, type, courseIndex) {
-      let { rebuild, moduleId, chapterId } = section;
+      // let { rebuild, moduleId, chapterId } = section;
+      let { rebuild, moduleId, chapterId, parentId, menuId } = section;
+
       if (this.goodsLearningOrder != 2 || rebuild) {
         return true;
       }
@@ -1083,12 +1087,22 @@ export default {
       );
       type = type == 1 && section.type == 2 ? 2 : type;
       if (type == 1) {
-        let index = list.findIndex(
-          (e) =>
-            e.moduleId == moduleId &&
-            e.chapterId == chapterId &&
-            e.id == section.sectionId
-        );
+        if (parentId >= 0 && menuId >= 0) {
+          var index = list.findIndex((e) => {
+            return parentId
+              ? e.moduleId == moduleId &&
+                  e.chapterId == chapterId &&
+                  e.id == section.sectionId
+              : e.id == menuId;
+          });
+        } else {
+          var index = list.findIndex(
+            (e) =>
+              e.moduleId == moduleId &&
+              e.chapterId == chapterId &&
+              e.id == section.sectionId
+          );
+        }
         list = list.slice(0, index);
       } else if (type != 3) {
         list = list.filter(

+ 1 - 2
src/pages/course-detail/index.vue

@@ -3727,7 +3727,7 @@ export default {
       }
       if (option.sectionType == 2) {
         //直播
-
+        
         //提交保存观看历史
         if (this.playSectionId) {
           this.postStudyRecord(0, this.playSectionId);
@@ -3753,7 +3753,6 @@ export default {
         //设置播放的节ID
         await this.clears();
         this.vidzb = option.liveUrl;
-
         this.$router.push({
           path: "/living-room/" + option.liveUrl,
           query: {

+ 13 - 2
src/pages/course-list/index.vue

@@ -38,7 +38,10 @@
                 </div>
               </div>
             </div>
-            <div class="course-classify__list" v-if="businessList.length > 0">
+            <div
+              class="course-classify__list"
+              v-if="businessList.length > 0 && params.educationTypeId"
+            >
               <div class="left-item">培训项目:</div>
               <div class="right-item">
                 <div class="list">
@@ -168,7 +171,7 @@ export default {
         goodsType: 1,
         sortType: 1,
         searchKey: "",
-        showStatus: 1
+        showStatus: 1,
       },
       goodsList: [],
     };
@@ -314,8 +317,16 @@ export default {
      * 获取教育类型
      */
     getEducationTypeList() {
+      let alls = {
+        educationName: "全部",
+        id: "",
+        status: 1,
+        sort: 0,
+      };
       this.$request.educationTypeList().then((res) => {
+        res.rows.unshift(alls);
         this.typeList = res.rows;
+
         //有传入教育类型
         if (this.params.educationTypeId) {
           this.getBusinessList();

+ 14 - 4
src/pages/live-list/index.vue

@@ -38,7 +38,10 @@
                 </div>
               </div>
             </div>
-            <div class="course-classify__list" v-if="businessList.length > 0">
+            <div
+              class="course-classify__list"
+              v-if="businessList.length > 0 && params.educationTypeId"
+            >
               <div class="left-item">培训项目:</div>
               <div class="right-item">
                 <div class="list">
@@ -168,13 +171,13 @@ export default {
         goodsType: 6,
         sortType: 1,
         searchKey: "",
-        showStatus: 1
+        showStatus: 1,
       },
       goodsList: [],
     };
   },
   mounted() {
-    console.log(123)
+    console.log(123);
     this.params.goodsName = this.$route.query.searchKey || "";
     // this.params.searchKey = this.$route.query.searchKey || "";
     this.params.educationTypeId = this.$route.query.educationId || "";
@@ -294,13 +297,20 @@ export default {
       this.$request
         .businessList({ educationId: this.params.educationTypeId })
         .then((res) => {
-          this.businessList = res.rows.filter((item) => item.aliasName)
+          this.businessList = res.rows.filter((item) => item.aliasName);
           this.projectId = this.businessList[0].projectId;
         });
     },
 
     getEducationTypeList() {
+      let alls = {
+        educationName: "全部",
+        id: "",
+        status: 1,
+        sort: 0,
+      };
       this.$request.educationTypeList().then((res) => {
+        res.rows.unshift(alls);
         this.typeList = res.rows;
         if (!this.params.educationTypeId) {
           this.params.educationTypeId = res.rows[0].id;

+ 34 - 10
src/pages/person-center/my-course/index.vue

@@ -1317,7 +1317,7 @@ export default {
         learningStatus,
         learningTimeStart,
       } = this.goodsData;
-      console.log(interfaceAccountId,learnStatus,"xzx")
+      console.log(interfaceAccountId, learnStatus, "xzx");
       if (interfaceAccountId > 0) {
         learnStatus == 1
           ? this.rebuildSubmit(this.goodsData, section)
@@ -1355,7 +1355,10 @@ export default {
       if (!this.checkCanLearn(items)) {
         return false;
       }
-      if (!(await this.orderTopTobottom(courseItem, items, 99))) {
+      if (
+        !(await this.orderTopTobottom(courseItem, items, 99)) &&
+        items.sectionType != 2
+      ) {
         this.$message({
           type: "warning",
           message: "请按顺序学习视频课程",
@@ -1438,6 +1441,7 @@ export default {
               if (res.rows.length) {
                 // this.$emit("backData", item);
                 // this.dialogVisible = false;
+                console.log("可以学习");
                 this.comeStyle(courseItem, items);
                 // this.$router.push({
                 //   path: `/my-course-detail/${item.goodsId}`,
@@ -1492,8 +1496,7 @@ export default {
       });
     },
     async orderTopTobottom(courseLists, section, type) {
-      let { rebuild, moduleId, chapterId } = section;
-
+      let { rebuild, moduleId, chapterId, parentId, menuId } = section;
       if (this.goodsData.goodsLearningOrder != 2 || rebuild) {
         return true;
       }
@@ -1511,13 +1514,34 @@ export default {
         }
       }
       let list = await this.studyRecordMenuAllList(courseLists);
+      console.log(
+        "section:",
+        section,
+        "list:",
+        list,
+        "parentId:",
+        parentId,
+        "menuId:",
+        menuId
+      );
       if (type == 99) {
-        let index = list.findIndex(
-          (e) =>
-            e.moduleId == moduleId &&
-            e.chapterId == chapterId &&
-            e.id == section.sectionId
-        );
+        if (parentId >= 0 && menuId >= 0) {
+          var index = list.findIndex((e) => {
+            return parentId
+              ? e.moduleId == moduleId &&
+                  e.chapterId == chapterId &&
+                  e.id == section.sectionId
+              : e.id == menuId;
+          });
+        } else {
+          var index = list.findIndex(
+            (e) =>
+              e.moduleId == moduleId &&
+              e.chapterId == chapterId &&
+              e.id == section.sectionId
+          );
+        }
+
         list = list.slice(0, index);
       } else if (type != 3) {
         list = list.filter(