chenxiong před 3 roky
rodič
revize
ba9894f3aa

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

@@ -2447,6 +2447,7 @@ export default {
       isPlayRebuild: false,
       showRecordStatus: false,
       hasStart: false,
+      needOpen: true, //是否需要展开第一章节
     };
   },
   computed: {
@@ -2521,7 +2522,7 @@ export default {
     //     })
     //     .then((res) => {});
     // }
-
+    this.clears();
     clearInterval(this.postTimer);
     clearInterval(this.livingTimer);
   },
@@ -5025,6 +5026,7 @@ export default {
       }
       let self = this;
       console.log(this);
+      console.log(PlayDuration, "PlayDuration");
       let data = {
         photo: self.ossAvatarUrl,
         sectionId: parseInt(this.playSectionId),

+ 22 - 3
src/pages/course-list/index.vue

@@ -193,7 +193,6 @@ export default {
       this.getSubjectList();
     }
     this.getEducationTypeList();
-    this.changeSubject();
   },
   methods: {
     ...mapMutations(["getCartCount"]),
@@ -240,6 +239,9 @@ export default {
         });
     },
 
+    /**
+     * 切换教育类型
+     */
     changeType(item) {
       if (this.params.educationTypeId == item.id) {
         return;
@@ -254,6 +256,9 @@ export default {
       this.changeSubject();
     },
 
+    /**
+     * 切换科目分类
+     */
     changeSubject(item) {
       if (item) {
         if (this.params.subjectId != item.id) {
@@ -267,6 +272,9 @@ export default {
       });
     },
 
+    /**
+     * 获取科目分类
+     */
     getSubjectList() {
       this.$request
         .subjectList({
@@ -283,6 +291,9 @@ export default {
         });
     },
 
+    /**
+     * 切换业务层级
+     */
     changeBusiness(item) {
       if (this.params.subjectId == item.id) {
         return;
@@ -295,6 +306,9 @@ export default {
       this.getSubjectList();
     },
 
+    /**
+     * 获取业务层级
+     */
     getBusinessList() {
       this.$request
         .businessList({ educationId: this.params.educationTypeId })
@@ -304,15 +318,20 @@ export default {
         });
     },
 
+    /**
+     * 获取教育类型
+     */
     getEducationTypeList() {
       this.$request.educationTypeList().then((res) => {
         this.typeList = res.rows;
+        //有传入教育类型
         if (this.params.educationTypeId) {
           this.getBusinessList();
-        }else{
-          this.params.educationTypeId = res.rows[0].id
+        } else {
+          this.params.educationTypeId = res.rows[0].id;
           this.getBusinessList();
         }
+        this.changeSubject();
       });
     },
   },

+ 29 - 0
src/pages/goods-detail/bank-detail.vue

@@ -1749,8 +1749,37 @@ export default {
           }
         });
         this.bankList = res.data;
+        this.showAllCharpter();
       });
     },
+
+    /**
+     * 展示第一个章下的节内容
+     */
+    showAllCharpter() {
+      for (let i = 0; i < this.bankList.length; i++) {
+        if (this.bankList[i].type == 1) {
+          //第一个是模块直接展开,再展开章下面的节
+          this.$request
+            .goodsChapterList({
+              moduleExamId: this.bankList[i].majorId,
+            })
+            .then((res) => {
+              res.data.forEach((re) => {
+                re.list = [];
+              });
+              this.$set(this.bankList[i], "showList", true);
+              this.$set(this.bankList[i], "list", res.data);
+              this.chapterExam(this.bankList[i].list[0]);
+            });
+          break;
+        } else if (this.bankList[i].type == 2) {
+          //第一个章展开下面的节
+          this.chapterExam(this.bankList[i]);
+          break;
+        }
+      }
+    },
     collect() {
       this.$message({
         message: "试做题目,不支持收藏~",

+ 46 - 1
src/pages/goods-detail/course-detail.vue

@@ -497,6 +497,8 @@ export default {
       sectionItem: {},
       playCourseId: 0,
       recommendList: {}, //推荐课程
+      needOpen: true, //是否需要一进来展开第一章节
+      menuIndex: [], //需要展开的章节索引值
     };
   },
   mounted() {
@@ -593,6 +595,15 @@ export default {
           }
         }
         item.list = res.rows;
+
+        if (this.needOpen) {
+          if (item.list[this.menuIndex[1]].type == 1) {
+            this.openModule(item.list[this.menuIndex[1]]);
+          } else if (item.list[this.menuIndex[1]].type == 2) {
+            this.needOpen = false;
+            this.openChapter(item.list[this.menuIndex[1]]);
+          }
+        }
       });
     },
     /**
@@ -1112,6 +1123,11 @@ export default {
           item.menuType = 2;
         }
         Module.list = res.data;
+
+        if (this.needOpen) {
+          this.needOpen = false;
+          this.openChapter(Module.list[0]);
+        }
       });
     },
     /**
@@ -1404,12 +1420,41 @@ export default {
      * 获取课程章节列表
      */
     goodsCourseList() {
-      this.$request.goodsCourseList(this.goodsId).then((res) => {
+      this.$request.goodsCourseList(this.goodsId).then(async (res) => {
         res.rows.forEach((item) => {
           item.showList = false;
           item.list = [];
         });
         this.courseList = res.rows;
+
+        if (this.needOpen) {
+          for (let i = 0; i < this.courseList.length; i++) {
+            let menuIndexOrFalse = await this.getCourseMenus(
+              this.courseList[i]
+            );
+
+            if (menuIndexOrFalse !== false) {
+              this.menuIndex = [i, menuIndexOrFalse];
+              this.openCourse(this.courseList[i]);
+              break;
+            }
+          }
+        }
+      });
+    },
+
+    getCourseMenus(item) {
+      return new Promise((resolve) => {
+        this.$request.menuList({ courseId: item.courseId }).then((res) => {
+          if (res.code == 200) {
+            for (let i = 0; i < res.rows.length; i++) {
+              if (res.rows[i].type == 1 || res.rows[i].type == 2) {
+                resolve(i);
+                break;
+              }
+            }
+          }
+        });
       });
     },
     collect() {

+ 2 - 2
src/pages/person-center/my-order/index.vue

@@ -75,7 +75,7 @@
               </div>
               <div class="price-wrap">
                 <div class="btns">
-                  <div class="price-text">付金额</div>
+                  <div class="price-text">付金额</div>
                   <div class="price-number">¥{{ item.payPrice }}</div>
                 </div>
               </div>
@@ -145,7 +145,7 @@
               <div class="refund-wrap">
                 <div class="btns">
                   <div class="price-text">已退款</div>
-                  <div class="price-number">${{ item.refundFee }}</div>
+                  <div class="price-number">{{ item.refundFee }}</div>
                 </div>
               </div>
             </template>

+ 2 - 0
src/pages/person-center/play-record/index.vue

@@ -167,6 +167,7 @@ export default {
   },
   methods: {
     toFixed(num) {
+      console.log(num);
       if (num) {
         let str = String(num).indexOf(".");
 
@@ -234,6 +235,7 @@ export default {
         //     return a.createTime - b.createTime;
         //   });
         // }
+        console.log(dateObj, "dateObj");
         this.recordList = dateObj;
         this.total = res.total;
       });