Parcourir la source

修改答题切换头部样式

xiejiebiao il y a 2 ans
Parent
commit
a822d90079

+ 94 - 0
src/components/exam/HeaderTabBox.vue

@@ -0,0 +1,94 @@
+<template>
+  <div class="tab_exam__header">
+    <div class="title">{{ examInfo.examName }}</div>
+    <div class="tab_box">
+      <div class="text">
+        已完成 <span>{{ num }}</span
+        >/{{ allNum || examInfo.questionNum }} 道题
+      </div>
+      <div class="header_btns">
+        <div class="btn" @click="$emit('prevQuestion')">上一题</div>
+        <div class="btn" @click="$emit('nextQuestion')">下一题</div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    examId: { type: String },
+    num: {
+      type: Number,
+    },
+    allNum: {
+      type: Number,
+      default: 0,
+    },
+  },
+  data() {
+    return {
+      examInfo: {},
+    };
+  },
+  mounted() {
+    this.$request
+      .bankExam(this.$route.query.examId || this.examId)
+      .then((res) => {
+        this.examInfo = res.data;
+      });
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.tab_exam__header {
+  height: 60px;
+  padding: 0 22px;
+  border-bottom: 1px solid #eeeeee;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  .title {
+    font-weight: 500;
+    color: #222222;
+    font-size: 16px;
+  }
+  .tab_box {
+    display: flex;
+    align-items: center;
+  }
+  .header_btns {
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    border: 1px solid #3f8dfd;
+    border-radius: 4px;
+    .btn {
+      cursor: pointer;
+      width: 66px;
+      height: 28px;
+      background: #ffffff;
+      line-height: 28px;
+      text-align: center;
+      color: #3f8dfd;
+      border-radius: 4px;
+      &:nth-of-type(2) {
+        background: #3f8dfd;
+        color: #ffffff;
+        border-radius: 0;
+      }
+    }
+  }
+  .text {
+    margin-right: 20px;
+    font-size: 14px;
+    span {
+      font-family: Microsoft YaHei;
+      font-weight: bold;
+      color: #3f8dfd;
+      line-height: 24px;
+    }
+  }
+}
+</style>

+ 20 - 50
src/pages/bank-exam-all-explain/index.vue

