chenxiong 3 anos atrás
pai
commit
d53dd629df

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

@@ -2153,7 +2153,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
-import { mapGetters,mapMutations } from "vuex";
+import { mapGetters, mapMutations } from "vuex";
 import * as baseUrls from "@/axios.js";
 import pdf from "vue-pdf";
 import print from "print-js";
@@ -2281,7 +2281,7 @@ export default {
         idcard_national_photo: "",
         commitment_electr_signature: "",
       },
-      recommendList:[],
+      recommendList: [],
       rules: {
         name: [
           {
@@ -2473,6 +2473,8 @@ export default {
       showRecordStatus: false,
       hasStart: false,
       needOpen: true, //是否需要展开第一章节
+      menuIndex: [],
+      clickLock: false,
     };
   },
   computed: {
@@ -4071,6 +4073,11 @@ export default {
             item.parent = menuItem;
           }
           menuItem.list = res.data;
+
+          if (this.needOpen) {
+            this.needOpen = false;
+            this.openChapter(menuItem.list[0]);
+          }
         });
     },
     openChapter(chapter) {
@@ -4381,6 +4388,10 @@ export default {
       }
 
       if (section.type != 2) {
+        if (this.clickLock) {
+          return;
+        }
+        this.clickLock = true;
         if (
           this.playSectionId &&
           (this.playSectionId == section.sectionId ||
@@ -4389,6 +4400,7 @@ export default {
           this.chapterId == (section.chapterId || 0)
         ) {
           //切换为同一频道不作为
+          this.clickLock = false;
           return;
         }
 
@@ -4424,6 +4436,7 @@ export default {
             if (isAllLearn) {
               this.initVideo(section);
             } else {
+              this.clickLock = false;
               this.$message({
                 type: "warning",
                 message: "请按顺序学习视频课程",
@@ -4495,6 +4508,7 @@ export default {
         );
         if (this.goodsData.sectionMaxNum > 0) {
           if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
+            this.clickLock = false;
             this.$message({
               type: "warning",
               message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
@@ -4503,6 +4517,7 @@ export default {
           }
         }
         if (!option.recordingUrl) {
+          this.clickLock = false;
           this.$message({
             type: "warning",
             message: `暂无播放地址数据`,
@@ -4526,6 +4541,7 @@ export default {
 
         if (this.goodsData.sectionMaxNum > 0) {
           if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
+            this.clickLock = false;
             this.$message({
               type: "warning",
               message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
@@ -4534,6 +4550,7 @@ export default {
           }
         }
         if (!option.liveUrl) {
+          this.clickLock = false;
           this.$message({
             type: "warning",
             message: `暂无直播地址数据`,
@@ -4596,6 +4613,9 @@ export default {
         this.vid = option.recordingUrl;
         this.hasStart = true;
         this.loadPlayerScript(this.loadPlayer);
+        setTimeout(() => {
+          this.clickLock = false;
+        }, 3000);
         // uni.$emit("levelId", this.levelId);
         // uni.$emit("getSection", this.menuItem);
         // uni.$emit("isRebuild", this.isRebuild);
@@ -4630,6 +4650,9 @@ export default {
         this.hasStart = true;
         this.vidzb = option.liveUrl;
         this.loadPlayerScriptzb(this.loadPlayerzb);
+        setTimeout(() => {
+          this.clickLock = false;
+        }, 3000);
         // uni.$emit("levelId", this.levelId);
         // uni.$emit("getChannel", this.menuItem);
         // uni.$emit("isRebuild", this.isRebuild);
@@ -5560,6 +5583,21 @@ export default {
             item.parent = this.menuList;
           }
           self.menuList = res.rows;
+
+          if (this.needOpen) {
+            for (let i = 0; i < res.rows.length; i++) {
+              if (res.rows[i].type == 1) {
+                this.menuIndex = [i];
+                this.openModule(this.menuList[i]);
+                break;
+              } else if (res.rows[i].type == 2) {
+                this.menuIndex = [i];
+                this.needOpen = false;
+                this.openChapter(this.menuList[i]);
+                break;
+              }
+            }
+          }
         });
     },
 

+ 18 - 1
src/pages/person-center/my-bank/bank-detail/index.vue

@@ -613,6 +613,7 @@ export default {
       collectTotal: 0,
       wrongTotal: 0,
       recommendList: [],
+      needOpen: true, //是否需要打开第一章节
     };
   },
   mounted() {
@@ -644,7 +645,7 @@ export default {
     /**
      * 跳转
      */
-    toGoodsDetail(item){
+    toGoodsDetail(item) {
       this.$router.push({
         path: "/bank-detail/" + item.goodsId,
         query: {
@@ -732,6 +733,17 @@ export default {
             }
           });
           this.bankList = res.data;
+
+          for (let i = 0; i < this.bankList.length; i++) {
+            if (this.bankList[i].type == 1) {
+              this.moduleExam(this.bankList[i]);
+              break;
+            } else if (this.bankList[i].type == 2) {
+              this.needOpen = false;
+              this.chapterExam(this.bankList[i], 0);
+              break;
+            }
+          }
         });
     },
 
@@ -756,6 +768,11 @@ export default {
           });
           Module.showList = !Module.showList;
           Module.list = res.data;
+
+          if (this.needOpen) {
+            this.needOpen = false;
+            this.chapterExam(Module.list[0], Module.majorId);
+          }
         });
     },
     /**

+ 6 - 4
src/pages/person-center/my-bank/index/index.vue

@@ -40,7 +40,9 @@
                   class="progress-line"
                   :stroke-width="16"
                   :format="progressText(item)"
-                  :percentage="(item.doNum / item.totalNum) * 100"
+                  :percentage="
+                    item.totalNum != 0 ? (item.doNum / item.totalNum) * 100 : 0
+                  "
                 ></el-progress>
               </div>
             </div>
@@ -139,9 +141,9 @@ export default {
         param.educationTypeId = this.activeName;
       }
       this.$request.listGoodsUserQuestion(param).then((res) => {
-        res.rows.forEach(item => {
-          console.log(`${item.goodsName}:${item.doNum}/${item.totalNum}`)
-        })
+        res.rows.forEach((item) => {
+          console.log(`${item.goodsName}:${item.doNum}/${item.totalNum}`);
+        });
         this.list = res.rows;
         this.total = res.total;
       });

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

@@ -872,8 +872,8 @@ export default {
         })
         .catch((err) => {
           this.$message({
-            type: "success",
-            message: res.msg,
+            type: "warning",
+            message: err.msg,
           });
         });
     },
@@ -937,7 +937,7 @@ export default {
         })
         .catch((err) => {
           this.$message({
-            type: "success",
+            type: "warning",
             message: err.msg,
           });
         });