@@ -17,26 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body clearfix">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -773,6 +758,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -780,6 +766,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox,
   },
   data() {
     return {
@@ -825,6 +812,7 @@ export default {
       chapterId: 0,
       current: 0,
       courseType: 1, //1题库,2视频 商品类型
+      examName: "",
     };
   },
   async mounted() {
@@ -833,8 +821,9 @@ export default {
     this.moduleId = this.$route.query.moduleId;
     this.chapterId = this.$route.query.chapterId;
     this.goodsId = this.$route.query.goodsId;
-    this.courseType = this.$route.query.courseType
+    this.courseType = this.$route.query.courseType;
     this.goodsQuestionList();
+    this.bankExam();
   },
   methods: {
     ...mapMutations(["setExamResult"]),
@@ -855,22 +844,26 @@ export default {
     changeIndex(index) {
       this.current = index;
     },
-
+    bankExam() {
+      this.$request.bankExam(this.examId).then((res) => {
+        this.examName = res.data.examName;
+      });
+    },
     /**
      * 请求题目列表
      */
     goodsQuestionList() {
-      if(this.courseType == 2){
+      if (this.courseType == 2) {
         this.$request.bankReportData(this.recordId).then(async (res) => {
-          this.questionList = res.data.historyExamJson ? JSON.parse(res.data.historyExamJson) : [];
+          this.questionList = res.data.historyExamJson
+            ? JSON.parse(res.data.historyExamJson)
+            : [];
         });
-        
-      }else{
+      } else {
         this.$request.examReport(this.recordId).then(async (res) => {
           this.questionList = JSON.parse(res.data.historyExamJson);
         });
       }
-      
     },
 
     nextQuestion() {
@@ -1141,29 +1134,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               .question {
                 padding: 12px 0 0 12px;

+ 7 - 43
src/pages/bank-exam-continue/index.vue

@@ -17,26 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -972,6 +957,7 @@ import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
 import CollectionBox from "@/components/common/CollectionBox.vue";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -980,6 +966,7 @@ export default {
     Header,
     ToolBar,
     CollectionBox,
+    HeaderTabBox
   },
   data() {
     return {
@@ -2019,29 +2006,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               .question {
                 padding: 12px 0 0 12px;

+ 7 - 43
src/pages/bank-exam-explain/index.vue

@@ -17,26 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <!-- <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div> -->
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -763,6 +748,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -770,6 +756,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox,
   },
   data() {
     return {
@@ -1182,29 +1169,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               border-bottom: 1px solid #eee;
 

+ 7 - 43
src/pages/bank-exam-wrong-explain/index.vue

@@ -17,26 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -773,6 +758,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -780,6 +766,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox
   },
   data() {
     return {
@@ -1173,29 +1160,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               border-bottom: 1px solid #eee;
 

+ 9 - 43
src/pages/bank-exam/index.vue

@@ -17,27 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body clearfix">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -1095,6 +1079,7 @@ import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
 import CollectionBox from "@/components/common/CollectionBox.vue";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -1103,6 +1088,7 @@ export default {
     Header,
     ToolBar,
     CollectionBox,
+    HeaderTabBox,
   },
   data() {
     return {
@@ -1162,6 +1148,7 @@ export default {
       collectList: [],
       isSubmit: false,
       postTimer: null,
+      examName: "",
     };
   },
   async mounted() {
@@ -1680,6 +1667,7 @@ export default {
       return new Promise((resolve) => {
         this.$request.bankExam(this.examId).then((res) => {
           this.bankType = res.data.doType;
+          this.examName = res.data.examName;
           this.examData = res.data;
           if (this.bankType == 2) {
             this.needBack = true;
@@ -2743,28 +2731,6 @@ export default {
             width: 970px;
             min-height: 630px;
             border: 1px solid #eee;
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
 
             &__body {
               .question {

+ 145 - 290
src/pages/course-detail/index.vue

@@ -286,7 +286,10 @@
                                                 <div
                                                   class="exercises"
                                                   @click.stop="
-                                                    getResource(section, 2)
+                                                    handelPracticeOrRxam(
+                                                      section,
+                                                      2
+                                                    )
                                                   "
                                                 >
                                                   习题
@@ -564,7 +567,10 @@
                                                 <div
                                                   class="exercises"
                                                   @click.stop="
-                                                    getResource(section, 2)
+                                                    handelPracticeOrRxam(
+                                                      section,
+                                                      2
+                                                    )
                                                   "
                                                 >
                                                   习题
@@ -753,7 +759,7 @@
                                           <div
                                             class="exercises"
                                             @click.stop="
-                                              getResource(menu, 2, true)
+                                              handelPracticeOrRxam(menu, 3)
                                             "
                                           >
                                             习题
@@ -2737,23 +2743,15 @@
       </div>
       <div v-for="(courseItem, index) in goodsTeacher" :key="index + 'one'">
         <div class="height_style">
-          <div
-            v-for="(item, index) in courseItem.courseList"
-            :key="index + 'two'"
-          >
+          <div v-for="(item, i) in courseItem.courseList" :key="i + 'two'">
             <div
               v-if="item.show == 1"
               class="list_style"
-              :style="
-                index % 2 != 1
-                  ? 'background-color:#F8F8F9;'
-                  : 'background-color:#fff;'
-              "
-              @click="activeFunc(item.courseId)"
+              @click="activeFunc(item.courseId, index)"
             >
-              <span style="font-weight: bold; font-size: 16px">{{
-                item.courseName
-              }}</span>
+              <span style="font-weight: bold; font-size: 16px"
+                >{{ item.courseName }}{{ i }}</span
+              >
               <!-- <span v-if="courseItem.teaList && courseItem.teaList.length > 0" v-for="(tea, index) in courseItem.teaList" :key="index">
             <el-button type="info" round>{{tea.aliasName}}</el-button>
           </span> -->
@@ -3333,10 +3331,23 @@ export default {
     /**
      * 确定选中
      */
-    activeFunc(item, index) {
-      console.log("------", item, index);
+    activeFunc(courseId, index) {
+      if (this.teaIndex == index) {
+        this.dialogVisible = false;
+        return;
+      }
+      if (index) {
+        let prevItem = this.courseList[index - 1];
+        if (prevItem.stuAllNum != prevItem.secAllNum ) {
+          return this.$message({
+            type: "warning",
+            message: "需按课程顺序学习",
+          });
+        }
+      }
+
       this.teaIndex = index || 0;
-      this.courseId = item;
+      this.courseId = courseId;
       this.courseChange();
       this.dialogVisible = false;
     },
@@ -5307,6 +5318,7 @@ export default {
         console.log("直播的用户学习日志:", res);
       });
     },
+    // 节卷不需要控制
     handelPracticeOrRxam(section, type) {
       if (type == 3) {
         //节卷
@@ -5321,33 +5333,55 @@ export default {
         let data = this.sectionExam.filter(
           (x) => x.sectionId == section.sectionId
         );
+
         if (data && data.length > 0) {
           section = data[0];
         }
       }
-      // 节卷不需要控制
+      this.$router.push({
+        path: "/course-exam/" + this.goodsId,
+        query: {
+          courseId: this.courseId,
+          gradeId: this.gradeId,
+          moduleId: section.moduleId || 0,
+          sectionId: section.sectionId || 0,
+          examId: section.typeId,
+          learning: section.learning,
+          type: type,
+          chapterId: section.chapterId || 0,
+          orderGoodsId: this.orderGoodsId,
+        },
+      });
+    },
+    async exceedLearnNum(section) {
+      let learnNum = await this.goodsTodayStudySectionNum();
+      let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
+
+      if (this.goodsData.sectionMaxNum > 0) {
+        if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
+          this.$message({
+            type: "warning",
+            message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
+          });
+          return false;
+        }
+      }
+      return true;
     },
     /**
      * 点击节
      */
-    async getResource(section, type, flag) {
-      // return
-      if (flag) {
-        //节卷
-        let data = this.sectionExamList.filter(
-          (x) => x.sectionId == section.menuId
-        );
-        if (data && data.length > 0) {
-          section = data[0];
-        }
-      } else if (type == 2) {
-        //节卷
-        let data = this.sectionExam.filter(
-          (x) => x.sectionId == section.sectionId
-        );
-        if (data && data.length > 0) {
-          section = data[0];
-        }
+    async getResource(section, type) {
+      if (!(await this.orderTopTobottom(section, type))) {
+        this.clickLock = false;
+        this.$message({
+          type: "warning",
+          message:
+            section.type == 2
+              ? "请学完视频课程再进行练习和测试"
+              : "请按顺序学习视频课程",
+        });
+        return false;
       }
       this.clickSectionItem = section;
       //逻辑
@@ -5365,221 +5399,65 @@ export default {
           return;
         }
       }
+
       if (section.type == 2) {
         //试卷
-        let learnNum = await this.goodsTodayStudySectionNum();
-        let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
-
-        if (this.goodsData.sectionMaxNum > 0) {
-          if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
-            this.$message({
-              type: "warning",
-              message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
-            });
-            return;
-          }
+        // 学习次数
+        if (!(await this.exceedLearnNum(section))) {
+          return false;
         }
 
-        if (this.businessData.goodsLearningOrder == 1) {
-          if (section.parent.canLearn) {
-            console.log(section.parent, "section.parent");
-            let num = await this.bankRecordDoNum(section);
-            //有次数限制
-            if (section.answerNum - num > 0 && section.answerNum > 0) {
-              // this.$set(this.list[index],'doNum',(item.doNum+1))
-              this.$router.push({
-                path: "/course-exam/" + this.goodsId,
-                query: {
-                  courseId: this.courseId,
-                  gradeId: this.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.orderGoodsId,
-                },
-              });
-
-              //没有答题次数限制
-            } else if (section.answerNum == 0) {
-              this.$router.push({
-                path: "/course-exam/" + this.goodsId,
-                query: {
-                  courseId: this.courseId,
-                  gradeId: this.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.orderGoodsId,
-                },
-              });
-            } else {
-              this.$message({
-                type: "warning",
-                message: "该试卷只能答题" + section.answerNum + "次",
-              });
-
-              return;
-            }
-            this.studyLog(
-              (section.moduleId = 0),
-              (section.chapterId = 0),
-              section.typeId
-            );
-          } else {
-            this.$message({
-              type: "warning",
-              message: "请按顺序学完视频课程再进行练习和测试",
-            });
-          }
-        } else if (
-          this.businessData.goodsLearningOrder == 2 &&
-          !section.rebuild
-        ) {
-          let rows = await this.studyRecordMenuAllList();
-          let isStop = false;
-          let newRows = [];
-          for (let i = 0; i < rows.length; i++) {
-            let moduleTrue = rows[i].moduleId == section.moduleId;
-            let chapterTrue = rows[i].chapterId == section.chapterId;
-            if (moduleTrue && chapterTrue) {
-              isStop = true;
-              if (rows[i].sectionType != 2) {
-                //忽略直播
-                newRows.push(rows[i]);
-              }
-            } else {
-              if (!isStop) {
-                if (rows[i].sectionType != 2) {
-                  //忽略直播
-                  newRows.push(rows[i]);
-                }
-              } else {
-                break;
-              }
-            }
-          }
-          console.log(newRows);
-          let isAllLearn = newRows.every((item) => {
-            return item.studyStatus == 1;
+        let num =
+          this.businessData.goodsLearningOrder != 2 || section.rebuild
+            ? await this.bankRecordDoNum(section.typeId)
+            : section.doNum;
+        if (section.answerNum - num > 0 && section.answerNum > 0) {
+          this.$router.push({
+            path: "/course-exam/" + this.goodsId,
+            query: {
+              courseId: this.courseId,
+              gradeId: this.gradeId,
+              moduleId: section.moduleId || 0,
+              sectionId: section.sectionId || 0,
+              examId: section.typeId,
+              learning: section.learning,
+              type: type,
+              chapterId: section.chapterId || 0,
+              orderGoodsId: this.orderGoodsId,
+            },
+          });
+          //没有答题次数限制
+        } else if (section.answerNum == 0) {
+          this.$router.push({
+            path: "/course-exam/" + this.goodsId,
+            query: {
+              courseId: this.courseId,
+              gradeId: this.gradeId,
+              moduleId: section.moduleId || 0,
+              sectionId: section.sectionId || 0,
+              examId: section.typeId,
+              learning: section.learning,
+              type: type,
+              chapterId: section.chapterId || 0,
+              orderGoodsId: this.orderGoodsId,
+            },
           });
-
-          if (isAllLearn) {
-            //之前的都学完了
-
-            // if(canLearn) { //视频的上一节学完
-
-            let num = await this.bankRecordDoNum(section.typeId);
-            //有次数限制
-            if (section.answerNum - num > 0 && section.answerNum > 0) {
-              console.log(this.list[index]);
-              this.$router.push({
-                path: "/course-exam/" + this.goodsId,
-                query: {
-                  courseId: this.courseId,
-                  gradeId: this.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.orderGoodsId,
-                },
-              });
-              //没有答题次数限制
-            } else if (section.answerNum == 0) {
-              this.$router.push({
-                path: "/course-exam/" + this.goodsId,
-                query: {
-                  courseId: this.courseId,
-                  gradeId: this.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.orderGoodsId,
-                },
-              });
-            } else {
-              this.$message({
-                type: "warning",
-                message: "该试卷只能答题" + section.answerNum + "次",
-              });
-
-              return;
-            }
-            this.studyLog(
-              (section.moduleId = 0),
-              (section.chapterId = 0),
-              section.typeId
-            );
-          } else {
-            this.$message({
-              type: "warning",
-              message: "请学完视频课程再进行练习和测试",
-            });
-          }
         } else {
-          let num = await this.bankRecordDoNum(section.typeId);
-          //有次数限制
-          if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
-            // this.$set(this.list[index],'doNum',(item.doNum+1))
-            this.$router.push({
-              path: "/course-exam/" + this.goodsId,
-              query: {
-                courseId: this.courseId,
-                gradeId: this.gradeId,
-                moduleId: section.moduleId || 0,
-                sectionId: section.sectionId || 0,
-                examId: section.typeId,
-                type: type,
-                chapterId: section.chapterId || 0,
-                orderGoodsId: this.orderGoodsId,
-              },
-            });
-
-            //没有答题次数限制
-          } else if (section.answerNum == 0) {
-            this.$router.push({
-              path: "/course-exam/" + this.goodsId,
-              query: {
-                courseId: this.courseId,
-                gradeId: this.gradeId,
-                moduleId: section.moduleId || 0,
-                sectionId: section.sectionId || 0,
-                examId: section.typeId,
-                learning: section.learning,
-                type: type,
-                chapterId: section.chapterId || 0,
-                orderGoodsId: this.orderGoodsId,
-              },
-            });
-          } else {
-            this.$message({
-              type: "warning",
-              message: "该试卷只能答题" + section.answerNum + "次",
-            });
+          this.$message({
+            type: "warning",
+            message: "该试卷只能答题" + section.answerNum + "次",
+          });
 
-            return;
-          }
-          this.studyLog(
-            (section.moduleId = 0),
-            (section.chapterId = 0),
-            section.typeId
-          );
+          return;
         }
+        this.studyLog(
+          (section.moduleId = 0),
+          (section.chapterId = 0),
+          section.typeId
+        );
         return;
       }
       if (section.type != 2) {
-        console.log(this.clickLock);
         if (this.clickLock) {
           return;
         }
@@ -5593,60 +5471,37 @@ export default {
           this.chapterId == (section.chapterId || 0)
         ) {
           //切换为同一频道不作为
-          console.log("切换为同一频道不作为");
           this.clickLock = false;
           return;
         }
-        if (this.businessData.goodsLearningOrder == 2 && !section.isRebuild) {
-          //要按从头到尾顺序学习, 且不是重修课程
-
-          let rows = await this.studyRecordMenuAllList();
-          console.log(rows, "rows");
-          if (this.hasPreItem(rows, section)) {
-            //判断是否有上一节
-            let newRows = [];
-            for (let i = 0; i < rows.length; i++) {
-              let moduleTrue =
-                rows[i].moduleId == section.moduleId || rows[i].moduleId == 0;
-              let chapterTrue =
-                rows[i].chapterId == section.chapterId ||
-                rows[i].chapterId == 0;
-              let sectionTrue =
-                rows[i].sectionId == section.sectionId ||
-                rows[i].sectionId == section.menuId;
-              if (moduleTrue && chapterTrue && sectionTrue) {
-                break;
-              } else {
-                if (rows[i].sectionType != 2) {
-                  newRows.push(rows[i]);
-                }
-              }
-            }
-
-            let isAllLearn = newRows.every((item) => {
-              return item.studyStatus == 1;
-            });
-            if (isAllLearn) {
-              this.initVideo(section);
-            } else {
-              this.clickLock = false;
-              this.$message({
-                type: "warning",
-                message: "请按顺序学习视频课程",
-              });
-            }
-          } else {
-            console.log(section, "sectionsectionsectionsectionsectionsection");
-            //第一章第一节
-            this.initVideo(section);
-          }
-        } else {
-          console.log(section, "sectionsection");
-          this.initVideo(section);
-        }
+        this.initVideo(section);
       }
     },
+    async orderTopTobottom(section, type) {
+      let { rebuild, moduleId, chapterId } = section;
+
+      if (this.businessData.goodsLearningOrder != 2 || rebuild) {
+        return true;
+      }
+
+      let list = await this.studyRecordMenuAllList();
 
+      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
+        );
+        list = list.slice(0, index);
+      } else if (type != 3) {
+        list = list.filter(
+          (e) => e.moduleId == moduleId && e.chapterId == chapterId
+        );
+      }
+      return list.every((item) => item.studyStatus == 1);
+    },
     bankRecordDoNum(section) {
       return new Promise((resolve) => {
         this.$request

+ 7 - 62
src/pages/course-exam/index.vue

@@ -17,26 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -1138,6 +1123,7 @@ import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
 import CollectionBox from "@/components/common/CollectionBox.vue";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -1146,6 +1132,7 @@ export default {
     Header,
     ToolBar,
     CollectionBox,
+    HeaderTabBox,
   },
   data() {
     return {
@@ -2573,29 +2560,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               border-bottom: 1px solid #eee;
 
@@ -2852,25 +2816,6 @@ export default {
                 }
               }
             }
-
-            &__footer {
-              height: 40px;
-              display: flex;
-              justify-content: space-around;
-              align-items: center;
-
-              .btn {
-                cursor: pointer;
-                width: 140px;
-                height: 32px;
-                background: #ffffff;
-                border: 1px solid #3f8dfd;
-                border-radius: 16px;
-                line-height: 32px;
-                text-align: center;
-                color: #3f8dfd;
-              }
-            }
           }
 
           .right-box {

+ 7 - 20
src/pages/goods-detail/bank-detail.vue

@@ -319,21 +319,11 @@
           >X</a
         >
         <div class="left-box">
-          <div class="left-box__header">
-            <el-progress
-              class="progress"
-              :text-inside="true"
-              :stroke-width="26"
-              :percentage="
-                toFixed((questionOverNum(true) / questionList.length) * 100) ||
-                0
-              "
-            ></el-progress>
-            <div class="text">
-              已完成<span>{{ questionOverNum(true) }}</span
-              >/{{ questionList.length }}道题
-            </div>
-          </div>
+          <Header-tab-box
+            :num="questionOverNum(true)"
+            @prevQuestion="prevQuestion"
+            @nextQuestion="nextQuestion"
+          ></Header-tab-box>
           <div class="left-box__body">
             <template v-for="(question, questionIndex) in questionList">
               <div
@@ -989,11 +979,6 @@
               </div>
             </template>
           </div>
-
-          <div class="left-box__footer">
-            <div class="btn" @click="prevQuestion">上一题</div>
-            <div class="btn" @click="nextQuestion">下一题</div>
-          </div>
         </div>
         <div class="right-box">
           <div class="right-box__header">答题卡</div>
@@ -1063,6 +1048,7 @@ import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
 import GoodsItem from "@/components/goodsItem/index";
 import IndexSkuDialog from "@/components/goodsItem/IndexSkuDialog.vue";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "GoodsDetail",
@@ -1072,6 +1058,7 @@ export default {
     ToolBar,
     GoodsItem,
     IndexSkuDialog,
+    HeaderTabBox,
   },
   data() {
     return {

+ 7 - 43
src/pages/mock-exam-all-explain/index.vue

@@ -17,26 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body clearfix">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -773,6 +758,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -780,6 +766,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox
   },
   data() {
     return {
@@ -1128,29 +1115,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               .question {
                 padding: 12px 0 0 12px;

+ 7 - 43
src/pages/mock-exam-wrong-explain/index.vue

@@ -17,26 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -773,6 +758,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -780,6 +766,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox
   },
   data() {
     return {
@@ -1156,29 +1143,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               border-bottom: 1px solid #eee;
 

+ 7 - 44
src/pages/mock-exam/index.vue

@@ -17,27 +17,11 @@
           <div class="explain-record">
             <div class="explain-record__body clearfix">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -1079,6 +1063,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations, mapGetters, mapActions } from "vuex";
 export default {
   name: "BankExplain",
@@ -1086,6 +1071,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox
   },
   computed: {
     ...mapGetters(["sysTime"]),
@@ -2659,29 +2645,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               .question {
                 padding: 12px 0 0 12px;

+ 4 - 0
src/pages/person-center/free-bank/bank-detail/index.vue

@@ -389,6 +389,7 @@
                             type="primary"
                             @click="
                               go('/subject/collect-type-bank/' + item.type, {
+                                examId: item.examId,
                                 orderGoodsId: orderGoodsId,
                               })
                             "
@@ -401,6 +402,7 @@
                             type="primary"
                             @click="
                               go('/subject/collect-type-bank/' + item.type, {
+                                examId:item.examId,
                                 explain: 1,
                                 orderGoodsId: orderGoodsId,
                               })
@@ -484,6 +486,7 @@
                             class="btn"
                             @click="
                               go('/subject/wrong-bank/' + item.examId, {
+                                examId: item.examId,
                                 orderGoodsId: orderGoodsId,
                               })
                             "
@@ -497,6 +500,7 @@
                             @click="
                               go('/subject/wrong-bank/' + item.examId, {
                                 explain: 1,
+                                examId: item.examId,
                                 orderGoodsId: orderGoodsId,
                               })
                             "

+ 0 - 23
src/pages/person-center/free-bank/bank-explain-detail/index.vue

@@ -1132,29 +1132,6 @@ export default {
             width: 810px;
             border-right: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               min-height: 490px;
               border-bottom: 1px solid #eee;

+ 2 - 0
src/pages/person-center/my-bank/bank-detail/index.vue

@@ -389,6 +389,7 @@
                             type="primary"
                             @click="
                               go('/subject/collect-type-bank/' + item.type, {
+                                examId:item.examId,
                                 orderGoodsId: orderGoodsId,
                               })
                             "
@@ -402,6 +403,7 @@
                             @click="
                               go('/subject/collect-type-bank/' + item.type, {
                                 explain: 1,
+                                examId:item.examId,
                                 orderGoodsId: orderGoodsId,
                               })
                             "

+ 0 - 23
src/pages/person-center/my-bank/bank-explain-detail/index.vue

@@ -1132,29 +1132,6 @@ export default {
             width: 810px;
             border-right: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               min-height: 490px;
               border-bottom: 1px solid #eee;

+ 4 - 0
src/pages/person-center/my-collect/index.vue

@@ -84,6 +84,7 @@
                         type="primary"
                         @click="
                           go('/subject/collect-bank/' + item.examId, {
+                            examId:item.examId,
                             orderGoodsId: orderGoodsId,
                           })
                         "
@@ -97,6 +98,7 @@
                         @click="
                           go('/subject/collect-bank/' + item.examId, {
                             explain: 1,
+                            examId:item.examId,
                             orderGoodsId: orderGoodsId,
                           })
                         "
@@ -132,6 +134,7 @@
                         type="primary"
                         @click="
                           go('/subject/collect-type-bank/' + item.type, {
+                            examId:item.examId,
                             orderGoodsId: orderGoodsId,
                           })
                         "
@@ -145,6 +148,7 @@
                         @click="
                           go('/subject/collect-type-bank/' + item.type, {
                             explain: 1,
+                            examId:item.examId,
                             orderGoodsId: orderGoodsId,
                           })
                         "

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

@@ -244,7 +244,9 @@
                                 size="mini"
                                 type="text"
                                 style="width: 90px !important"
-                                @click="getResource(item, is, 2)"
+                                @click="
+                                  handelPracticeOrRxam(is, 2, item.courseId)
+                                "
                                 >习题</el-button
                               >
                             </el-col>
@@ -432,7 +434,7 @@
                             size="mini"
                             type="text"
                             style="width: 90px !important"
-                            @click="getResource(item, i, 2)"
+                            @click="handelPracticeOrRxam(i, 2, item.courseId)"
                             >习题</el-button
                           >
                         </el-col>
@@ -594,7 +596,7 @@
                         size="mini"
                         type="text"
                         style="width: 90px !important"
-                        @click="getResource(item, items, 2, true)"
+                        @click="handelPracticeOrRxam(items, 2, item.courseId)"
                         >习题</el-button
                       >
                     </el-col>
@@ -1247,21 +1249,19 @@ export default {
             orderGoodsId: this.goodsData.orderGoodsId,
           })
           .then((res) => {
-            let newArr = res.data.filter((item) => {
-              return item.type != 2;
-            });
-            let canLearn = newArr.every((item) => {
-              if (item.learning == 1) {
-                return true;
-              } else {
-                return false;
-              }
-            });
-            res.data.forEach((section) => {
-              section.canLearn = canLearn;
-            });
-            console.log(teacherIndex, "teacherIndex");
-            console.log(courseIndex, "courseIndex");
+            // let newArr = res.data.filter((item) => {
+            //   return item.type != 2;
+            // });
+            // let canLearn = newArr.every((item) => {
+            //   if (item.learning == 1) {
+            //     return true;
+            //   } else {
+            //     return false;
+            //   }
+            // });
+            // res.data.forEach((section) => {
+            //   section.canLearn = canLearn;
+            // });
             if (type === 1) {
               this.$set(
                 this.goodsTeacher[teacherIndex].courseList[courseIndex]
@@ -1329,17 +1329,18 @@ export default {
       }
       return index === -1;
     },
-    checkLearnOrder(course) {
-      let goodsLearningOrder = 2;
-      // 非按顺序学习以及重修
-      if (goodsLearningOrder != 2 || course.isRebuild) {
-        return true;
-      }
-    },
     async studyFunc(courseItem, items) {
+      console.log(items);
       if (!this.checkCanLearn()) {
         return false;
       }
+      if (!(await this.orderTopTobottom(courseItem, items, 99))) {
+        this.$message({
+          type: "warning",
+          message: "请按顺序学习视频课程",
+        });
+        return false;
+      }
       let item = this.goodsData;
       var confirmDetail = true;
       if (item.educationName == "继续教育") {
@@ -1435,7 +1436,7 @@ export default {
             });
         });
     },
-    handelPracticeOrRxam(section, type) {
+    handelPracticeOrRxam(section, type, courseId) {
       if (type == 3) {
         //节卷
         let data = this.sectionExamList.filter(
@@ -1449,6 +1450,7 @@ export default {
         let data = this.sectionExam.filter(
           (x) => x.sectionId == section.sectionId
         );
+
         if (data && data.length > 0) {
           section = data[0];
         }
@@ -1456,7 +1458,7 @@ export default {
       this.$router.push({
         path: "/course-exam/" + this.goodsData.goodsId,
         query: {
-          courseId: courseLists.courseId,
+          courseId: courseId,
           gradeId: this.goodsData.gradeId,
           moduleId: section.moduleId || 0,
           sectionId: section.sectionId || 0,
@@ -1468,252 +1470,122 @@ export default {
         },
       });
     },
-    async getResource(courseLists, section, type, flag) {
-      //type:1章卷,2节卷,3模考卷,4习题
-      console.log(courseLists, section);
-      if (!this.checkCanLearn()) {
-        return false;
-      }
+    async orderTopTobottom(courseLists, section, type) {
+      let { rebuild, moduleId, chapterId } = section;
 
-      if (flag) {
-        let data = this.sectionExamList.filter(
-          (x) => (x.sectionId = section.menuId)
+      if (this.goodsData.goodsLearningOrder != 2 || rebuild) {
+        return true;
+      }
+      // 课程顺序
+      if (this.courseList.length > 1) {
+        let index = this.courseList.findIndex(
+          (e) => e.courseId == courseLists.courseId
         );
-        if (data && data.length > 0) {
-          section = data[0];
-        } else {
-          section.typeId = "";
+        if (index) {
+          let prevItem = this.courseList[index - 1]; //上一课
+          if (prevItem.stuAllNum != prevItem.secAllNum) {
+            return false;
+          }
         }
-      } else if (type && type == 2) {
-        let data = this.sectionExam.filter(
-          (x) => (x.sectionId = section.sectionId)
+      }
+      let list = await this.studyRecordMenuAllList(courseLists);
+      if (type == 99) {
+        let 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(
+          (e) => e.moduleId == moduleId && e.chapterId == chapterId
         );
-        if (data && data.length > 0) {
-          section = data[0];
-        } else {
-          section.typeId = "";
-        }
       }
-      console.log(courseLists, section);
-      return;
-      if (section.type == 2) {
-        //试卷
-        console.log("试卷");
-        console.log(courseLists, section, this.goodsData);
-        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;
-          }
-        }
-        console.log(this.businessData, "this.businessData");
-        if (this.businessData.goodsLearningOrder == 1) {
-          if (section.canLearn) {
-            let num = await this.bankRecordDoNum(courseLists, section);
-            //有次数限制
-            if (section.answerNum - num > 0 && section.answerNum > 0) {
-              // this.$set(this.list[index],'doNum',(item.doNum+1))
-              this.$router.push({
-                path: "/course-exam/" + this.goodsData.goodsId,
-                query: {
-                  courseId: courseLists.courseId,
-                  gradeId: this.goodsData.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.goodsData.orderGoodsId,
-                },
-              });
-
-              //没有答题次数限制
-            } else if (section.answerNum == 0) {
-              this.$router.push({
-                path: "/course-exam/" + this.goodsData.goodsId,
-                query: {
-                  courseId: courseLists.courseId,
-                  gradeId: this.goodsData.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.goodsData.orderGoodsId,
-                },
-              });
-            } else {
-              this.$message({
-                type: "warning",
-                message: "该试卷只能答题" + section.answerNum + "次",
-              });
+      return list.every((item) => item.studyStatus == 1);
+    },
+    async exceedLearnNum(courseLists, section) {
+      let learnNum = await this.goodsTodayStudySectionNum(section);
+      let hasLearn = await this.gradeCheckGoodsStudy(courseLists, section);
 
-              return;
-            }
-            this.studyLog(
-              (section.moduleId = 0),
-              (section.chapterId = 0),
-              section.typeId,
-              courseLists
-            );
-          } else {
-            this.$message({
-              type: "warning",
-              message: "请按顺序学完视频课程再进行练习和测试",
-            });
-          }
-        } else if (
-          this.businessData.goodsLearningOrder == 2 &&
-          !section.rebuild
-        ) {
-          let rows = await this.studyRecordMenuAllList(courseLists);
-          let isStop = false;
-          let newRows = [];
-          for (let i = 0; i < rows.length; i++) {
-            let moduleTrue = rows[i].moduleId == section.moduleId;
-            let chapterTrue = rows[i].chapterId == section.chapterId;
-            if (moduleTrue && chapterTrue) {
-              isStop = true;
-              if (rows[i].sectionType != 2) {
-                //忽略直播
-                newRows.push(rows[i]);
-              }
-            } else {
-              if (!isStop) {
-                if (rows[i].sectionType != 2) {
-                  //忽略直播
-                  newRows.push(rows[i]);
-                }
-              } else {
-                break;
-              }
-            }
-          }
-          console.log(newRows);
-          let isAllLearn = newRows.every((item) => {
-            return item.studyStatus == 1;
+      if (this.goodsData.sectionMaxNum > 0) {
+        if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
+          this.$message({
+            type: "warning",
+            message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
           });
+          return false;
+        }
+      }
+      return true;
+    },
+    async getResource(courseLists, section, type) {
+      //type:1章卷,2节卷,3模考卷,4习题
+      if (!this.checkCanLearn()) {
+        return false;
+      }
+      // 学习次数
+      if (!(await this.exceedLearnNum(courseLists, section))) {
+        return false;
+      }
 
-          if (isAllLearn) {
-            //之前的都学完了
-
-            // if(canLearn) { //视频的上一节学完
-
-            let num = await this.bankRecordDoNum(courseLists, section);
-            //有次数限制
-            if (section.answerNum - num > 0 && section.answerNum > 0) {
-              console.log(this.list[index]);
-              this.$router.push({
-                path: "/course-exam/" + this.goodsData.goodsId,
-                query: {
-                  courseId: courseLists.courseId,
-                  gradeId: this.goodsData.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.goodsData.orderGoodsId,
-                },
-              });
-              //没有答题次数限制
-            } else if (section.answerNum == 0) {
-              this.$router.push({
-                path: "/course-exam/" + this.goodsData.goodsId,
-                query: {
-                  courseId: courseLists.courseId,
-                  gradeId: this.goodsData.gradeId,
-                  moduleId: section.moduleId || 0,
-                  sectionId: section.sectionId || 0,
-                  examId: section.typeId,
-                  learning: section.learning,
-                  type: type,
-                  chapterId: section.chapterId || 0,
-                  orderGoodsId: this.goodsData.orderGoodsId,
-                },
-              });
-            } else {
-              this.$message({
-                type: "warning",
-                message: "该试卷只能答题" + section.answerNum + "次",
-              });
-
-              return;
-            }
-            this.studyLog(
-              (section.moduleId = 0),
-              (section.chapterId = 0),
-              section.typeId,
-              courseLists
-            );
-          } else {
-            this.$message({
-              type: "warning",
-              message: "请学完视频课程再进行练习和测试",
-            });
-          }
-        } else {
-          let num = await this.bankRecordDoNum(courseLists, section);
-          //有次数限制
-          if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
-            // this.$set(this.list[index],'doNum',(item.doNum+1))
-            this.$router.push({
-              path: "/course-exam/" + this.goodsData.goodsId,
-              query: {
-                courseId: courseLists.courseId,
-                gradeId: this.goodsData.gradeId,
-                moduleId: section.moduleId || 0,
-                sectionId: section.sectionId || 0,
-                examId: section.typeId,
-                learning: section.learning,
-                type: type,
-                chapterId: section.chapterId || 0,
-                orderGoodsId: this.goodsData.orderGoodsId,
-              },
-            });
+      // 学习顺序
 
-            //没有答题次数限制
-          } else if (section.answerNum == 0) {
-            this.$router.push({
-              path: "/course-exam/" + this.goodsData.goodsId,
-              query: {
-                courseId: courseLists.courseId,
-                gradeId: this.goodsData.gradeId,
-                moduleId: section.moduleId || 0,
-                sectionId: section.sectionId || 0,
-                examId: section.typeId,
-                learning: section.learning,
-                type: type,
-                chapterId: section.chapterId || 0,
-                orderGoodsId: this.goodsData.orderGoodsId,
-              },
-            });
-          } else {
-            this.$message({
-              type: "warning",
-              message: "该试卷只能答题" + section.answerNum + "次",
-            });
+      if (!(await this.orderTopTobottom(courseLists, section, type))) {
+        this.$message({
+          type: "warning",
+          message: "请学完视频课程再进行练习和测试",
+        });
+        return false;
+      }
+      //有次数限制
+      let num = await this.bankRecordDoNum(courseLists, section);
+      // section.doNum
+      if (section.answerNum - num > 0 && section.answerNum > 0) {
+        this.$router.push({
+          path: "/course-exam/" + this.goodsData.goodsId,
+          query: {
+            courseId: courseLists.courseId,
+            gradeId: this.goodsData.gradeId,
+            moduleId: section.moduleId || 0,
+            sectionId: section.sectionId || 0,
+            examId: section.typeId,
+            learning: section.learning,
+            type: type,
+            chapterId: section.chapterId || 0,
+            orderGoodsId: this.goodsData.orderGoodsId,
+          },
+        });
+        //没有答题次数限制
+      } else if (section.answerNum == 0) {
+        this.$router.push({
+          path: "/course-exam/" + this.goodsData.goodsId,
+          query: {
+            courseId: courseLists.courseId,
+            gradeId: this.goodsData.gradeId,
+            moduleId: section.moduleId || 0,
+            sectionId: section.sectionId || 0,
+            examId: section.typeId,
+            learning: section.learning,
+            type: type,
+            chapterId: section.chapterId || 0,
+            orderGoodsId: this.goodsData.orderGoodsId,
+          },
+        });
+      } else {
+        this.$message({
+          type: "warning",
+          message: "该试卷只能答题" + section.answerNum + "次",
+        });
 
-            return;
-          }
-          this.studyLog(
-            (section.moduleId = 0),
-            (section.chapterId = 0),
-            section.typeId,
-            courseLists
-          );
-        }
         return;
       }
+      this.studyLog(
+        (section.moduleId = 0),
+        (section.chapterId = 0),
+        section.typeId,
+        courseLists
+      );
     },
     //校验节是否有试卷
     checkSection(sectionId, key) {
@@ -1776,6 +1648,7 @@ export default {
             goodsId: this.goodsData.goodsId,
           })
           .then((res) => {
+            res.data = res.data.filter((e) => e.sectionType != 2);
             resolve(res.data);
           });
       });

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

@@ -84,6 +84,7 @@
                         type="primary"
                         @click="
                           go('/subject/wrong-bank/' + item.examId, {
+                            examId:item.examId,
                             orderGoodsId: orderGoodsId,
                           })
                         "
@@ -97,6 +98,7 @@
                         @click="
                           go('/subject/wrong-bank/' + item.examId, {
                             explain: 1,
+                            examId:item.examId,
                             orderGoodsId: orderGoodsId,
                           })
                         "

+ 9 - 44
src/pages/subject/collect-bank.vue

@@ -17,27 +17,12 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  :allNum="questionList.length"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -973,6 +958,7 @@ import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
 import CollectionBox from "@/components/common/CollectionBox.vue";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -981,6 +967,7 @@ export default {
     Header,
     ToolBar,
     CollectionBox,
+    HeaderTabBox
   },
   data() {
     return {
@@ -1024,7 +1011,7 @@ export default {
     };
   },
   async mounted() {
-    this.examId = this.$route.params.examId;
+    this.examId = this.$route.query.examId;
     this.explain = this.$route.query.explain || "";
     this.orderGoodsId = this.$route.query.orderGoodsId || "";
     this.collectQuestionExamQuestionList();
@@ -1769,28 +1756,6 @@ export default {
             width: 970px;
             min-height: 630px;
             border: 1px solid #eee;
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
 
             &__body {
               // border-bottom: 1px solid #eee;

+ 8 - 42
src/pages/subject/collect-type-bank.vue

@@ -17,26 +17,12 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  @prevQuestion="prevQuestion"
+                  :allNum="questionList.length"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -978,6 +964,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -985,6 +972,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox
   },
   data() {
     return {
@@ -1718,28 +1706,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
 
             &__body {
               border-bottom: 1px solid #eee;

+ 8 - 43
src/pages/subject/wrong-bank.vue

@@ -17,26 +17,12 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  :allNum="questionList.length"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -978,6 +964,7 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 import { mapMutations } from "vuex";
 export default {
   name: "BankExplain",
@@ -985,6 +972,7 @@ export default {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox 
   },
   data() {
     return {
@@ -1730,29 +1718,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               border-bottom: 1px solid #eee;
 

+ 8 - 45
src/pages/subject/wrong-type-bank.vue

@@ -17,27 +17,12 @@
           <div class="explain-record">
             <div class="explain-record__body">
               <div class="left-box">
-                <div class="left-box__header">
-                  <el-progress
-                    class="progress"
-                    :text-inside="true"
-                    :stroke-width="26"
-                    :percentage="
-                      toFixed(
-                        (questionOverNum(true) / questionList.length) * 100
-                      ) || 0
-                    "
-                  ></el-progress>
-                  <div class="text">
-                    已完成<span>{{ questionOverNum(true) }}</span
-                    >/{{ questionList.length }}道题
-                  </div>
-                </div>
-
-                <div class="left-box__footer">
-                  <div class="btn" @click="prevQuestion">上一题</div>
-                  <div class="btn" @click="nextQuestion">下一题</div>
-                </div>
+                <Header-tab-box
+                  :num="questionOverNum(true)"
+                  :allNum="questionList.length"
+                  @prevQuestion="prevQuestion"
+                  @nextQuestion="nextQuestion"
+                ></Header-tab-box>
                 <div class="left-box__body">
                   <template v-for="(question, questionIndex) in questionList">
                     <div
@@ -979,13 +964,14 @@
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
-import { mapMutations } from "vuex";
+import HeaderTabBox from "../../components/exam/HeaderTabBox.vue";
 export default {
   name: "BankExplain",
   components: {
     Footer,
     Header,
     ToolBar,
+    HeaderTabBox
   },
   data() {
     return {
@@ -1721,29 +1707,6 @@ export default {
             min-height: 630px;
             border: 1px solid #eee;
 
-            &__header {
-              height: 40px;
-              padding-left: 12px;
-              border-bottom: 1px solid #eeeeee;
-              display: flex;
-              align-items: center;
-
-              .progress {
-                width: 636px;
-              }
-
-              .text {
-                margin-left: 15px;
-                font-size: 16px;
-                span {
-                  font-family: Microsoft YaHei;
-                  font-weight: bold;
-                  color: #3f8dfd;
-                  line-height: 24px;
-                }
-              }
-            }
-
             &__body {
               border-bottom: 1px solid #eee;