Jelajahi Sumber

Merge branch 'dev'

xuqiaoying 3 tahun lalu
induk
melakukan
46e3e0a671

+ 2 - 2
build/webpack.prod.conf.js

@@ -36,8 +36,8 @@ const webpackConfig = merge(baseWebpackConfig, {
       uglifyOptions: {
         compress: {
           warnings: false,
-          drop_debugger: true
-          // drop_console: false
+          drop_debugger: true,
+          drop_console: true
         }
       },
       sourceMap: config.build.productionSourceMap,

+ 7 - 1
src/apis/course.js

@@ -133,7 +133,13 @@ export default {
 			params: data
 		})
 	},
-
+	reSectionExamList(data) {
+		return request({
+			url: '/course/sectionExamList',
+			method: 'get',
+			params: data
+		})
+	},
   reChapterList(data) {
 		return request({
 			url: '/course/chapterList',

+ 2 - 2
src/axios.js

@@ -1,12 +1,12 @@
 import axios from 'axios'
 import store from './store'
 import { Message } from 'element-ui'
-export const BASE_URL = 'https://api.xyyxt.net'   //release
+// export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://192.168.1.7:5055'    //dev
 // export const BASE_URL = 'http://192.168.1.24:5055'    //dev
-// export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
+export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //测试
 export const tenantId = '867735392558919680'

+ 3 - 1
src/common/tools.js

@@ -128,7 +128,9 @@ export default {
 	 * @returns {*}
 	 */
 	timestampToTime(timestamp, isDay = true,hasChinese) {
-		console.log('timestampToTime---', timestamp)
+		if (!timestamp) {
+			return ''
+		}
 		var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
 		var Y = date.getFullYear() + (hasChinese ? '' : '-');
 		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + (hasChinese ? '' : '-');

+ 132 - 83
src/pages/bank-exam/index.vue

@@ -92,6 +92,13 @@
                             }"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
+                            @click="
+                              radioSelect(
+                                question,
+                                questionIndex,
+                                item.optionsId
+                              )
+                            "
                           >
                             <div>
                               {{ ast[index] }}. {{ item.content }}
@@ -136,6 +143,7 @@
                         </div>
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 2 && current == questionIndex"
@@ -170,7 +178,7 @@
                         </div>
                         <div class="question-list" v-if="question.ques">
                           <el-checkbox
-                            disabled
+                            :disabled='bankType == 2 ? false : true'
                             class="checkbox"
                             :class="{
                               right:
@@ -221,7 +229,7 @@
                       </div>
                       <div class="question__btns">
                         <div
-                          v-if="!question.ques"
+                          v-if="bankType == 2 || (bankType == 1 && !question.ques)"
                           class="submit"
                           @click="checkboxSubmit(question, questionIndex)"
                         >
@@ -242,6 +250,7 @@
                         </div>
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 3 && current == questionIndex"
@@ -287,6 +296,7 @@
                             }"
                             v-for="(item, index) in judge"
                             :key="index"
+                            @click="judgeSelect(question, questionIndex, index)"
                           >
                             <div>
                               {{ ast[index] }}. {{ item }}
@@ -332,6 +342,7 @@
                         </div>
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 4 && current == questionIndex"
@@ -412,6 +423,13 @@
                                     }"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"
+                                    @click="
+                                      radioSelectChild(
+                                        questionIndex,
+                                        jsonIndex,
+                                        item.optionsId
+                                      )
+                                    "
                                   >
                                     <div>
                                       {{ ast[index] }}. {{ item.content }}
@@ -457,6 +475,7 @@
                               </div>
                               <div class="question__btns"></div>
                             </div>
+
                             <div
                               class="question"
                               v-if="json.type == 2"
@@ -500,7 +519,7 @@
                                   v-if="question.ques[jsonIndex]"
                                 >
                                   <el-checkbox
-                                    disabled
+                                    :disabled="bankType == 2 ? false : true"
                                     class="checkbox"
                                     :class="{
                                       right:
@@ -574,7 +593,7 @@
                               </div>
                               <div class="question__btns">
                                 <div
-                                  v-if="!question.ques[jsonIndex]"
+                                  v-if="bankType == 2 || (bankType == 1 && !question.ques[jsonIndex])"
                                   class="submit"
                                   @click="
                                     checkboxSubmitChild(
@@ -587,6 +606,7 @@
                                 </div>
                               </div>
                             </div>
+
                             <div
                               class="question"
                               v-if="json.type == 3"
@@ -648,6 +668,13 @@
                                     }"
                                     v-for="(item, index) in judge"
                                     :key="index"
+                                    @click="
+                                      judgeSelectChild(
+                                        questionIndex,
+                                        jsonIndex,
+                                        index
+                                      )
+                                    "
                                   >
                                     <div>
                                       {{ ast[index] }}. {{ item }}
@@ -708,12 +735,12 @@
                                 <div
                                   class="question-list textarea"
                                   v-if="
-                                    !(
+                                    bankType == 2 || ( bankType == 1 && !(
                                       question.ques[jsonIndex] &&
                                       (question.ques[jsonIndex].imageList
                                         .length ||
                                         question.ques[jsonIndex].text)
-                                    )
+                                    ))
                                   "
                                 >
                                   <el-input
@@ -793,12 +820,12 @@
                               <div class="question__btns">
                                 <div
                                   v-if="
-                                    !(
+                                    bankType == 2 || ( bankType == 1 && !(
                                       question.ques[jsonIndex] &&
                                       (question.ques[jsonIndex].imageList
                                         .length ||
                                         question.ques[jsonIndex].text)
-                                    )
+                                    ))
                                   "
                                   class="submit"
                                   @click="
@@ -832,6 +859,7 @@
                         </div>
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 5 && current == questionIndex"
@@ -848,8 +876,8 @@
                         <div
                           class="question-list textarea"
                           v-if="
-                            !question.ques.imageList.length &&
-                            !question.ques.text
+                            bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
+                            !question.ques.text)
                           "
                         >
                           <el-input
@@ -915,8 +943,8 @@
                       <div class="question__btns">
                         <div
                           v-if="
-                            !question.ques.imageList.length &&
-                            !question.ques.text
+                            bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
+                            !question.ques.text)
                           "
                           class="submit"
                           @click="ansSubmit(question, questionIndex)"
@@ -1001,10 +1029,11 @@
                           v-for="(item, index) in questionList"
                           :key="index"
                           :class="{
-                            green: isRight(item, index),
-                            red: isWrong(item, index),
-                            yellow: isPart(item, index),
-                            blue: isOver(item, index),
+                            green: bankType == 1 && isRight(item, index),
+                            red: bankType == 1 && isWrong(item, index),
+                            yellow: bankType == 1 && isPart(item, index),
+                            blue: bankType == 1 && isOver(item, index),
+                            check_ans: bankType == 2 && isCheck(item, index),
                           }"
                           @click="changeIndex(index)"
                         >
@@ -1627,26 +1656,29 @@ export default {
      * 单选点击确认
      */
     radioSelect(question, questionIndex, optionsId) {
-      if (this.questionList[questionIndex].ques) return;
+      // if (this.questionList[questionIndex].ques) return;
+      if (this.questionList[questionIndex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex], "ques", optionsId);
       this.isDoOver();
 
-      if (
-        this.questionList[questionIndex].ques !=
-        this.questionList[questionIndex].ans
-      ) {
-        this.$request
-          .examWrongRecord({
-            orderGoodsId: this.orderGoodsId,
-            examId: this.examId,
-            goodsId: this.goodsId,
-            moduleExamId: this.moduleId || 0,
-            chapterExamId: this.chapterId || 0,
-            questionIds: [this.questionList[questionIndex].questionId],
-            recordId: this.recordId,
-          })
-          .then((res) => {});
-      }
+      // if (
+      //   this.questionList[questionIndex].ques !=
+      //   this.questionList[questionIndex].ans
+      // ) {
+      //   this.$request
+      //     .examWrongRecord({
+      //       orderGoodsId: this.orderGoodsId,
+      //       examId: this.examId,
+      //       goodsId: this.goodsId,
+      //       moduleExamId: this.moduleId || 0,
+      //       chapterExamId: this.chapterId || 0,
+      //       questionIds: [this.questionList[questionIndex].questionId],
+      //       recordId: this.recordId,
+      //     })
+      //     .then((res) => {});
+      // }
     },
 
     /**
@@ -1654,7 +1686,10 @@ export default {
      * 案例单选点击
      */
     radioSelectChild(questionIndex, jsonIndex, optionsId) {
-      if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      // if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
       this.isDoOver();
     },
@@ -1662,7 +1697,10 @@ export default {
      * 多选点击确认
      */
     checkboxSubmit(question, questionIndex) {
-      if (this.questionList[questionIndex].ques) return;
+      // if (this.questionList[questionIndex].ques) return;
+      if (this.questionList[questionIndex].ques && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[questionIndex].jsonStr.forEach((item) => {
         if (item.checked) {
@@ -1670,6 +1708,7 @@ export default {
         }
       });
       if (!arr.length) {
+        delete this.questionList[questionIndex].ques
         this.$message({
           type: "warning",
           message: "请选择答案",
@@ -1679,38 +1718,34 @@ export default {
       this.$set(this.questionList[questionIndex], "ques", arr);
       this.isDoOver();
 
-      // let isWrong = this.questionList[questionIndex].ques.some(
-      //   (quesItem, quesIndex) => {
-      //     return (
-      //       this.questionList[questionIndex].ques[quesIndex] !=
-      //       this.questionList[questionIndex].ans[quesIndex]
-      //     );
-      //   }
-      // );
-      let isWrong = this.questionList[questionIndex].ques.some((item, i) => {
-        return this.questionList[questionIndex].ans.indexOf(item) == -1;
-      })
-      // 回答错误
-      if (isWrong) {
-        this.$request
-          .examWrongRecord({
-            orderGoodsId: this.orderGoodsId,
-            examId: this.examId,
-            goodsId: this.goodsId,
-            moduleExamId: this.moduleId || 0,
-            chapterExamId: this.chapterId || 0,
-            questionIds: [this.questionList[questionIndex].questionId],
-            recordId: this.recordId,
-          })
-          .then((res) => {});
-      }
+
+      // let isWrong = this.questionList[questionIndex].ques.some((item, i) => {
+      //   return this.questionList[questionIndex].ans.indexOf(item) == -1;
+      // })
+      // // 回答错误
+      // if (isWrong) {
+      //   this.$request
+      //     .examWrongRecord({
+      //       orderGoodsId: this.orderGoodsId,
+      //       examId: this.examId,
+      //       goodsId: this.goodsId,
+      //       moduleExamId: this.moduleId || 0,
+      //       chapterExamId: this.chapterId || 0,
+      //       questionIds: [this.questionList[questionIndex].questionId],
+      //       recordId: this.recordId,
+      //     })
+      //     .then((res) => {});
+      // }
     },
     /**
      * @param {Object}
      * 案例多选确认
      */
     checkboxSubmitChild(questionIndex, ansIndex) {
-      if (this.questionList[questionIndex].ques[ansIndex]) return;
+      // if (this.questionList[questionIndex].ques[ansIndex]) return;
+      if (this.questionList[questionIndex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
         (item) => {
@@ -1721,6 +1756,7 @@ export default {
       );
 
       if (!arr.length) {
+        delete this.questionList[questionIndex].ques[ansIndex]
         this.$message({
           type: "warning",
           message: "请选择答案",
@@ -1735,30 +1771,36 @@ export default {
      * 判断点击确认
      */
     judgeSelect(question, questionIndex, index) {
-      if (question.ques) return;
+      // if (question.ques) return;
+      if (question.ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex], "ques", index + "");
       this.isDoOver();
 
-      if (
-        this.questionList[questionIndex].ques !=
-        this.questionList[questionIndex].ans
-      ) {
-        this.$request
-          .examWrongRecord({
-            orderGoodsId: this.orderGoodsId,
-            examId: this.examId,
-            goodsId: this.goodsId,
-            moduleExamId: this.moduleId || 0,
-            chapterExamId: this.chapterId || 0,
-            questionIds: [this.questionList[questionIndex].questionId],
-            recordId: this.recordId,
-          })
-          .then((res) => {});
-      }
+      // if (
+      //   this.questionList[questionIndex].ques !=
+      //   this.questionList[questionIndex].ans
+      // ) {
+      //   this.$request
+      //     .examWrongRecord({
+      //       orderGoodsId: this.orderGoodsId,
+      //       examId: this.examId,
+      //       goodsId: this.goodsId,
+      //       moduleExamId: this.moduleId || 0,
+      //       chapterExamId: this.chapterId || 0,
+      //       questionIds: [this.questionList[questionIndex].questionId],
+      //       recordId: this.recordId,
+      //     })
+      //     .then((res) => {});
+      // }
     },
     judgeSelectChild(questionIndex, jsonIndex, index) {
       console.log(this.questionList[questionIndex].ques[jsonIndex]);
-      if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      // if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
       this.isDoOver();
     },
@@ -1931,6 +1973,11 @@ export default {
         this.getCollectInfo(this.current);
       }
     },
+    isCheck(item, index) {
+      if (this.questionList[index].ques) {
+        return true
+      }
+    },
     isRight(item, index) {
       //单选
       if (this.questionList[index].ques) {
@@ -2703,12 +2750,15 @@ export default {
                       border-radius: 8px;
                       box-sizing: border-box;
 
-                      &.right, &.user_choose {
+                      &.right {
                         background: #37c65b;
                       }
                       &.wrong {
                         background: #ff3a30;
                       }
+                      &.user_choose {
+                        background: #007aff;
+                      }
                     }
                     &.textarea {
                       margin-right: 12px;
@@ -2982,7 +3032,7 @@ export default {
                       &.yellow {
                         background: #ffc53d;
                       }
-                      &.blue {
+                      &.blue, &.check_ans {
                         background: #3f8dfd;
                       }
                     }
@@ -3039,8 +3089,7 @@ export default {
                         background: #ff3a30;
                       }
 
-                      &.blue {
-                        border: 1rpx solid #eeeeee;
+                      &.blue, &.check_ans {
                         color: #fff;
                         background: #3f8dfd;
                       }

+ 18 - 0
src/pages/bank-report/index.vue

@@ -2,6 +2,17 @@
   <div class="bank-report">
     <Header></Header>
     <section class="section">
+      <!-- <div class="re_back">
+        <el-button
+          type="primary"
+          plain
+          round
+          size="mini"
+          class="back-btn"
+          @click="$router.back(-1)"
+          >返回</el-button
+        >
+      </div> -->
       <div class="container">
         <div
           class="section__header section__header--warm"
@@ -430,6 +441,13 @@ export default {
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style scoped lang="scss">
 .bank-report {
+  .re_back {
+    text-align: right;
+    margin: 10px 0px;
+    .back-btn {
+      width: 100px;
+    }
+  }
   .section {
     &__header {
       height: 120px;

+ 166 - 17
src/pages/course-detail/index.vue

@@ -106,6 +106,7 @@
                                         :key="chapterIndex"
                                       >
                                         <div
+                                          v-if="chapter.type == 1"
                                           class="bank-chapter__item__text"
                                           @click="openChapter(chapter)"
                                         >
@@ -122,7 +123,7 @@
 
                                         <div
                                           class="bank-section"
-                                          v-if="chapter.showList"
+                                          v-if="chapter.showList && chapter.type == 1"
                                         >
                                           <div
                                             class="bank-section__item"
@@ -133,7 +134,7 @@
                                               section, sectionIndex
                                             ) in chapter.list"
                                             :key="sectionIndex"
-                                            @click="getResource(section)"
+                                            @click="getResource(section,1)"
                                           >
                                             <template v-if="section.type != 2">
                                               <template>
@@ -190,7 +191,7 @@
                                                   </div>
                                                 </div>
                                               </template>
-
+                                              
                                               <template
                                                 v-if="section.durationTime > 0"
                                               >
@@ -258,6 +259,15 @@
                                                   已结束
                                                 </div>
                                               </template>
+
+                                              <template
+                                                v-if="checkSection(section)"
+                                              >
+                                                <div class="exercises" @click="getResource(section,2)">
+                                                  习题
+                                                  <i class="el-icon-arrow-right icons"></i>
+                                                </div>
+                                              </template>
                                             </template>
 
                                             <template v-if="section.type == 2">
@@ -311,6 +321,47 @@
                                             </template>
                                           </div>
                                         </div>
+                                         <div
+                                          v-if="chapter.type == 2"
+                                          class="bank-section__item"
+                                          @click="getResource(chapter,3)"
+                                        >
+                                          <template>
+                                              <template>
+                                                <div
+                                                  class="test-btn"
+                                                  v-if="chapter.doType == 1"
+                                                >
+                                                  练习
+                                                </div>
+                                                <div
+                                                  class="test-btn"
+                                                  v-if="chapter.doType != 1"
+                                                >
+                                                  考试
+                                                </div>
+                                              </template>
+                                              <div
+                                                class="bank-section__item__text"
+                                              >
+                                                {{ chapter.name }}
+                                              </div>
+                                              <template>
+                                                  <div
+                                                    class="btn btn--green"
+                                                    v-if="chapter.learning == 1"
+                                                  >
+                                                    合格
+                                                  </div>
+                                                  <div
+                                                    class="btn btn--red"
+                                                    v-if="chapter.learning == 0"
+                                                  >
+                                                    不合格
+                                                  </div>
+                                              </template>
+                                            </template>
+                                        </div>
                                       </div>
                                     </div>
                                   </div>
@@ -348,7 +399,7 @@
                                               section, sectionIndex
                                             ) in menu.list"
                                             :key="sectionIndex"
-                                            @click="getResource(section)"
+                                            @click="getResource(section,1)"
                                           >
                                             <template v-if="section.type != 2">
                                               <template>
@@ -403,7 +454,7 @@
                                                   }}</span>
                                                 </div>
                                               </div>
-
+                                              
                                               <template
                                                 v-if="section.durationTime > 0"
                                               >
@@ -471,6 +522,15 @@
                                                   已结束
                                                 </div>
                                               </template>
+
+                                              <template
+                                                v-if="checkSection(section)"
+                                              >
+                                                <div class="exercises" @click="getResource(section,2)">
+                                                  习题
+                                                  <i class="el-icon-arrow-right icons"></i>
+                                                </div>
+                                              </template>
                                             </template>
 
                                             <template v-if="section.type == 2">
@@ -537,7 +597,7 @@
                                         :class="{
                                           active: isActive(menu),
                                         }"
-                                        @click="getResource(menu)"
+                                        @click="getResource(menu,1)"
                                       >
                                         <template>
                                           <div
@@ -582,7 +642,7 @@
                                             </div>
                                           </div>
                                         </template>
-
+                                        
                                         <template v-if="menu.durationTime > 0">
                                           <div class="during">
                                             {{
@@ -636,6 +696,19 @@
                                             已结束
                                           </div>
                                         </template>
+
+                                        <template
+                                            v-if="checkSectionList(menu)"
+                                        >
+                                          <!-- <div class="btn btn--green" 
+                                            @click.stop="getResource(menu,2,true)">
+                                            习题
+                                          </div> -->
+                                          <div class="exercises" @click="getResource(menu,2,true)">
+                                            习题
+                                            <i class="el-icon-arrow-right icons"></i>
+                                          </div>
+                                        </template>
                                       </div>
                                     </div>
                                   </div>
@@ -704,7 +777,7 @@
                                               section, sectionIndex
                                             ) in chapter.list"
                                             :key="sectionIndex"
-                                            @click="getResource(section)"
+                                            @click="getResource(section,1)"
                                           >
                                             <template v-if="section.type != 2">
                                               <template>
@@ -919,7 +992,7 @@
                                               section, sectionIndex
                                             ) in menu.list"
                                             :key="sectionIndex"
-                                            @click="getResource(section)"
+                                            @click="getResource(section,1)"
                                           >
                                             <template v-if="section.type != 2">
                                               <template>
@@ -1108,7 +1181,7 @@
                                         :class="{
                                           active: isActive(menu),
                                         }"
-                                        @click="getResource(menu)"
+                                        @click="getResource(menu,1)"
                                       >
                                         <template>
                                           <div
@@ -2993,6 +3066,8 @@ export default {
       clickSectionItem: {}, // 点击节的内容
       courseTotal: 0, 
       teaIndex: 0,
+      sectionExamList:[],//节试卷集合
+      sectionExam:[]//节试卷集合
     };
   },
   computed: {
@@ -3224,6 +3299,18 @@ export default {
           this.liveLast = res.data;
         });
     },
+    //校验节是否有试卷
+    checkSection(item){
+      console.log(this.sectionExam,item,'00000000');
+      if(this.sectionExam.length == 0){
+        return false
+      }
+      if(this.sectionExam.some((section) => section.sectionId == item.sectionId)){
+        return true
+      }else{
+        return false
+      }
+    },
     /**
      * 获取观看记录
      */
@@ -4903,7 +4990,7 @@ export default {
     },
     openModule(menuItem, status = false) {
       //重修目录点击
-      console.log(menuItem.list);
+      console.log(menuItem,'menuItem');
       menuItem.showList = !menuItem.showList;
 
       if (!menuItem.list.length) {
@@ -4978,6 +5065,15 @@ export default {
     },
     openChapter(chapter) {
       console.log(chapter, "chapter");
+      //获取节试卷列表
+      this.$request
+        .reSectionExamList({
+          chapterId: chapter.chapterId || chapter.menuId,
+          courseId:this.courseId,
+          gradeId:this.gradeId}).then((res) => {
+          this.sectionExam = [...this.sectionExam, ...res.data]
+            // this.sectionExam = res.data
+      })
       chapter.showList = !chapter.showList;
       if (!chapter.list.length) {
         if (chapter.isRebuild) {
@@ -5139,11 +5235,37 @@ export default {
         console.log('直播的用户学习日志:', res)
       })
     },
+    //校验节是否有试卷
+    checkSectionList(item){
+      console.log(item,'item');
+      console.log(this.sectionExamList,'this.sectionExamList');
+      if(this.sectionExamList.length == 0){
+        return false
+      }
+      if(this.sectionExamList.some((section) => section.sectionId == item.menuId)){
+        return true
+      }else{
+        return false
+      }
+    },
     /**
      * 点击节
      */
-    async getResource(section) {
-      console.log('点击节节节', section)
+    async getResource(section,type,flag) {
+      //type:1章卷,2节卷,3模考卷
+      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]
+       }
+      }
       this.clickSectionItem = section
       //逻辑
       if (section.sectionType === 2 && section.liveStartTime && section.liveEndTime) {
@@ -5186,7 +5308,9 @@ export default {
                   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,
                 },
@@ -5200,7 +5324,9 @@ export default {
                   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,
                 },
@@ -5267,7 +5393,9 @@ export default {
                   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,
                 },
@@ -5280,7 +5408,9 @@ export default {
                   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,
                 },
@@ -5311,7 +5441,9 @@ export default {
                 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,
               },
@@ -5325,7 +5457,9 @@ export default {
                 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,
               },
@@ -5349,7 +5483,7 @@ export default {
         }
         this.clickLock = true;
         if (
-          this.playSectionId &&
+          this.sectionItem.sectionType === 1 && this.playSectionId &&
           (this.playSectionId == section.sectionId ||
             this.playSectionId == section.menuId) &&
           this.moduleId == (section.moduleId || 0) &&
@@ -6691,8 +6825,8 @@ export default {
           console.log('==============self.menuList===', res.rows, self.menuList)
           if ((this.sectionItem.recordingUrl||this.sectionItem.liveUrl) && this.needOpenNew) {
             this.needOpenNew = false;
-            if (this.sectionItem.sectionType == 1) {
-              console.log("录播")
+            if (this.sectionItem.sectionType == 1) {  
+              console.log("录播",this.sectionItem)
               //录播
               this.chapterId = this.sectionItem.chapterId;
               this.moduleId = this.sectionItem.moduleId;
@@ -6701,7 +6835,7 @@ export default {
               this.playVideo(this.sectionItem);
             } else if (this.sectionItem.sectionType == 2) {
               console.log("直播")
-              this.getResource(this.sectionItem)
+              this.getResource(this.sectionItem,1)
               //直播
               // this.studyRecordGetLastLive();
             } else if (this.sectionItem.sectionType == 3) {
@@ -6785,6 +6919,15 @@ export default {
             }
           }
         });
+
+      //获取节试卷列表
+      this.$request
+        .reSectionExamList({
+          chapterId: 0,
+          courseId:this.courseId,
+          gradeId:this.gradeId}).then((res) => {
+            this.sectionExamList = res.data
+      })
     },
 
     getReMenuList() {
@@ -7467,6 +7610,12 @@ export default {
                             color: #007aff;
                           }
                         }
+                        .exercises {
+                          cursor: pointer;
+                          font-size: 14px;
+                          color: #498AFE;
+                        }
+
                       }
                     }
                   }

+ 90 - 29
src/pages/course-exam/index.vue

@@ -91,6 +91,13 @@
                             }"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
+                            @click="
+                              radioSelect(
+                                question,
+                                questionIndex,
+                                item.optionsId
+                              )
+                            "
                           >
                             <div>
                               {{ ast[index] }}. {{ item.content }}
@@ -124,6 +131,7 @@
                         <!-- <div class="collect" @click="collect">收藏本题</div> -->
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 2 && current == questionIndex"
@@ -159,7 +167,7 @@
                         </div>
                         <div class="question-list" v-if="question.ques">
                           <el-checkbox
-                            disabled
+                            :disabled='bankType == 2 ? false : true'
                             class="checkbox"
                             :class="{
                               right:
@@ -211,7 +219,7 @@
                       </div>
                       <div class="question__btns">
                         <div
-                          v-if="!question.ques"
+                          v-if="bankType == 2 || (bankType == 1 && !question.ques)"
                           class="submit"
                           @click="checkboxSubmit(question, questionIndex)"
                         >
@@ -220,6 +228,7 @@
                         <!-- <div class="collect" @click="collect">收藏本题</div> -->
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 3 && current == questionIndex"
@@ -265,6 +274,7 @@
                             }"
                             v-for="(item, index) in judge"
                             :key="index"
+                            @click="judgeSelect(question, questionIndex, index)"
                           >
                             <div>
                               {{ ast[index] }}. {{ item }}
@@ -298,6 +308,7 @@
                         <!-- <div class="collect" @click="collect">收藏本题</div> -->
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 4 && current == questionIndex"
@@ -378,6 +389,13 @@
                                     }"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"
+                                    @click="
+                                      radioSelectChild(
+                                        questionIndex,
+                                        jsonIndex,
+                                        item.optionsId
+                                      )
+                                    "
                                   >
                                     <div>
                                       {{ ast[index] }}. {{ item.content }}
@@ -423,6 +441,7 @@
                               </div>
                               <div class="question__btns"></div>
                             </div>
+
                             <div
                               class="question"
                               v-if="json.type == 2"
@@ -466,7 +485,7 @@
                                   v-if="question.ques[jsonIndex]"
                                 >
                                   <el-checkbox
-                                    disabled
+                                    :disabled="bankType == 2 ? false : true"
                                     class="checkbox"
                                     :class="{
                                       right:
@@ -540,7 +559,7 @@
                               </div>
                               <div class="question__btns">
                                 <div
-                                  v-if="!question.ques[jsonIndex]"
+                                  v-if="bankType == 2 || (bankType == 1 && !question.ques[jsonIndex])"
                                   class="submit"
                                   @click="
                                     checkboxSubmitChild(
@@ -553,6 +572,7 @@
                                 </div>
                               </div>
                             </div>
+
                             <div
                               class="question"
                               v-if="json.type == 3"
@@ -614,6 +634,13 @@
                                     }"
                                     v-for="(item, index) in judge"
                                     :key="index"
+                                    @click="
+                                      judgeSelectChild(
+                                        questionIndex,
+                                        jsonIndex,
+                                        index
+                                      )
+                                    "
                                   >
                                     <div>
                                       {{ ast[index] }}. {{ item }}
@@ -674,12 +701,12 @@
                                 <div
                                   class="question-list textarea"
                                   v-if="
-                                    !(
+                                    bankType == 2 || ( bankType == 1 && !(
                                       question.ques[jsonIndex] &&
                                       (question.ques[jsonIndex].imageList
                                         .length ||
                                         question.ques[jsonIndex].text)
-                                    )
+                                    ))
                                   "
                                 >
                                   <el-input
@@ -759,12 +786,12 @@
                               <div class="question__btns">
                                 <div
                                   v-if="
-                                    !(
+                                    bankType == 2 || ( bankType == 1 && !(
                                       question.ques[jsonIndex] &&
                                       (question.ques[jsonIndex].imageList
                                         .length ||
                                         question.ques[jsonIndex].text)
-                                    )
+                                    ))
                                   "
                                   class="submit"
                                   @click="
@@ -786,6 +813,7 @@
                         <!-- <div class="collect" @click="collect">收藏本题</div>+ -->
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 5 && current == questionIndex"
@@ -802,8 +830,8 @@
                         <div
                           class="question-list textarea"
                           v-if="
-                            !question.ques.imageList.length &&
-                            !question.ques.text
+                            bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
+                            !question.ques.text)
                           "
                         >
                           <el-input
@@ -869,8 +897,8 @@
                       <div class="question__btns">
                         <div
                           v-if="
-                            !question.ques.imageList.length &&
-                            !question.ques.text
+                            bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
+                            !question.ques.text)
                           "
                           class="submit"
                           @click="ansSubmit(question, questionIndex)"
@@ -937,10 +965,11 @@
                           v-for="(item, index) in questionList"
                           :key="index"
                           :class="{
-                            green: isRight(item, index),
-                            red: isWrong(item, index),
-                            yellow: isPart(item, index),
-                            blue: isOver(item, index),
+                            green: bankType == 1 && isRight(item, index),
+                            red: bankType == 1 && isWrong(item, index),
+                            yellow: bankType == 1 && isPart(item, index),
+                            blue: bankType == 1 && isOver(item, index),
+                            check_ans: bankType == 2 && isCheck(item, index),
                           }"
                           @click="changeIndex(index)"
                         >
@@ -1085,6 +1114,7 @@ export default {
       gradeId: 0,
       moduleId: 0,
       chapterId: 0,
+      sectionId: 0,
       faceUrl: "",
       stream: null,
       ossAvatarUrl: "",
@@ -1106,6 +1136,7 @@ export default {
     this.courseId = this.$route.query.courseId;
     this.gradeId = this.$route.query.gradeId;
     this.moduleId = this.$route.query.moduleId;
+    this.sectionId = this.$route.query.sectionId;
     this.chapterId = this.$route.query.chapterId;
     this.orderGoodsId = this.$route.query.orderGoodsId;
     await this.getGoodsDetail();
@@ -1574,8 +1605,10 @@ export default {
         // }
         this.$request
           .bankRecord({
-            chapterExamId: this.chapterId || 0,
-            moduleExamId: this.moduleId || 0,
+            courseId: this.courseId,
+            chapterId: this.chapterId || 0,
+            moduleId: this.moduleId || 0,
+            sectionId: this.sectionId || 0,
             goodsId: this.goodsId,
             examId: this.examId,
             type: this.type,
@@ -1634,7 +1667,10 @@ export default {
      * 单选点击确认
      */
     radioSelect(question, questionIndex, optionsId) {
-      if (this.questionList[questionIndex].ques) return;
+      // if (this.questionList[questionIndex].ques) return;
+      if (this.questionList[questionIndex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex], "ques", optionsId);
     },
 
@@ -1643,14 +1679,20 @@ export default {
      * 案例单选点击
      */
     radioSelectChild(questionIndex, jsonIndex, optionsId) {
-      if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      // if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
     },
     /**
      * 多选点击确认
      */
     checkboxSubmit(question, questionIndex) {
-      if (this.questionList[questionIndex].ques) return;
+      // if (this.questionList[questionIndex].ques) return;
+      if (this.questionList[questionIndex].ques && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[questionIndex].jsonStr.forEach((item) => {
         if (item.checked) {
@@ -1658,6 +1700,7 @@ export default {
         }
       });
       if (!arr.length) {
+        delete this.questionList[questionIndex].ques
         this.$message({
           type: "warning",
           message: "请选择答案",
@@ -1671,7 +1714,10 @@ export default {
      * 案例多选确认
      */
     checkboxSubmitChild(questionIndex, ansIndex) {
-      if (this.questionList[questionIndex].ques[ansIndex]) return;
+      // if (this.questionList[questionIndex].ques[ansIndex]) return;
+      if (this.questionList[questionIndex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
         (item) => {
@@ -1682,6 +1728,7 @@ export default {
       );
 
       if (!arr.length) {
+        delete this.questionList[questionIndex].ques[ansIndex]
         this.$message({
           type: "warning",
           message: "请选择答案",
@@ -1695,12 +1742,18 @@ export default {
      * 判断点击确认
      */
     judgeSelect(question, questionIndex, index) {
-      if (question.ques) return;
+      // if (question.ques) return;
+      if (question.ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex], "ques", index + "");
     },
     judgeSelectChild(questionIndex, jsonIndex, index) {
-      console.log(this.questionList[questionIndex].ques[jsonIndex]);
-      if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      // console.log(this.questionList[questionIndex].ques[jsonIndex]);
+      // if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
     },
 
@@ -1865,6 +1918,11 @@ export default {
         this.current--;
       }
     },
+    isCheck(item, index) {
+      if (this.questionList[index].ques) {
+        return true
+      }
+    },
     isRight(item, index) {
       //单选
       if (this.questionList[index].ques) {
@@ -2256,6 +2314,7 @@ export default {
         .bankRecordEdit({
           moduleId: this.moduleId || 0,
           chapterId: this.chapterId || 0,
+          sectionId: this.sectionId || 0,
           gradeId: this.gradeId,
           examId: this.examId,
           type: this.type,
@@ -2414,12 +2473,15 @@ export default {
                       border-radius: 8px;
                       box-sizing: border-box;
 
-                      &.right, &.user_choose {
+                      &.right {
                         background: #37c65b;
                       }
                       &.wrong {
                         background: #ff3a30;
                       }
+                      &.user_choose {
+                        background: #007aff;
+                      }
                     }
                     &.textarea {
                       margin-right: 12px;
@@ -2689,7 +2751,7 @@ export default {
                       &.yellow {
                         background: #ffc53d;
                       }
-                      &.blue {
+                      &.blue, &.check_ans {
                         background: #3f8dfd;
                       }
                     }
@@ -2728,8 +2790,7 @@ export default {
                         background: #ff3a30;
                       }
 
-                      &.blue {
-                        border: 1rpx solid #eeeeee;
+                      &.blue, &.check_ans {
                         color: #fff;
                         background: #3f8dfd;
                       }

+ 18 - 0
src/pages/course-report/index.vue

@@ -3,6 +3,17 @@
     <Header></Header>
     <section class="section">
       <div class="container">
+        <div class="re_back">
+          <el-button
+            type="primary"
+            plain
+            round
+            size="mini"
+            class="back-btn"
+            @click="$router.back(-1)"
+            >返回</el-button
+          >
+        </div>
         <div
           class="section__header section__header--warm"
           v-if="!examResult.reportStatus"
@@ -195,6 +206,13 @@ export default {
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style scoped lang="scss">
 .bank-report {
+  .re_back {
+    text-align: right;
+    margin: 10px 0px;
+    .back-btn {
+      width: 100px;
+    }
+  }
   .section {
     &__header {
       height: 120px;

+ 3 - 2
src/pages/goods-detail/course-detail.vue

@@ -1565,7 +1565,7 @@ export default {
         console.log(data,'data',index, tindex);
         this.goodsTeacher.forEach((item,index) => {
             if(item.teaList && item.teaList.length > 0){
-               let list = item.teaList.filter(x => x.aliasName == data.aliasName)
+               let list = item.teaList.filter(x => x.courseId == data.courseId)
                if(list && list.length > 0){
                   item.courseList.forEach((course,courseIndex) => {
                       if(course.courseId == data.courseId){
@@ -1609,7 +1609,8 @@ export default {
                     let dataList = []
                     let teacherList = []
                       courses.forEach((item) => {
-                        if(tea.courseIds.search(item.courseId) > -1){
+                        let data = tea.courseList.filter(x => x.courseId == item.courseId)
+                        if(data && data.length > 0){
                           dataList.push(item)
                           teacherList = tea.courseList
                         }

+ 3 - 2
src/pages/goodsTopic/components/catalogue.vue

@@ -377,7 +377,7 @@ export default {
             this.teaIndex = index
             this.goodsTeacher.forEach((item,index) => {
                 if(item.teaList && item.teaList.length > 0){
-                let list = item.teaList.filter(x => x.aliasName == data.aliasName)
+                let list = item.teaList.filter(x => x.courseId == data.courseId)
                 if(list && list.length > 0){
                     item.courseList.forEach((course,courseIndex) => {
                         if(course.courseId == data.courseId){
@@ -452,7 +452,8 @@ export default {
                     let dataList = []
                     let teacherList = []
                       courses.forEach((item) => {
-                        if(tea.courseIds.search(item.courseId) > -1){
+                        let data = tea.courseList.filter(x => x.courseId == item.courseId)
+                        if(data && data.length > 0){
                           dataList.push(item)
                           teacherList = tea.courseList
                         }

+ 70 - 26
src/pages/mock-exam/index.vue

@@ -92,6 +92,7 @@
                             }"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
+                            @click="radioSelect(question, questionIndex, item.optionsId)"
                           >
                             <div>
                               {{ ast[index] }}. {{ item.content }}
@@ -122,6 +123,7 @@
                       </div>
                       <div class="question__btns"></div>
                     </div>
+                    
                     <div
                       class="question"
                       v-if="question.type == 2 && current == questionIndex"
@@ -156,7 +158,7 @@
                         </div>
                         <div class="question-list" v-if="question.ques">
                           <el-checkbox
-                            disabled
+                            :disabled='bankType == 2 ? false : true'
                             class="checkbox"
                             :class="{
                               right:
@@ -207,7 +209,7 @@
                       </div>
                       <div class="question__btns">
                         <div
-                          v-if="!question.ques"
+                          v-if="bankType == 2 || (bankType == 1 && !question.ques)"
                           class="submit"
                           @click="checkboxSubmit(question, questionIndex)"
                         >
@@ -215,6 +217,7 @@
                         </div>
                       </div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 3 && current == questionIndex"
@@ -260,6 +263,7 @@
                             }"
                             v-for="(item, index) in judge"
                             :key="index"
+                            @click="judgeSelect(question, questionIndex, index)"
                           >
                             <div>
                               {{ ast[index] }}. {{ item }}
@@ -291,6 +295,7 @@
                       </div>
                       <div class="question__btns"></div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 4 && current == questionIndex"
@@ -371,6 +376,7 @@
                                     }"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"
+                                    @click="radioSelectChild( questionIndex, jsonIndex, item.optionsId)"
                                   >
                                     <div>
                                       {{ ast[index] }}. {{ item.content }}
@@ -416,6 +422,7 @@
                               </div>
                               <div class="question__btns"></div>
                             </div>
+
                             <div
                               class="question"
                               v-if="json.type == 2"
@@ -459,7 +466,7 @@
                                   v-if="question.ques[jsonIndex]"
                                 >
                                   <el-checkbox
-                                    disabled
+                                    :disabled="bankType == 2 ? false : true"
                                     class="checkbox"
                                     :class="{
                                       right:
@@ -533,7 +540,7 @@
                               </div>
                               <div class="question__btns">
                                 <div
-                                  v-if="!question.ques[jsonIndex]"
+                                  v-if="bankType == 2 || (bankType == 1 && !question.ques[jsonIndex])"
                                   class="submit"
                                   @click="
                                     checkboxSubmitChild(
@@ -546,6 +553,7 @@
                                 </div>
                               </div>
                             </div>
+
                             <div
                               class="question"
                               v-if="json.type == 3"
@@ -607,6 +615,13 @@
                                     }"
                                     v-for="(item, index) in judge"
                                     :key="index"
+                                    @click="
+                                      judgeSelectChild(
+                                        questionIndex,
+                                        jsonIndex,
+                                        index
+                                      )
+                                    "
                                   >
                                     <div>
                                       {{ ast[index] }}. {{ item }}
@@ -667,12 +682,12 @@
                                 <div
                                   class="question-list textarea"
                                   v-if="
-                                    !(
+                                    bankType == 2 || ( bankType == 1 && !(
                                       question.ques[jsonIndex] &&
                                       (question.ques[jsonIndex].imageList
                                         .length ||
                                         question.ques[jsonIndex].text)
-                                    )
+                                    ))
                                   "
                                 >
                                   <el-input
@@ -752,12 +767,12 @@
                               <div class="question__btns">
                                 <div
                                   v-if="
-                                    !(
+                                    bankType == 2 || ( bankType == 1 && !(
                                       question.ques[jsonIndex] &&
                                       (question.ques[jsonIndex].imageList
                                         .length ||
                                         question.ques[jsonIndex].text)
-                                    )
+                                    ))
                                   "
                                   class="submit"
                                   @click="
@@ -777,6 +792,7 @@
                       </div>
                       <div class="question__btns"></div>
                     </div>
+
                     <div
                       class="question"
                       v-if="question.type == 5 && current == questionIndex"
@@ -793,8 +809,8 @@
                         <div
                           class="question-list textarea"
                           v-if="
-                            !question.ques.imageList.length &&
-                            !question.ques.text
+                            bankType == 2 || ( bankType == 1 && !question.ques.imageList.length &&
+                            !question.ques.text)
                           "
                         >
                           <el-input
@@ -860,8 +876,8 @@
                       <div class="question__btns">
                         <div
                           v-if="
-                            !question.ques.imageList.length &&
-                            !question.ques.text
+                            bankType == 2 || (bankType == 1 && !question.ques.imageList.length &&
+                            !question.ques.text)
                           "
                           class="submit"
                           @click="ansSubmit(question, questionIndex)"
@@ -933,10 +949,11 @@
                           v-for="(item, index) in questionList"
                           :key="index"
                           :class="{
-                            green: isRight(item, index),
-                            red: isWrong(item, index),
-                            yellow: isPart(item, index),
-                            blue: isOver(item, index),
+                            green: bankType == 1 && isRight(item, index),
+                            red: bankType == 1 && isWrong(item, index),
+                            yellow: bankType == 1 && isPart(item, index),
+                            blue: bankType == 1 && isOver(item, index),
+                            check_ans: bankType == 2 && isCheck(item, index),
                           }"
                           @click="changeIndex(index)"
                         >
@@ -1565,7 +1582,10 @@ export default {
      * 单选点击确认
      */
     radioSelect(question, questionIndex, optionsId) {
-      if (this.questionList[questionIndex].ques) return;
+      // if (this.questionList[questionIndex].ques) return;
+      if (this.questionList[questionIndex].ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex], "ques", optionsId);
       this.isDoOver();
     },
@@ -1575,7 +1595,10 @@ export default {
      * 案例单选点击
      */
     radioSelectChild(questionIndex, jsonIndex, optionsId) {
-      if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      // if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex].ques, jsonIndex, optionsId);
       this.isDoOver();
     },
@@ -1583,7 +1606,10 @@ export default {
      * 多选点击确认
      */
     checkboxSubmit(question, questionIndex) {
-      if (this.questionList[questionIndex].ques) return;
+      // if (this.questionList[questionIndex].ques) return;
+      if (this.questionList[questionIndex].ques && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[questionIndex].jsonStr.forEach((item) => {
         if (item.checked) {
@@ -1591,6 +1617,7 @@ export default {
         }
       });
       if (!arr.length) {
+        delete this.questionList[questionIndex].ques
         this.$message({
           type: "warning",
           message: "请选择答案",
@@ -1605,7 +1632,10 @@ export default {
      * 案例多选确认
      */
     checkboxSubmitChild(questionIndex, ansIndex) {
-      if (this.questionList[questionIndex].ques[ansIndex]) return;
+      // if (this.questionList[questionIndex].ques[ansIndex]) return;
+      if (this.questionList[questionIndex].ques[ansIndex] && this.bankType == 1) {
+        return
+      }
       let arr = [];
       this.questionList[questionIndex].jsonStr[ansIndex].optionsList.forEach(
         (item) => {
@@ -1616,6 +1646,7 @@ export default {
       );
 
       if (!arr.length) {
+        delete this.questionList[questionIndex].ques[ansIndex]
         this.$message({
           type: "warning",
           message: "请选择答案",
@@ -1630,13 +1661,19 @@ export default {
      * 判断点击确认
      */
     judgeSelect(question, questionIndex, index) {
-      if (question.ques) return;
+      // if (question.ques) return;
+      if (question.ques && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex], "ques", index + "");
       this.isDoOver();
     },
     judgeSelectChild(questionIndex, jsonIndex, index) {
       console.log(this.questionList[questionIndex].ques[jsonIndex]);
-      if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      // if (this.questionList[questionIndex].ques[jsonIndex]) return;
+      if (this.questionList[questionIndex].ques[jsonIndex] && this.bankType == 1) {
+        return
+      }
       this.$set(this.questionList[questionIndex].ques, jsonIndex, index + "");
       this.isDoOver();
     },
@@ -1809,6 +1846,11 @@ export default {
         this.getCollectInfo(this.current);
       }
     },
+    isCheck(item, index) {
+      if (this.questionList[index].ques) {
+        return true
+      }
+    },
     isRight(item, index) {
       //单选
       if (this.questionList[index].ques) {
@@ -2580,12 +2622,15 @@ export default {
                       border-radius: 8px;
                       box-sizing: border-box;
 
-                      &.right, &.user_choose {
+                      &.right {
                         background: #37c65b;
                       }
                       &.wrong {
                         background: #ff3a30;
                       }
+                      &.user_choose {
+                        background: #007aff;
+                      }
                     }
                     &.textarea {
                       margin-right: 12px;
@@ -2859,7 +2904,7 @@ export default {
                       &.yellow {
                         background: #ffc53d;
                       }
-                      &.blue {
+                      &.blue, &.check_ans {
                         background: #3f8dfd;
                       }
                     }
@@ -2916,8 +2961,7 @@ export default {
                         background: #ff3a30;
                       }
 
-                      &.blue {
-                        border: 1rpx solid #eeeeee;
+                      &.blue, &.check_ans {
                         color: #fff;
                         background: #3f8dfd;
                       }

+ 19 - 0
src/pages/mock-report/index.vue

@@ -2,6 +2,18 @@
   <div class="bank-report">
     <Header></Header>
     <section class="section">
+      <!-- <div class="re_back">
+        <el-button
+          type="primary"
+          plain
+          round
+          size="mini"
+          class="back-btn"
+          @click="$router.back(-1)"
+          >返回</el-button
+        >
+      </div> -->
+
       <template
         v-if="
           subscribeInfo.liveStartTime <= sysTime &&
@@ -510,6 +522,13 @@ export default {
 <!-- Add "scoped" attribute to limit CSS to this component only -->
 <style scoped lang="scss">
 .bank-report {
+  .re_back {
+    text-align: right;
+    margin: 10px 0px;
+    .back-btn {
+      width: 100px;
+    }
+  }
   .section {
     &__top {
       height: 72px;

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

@@ -97,7 +97,7 @@
                   :key="k"
                   style="padding-left: 20px"
                 >
-                   <div
+                  <div
                     v-if="i.type == 2"
                     class="sectionStyle hoverStyleSection"
                     style="padding-left: 20px"
@@ -115,7 +115,7 @@
                           }}</span>
                           <span class="span_style">{{ i.name }}</span>
                         </el-col>
-                        <el-col :span="2" :offset="1">
+                        <el-col :span="11" :offset="1" style="display: flex; justify-content: end;align-items: center;">
                           <el-button
                             size="mini"
                             style="width: 886px !important"
@@ -199,20 +199,29 @@
                             }}
                           </span>
                         </el-col>
+                        <el-col :span="2" :offset="1" v-if="checkSection(is)">
+                          <el-button
+                            size="mini"
+                            type="text"
+                            style="width: 90px !important"
+                            @click="getResource(item, is,2)"
+                            >习题</el-button
+                          >
+                        </el-col>
                         <el-col :span="2" :offset="1" v-if="!is.sectionType">
                           <el-button
                             size="mini"
                             style="width: 90px !important"
                             type="text"
                             v-if="is.doType == 1"
-                            @click="getResource(item, is, 3)"
+                            @click="getResource(item, is, 1)"
                             >进入学习</el-button
                           ><el-button
                             size="mini"
                             style="width: 90px !important"
                             type="text"
                             v-else
-                            @click="getResource(item, is, 3)"
+                            @click="getResource(item, is, 1)"
                             >进入考试</el-button
                           >
                         </el-col>
@@ -363,6 +372,15 @@
                         }}
                       </span>
                     </el-col>
+                    <el-col :span="2" :offset="1" v-if="checkSection(i)">
+                      <el-button
+                        size="mini"
+                        type="text"
+                        style="width: 90px !important"
+                        @click="getResource(item, i,2)"
+                        >习题</el-button
+                      >
+                    </el-col>
                     <el-col :span="2" :offset="1" v-if="!i.sectionType">
                       <el-button
                         size="mini"
@@ -509,6 +527,15 @@
                     }}
                   </span>
                 </el-col>
+                <el-col :span="2" :offset="1" v-if="checkSectionList(items)">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    style="width: 90px !important"
+                    @click="getResource(item, items,2,true)"
+                    >习题</el-button
+                  >
+                </el-col>
                 <el-col :span="2" :offset="1" v-if="!items.sectionType">
                   <el-button
                     size="mini"
@@ -691,6 +718,8 @@ export default {
       businessData: {},
       teaIndex: 0,
       States: {0: 0},
+      sectionExamList:[],//节试卷集合
+      sectionExam:[]//节试卷集合
     };
   },
   computed: {
@@ -790,7 +819,8 @@ export default {
                     let dataList = []
                     let teacherList = []
                       courses.forEach((item) => {
-                        if(tea.courseIds.search(item.courseId) > -1){
+                        let courseData = tea.courseList.filter(x => x.courseId == item.courseId)
+                        if(courseData && courseData.length > 0){
                           dataList.push(item)
                           teacherList = tea.courseList
                         }
@@ -820,12 +850,12 @@ export default {
                           }
                       })
                     }
-                    this.goodsTeacher.forEach((item) => {
+                  }
+                  this.goodsTeacher.forEach((item) => {
                       if(item.courseList && item.courseList.length > 0){
                         item.courseList[0].show = 1
                       }
                     })
-                  }
               }else{
                 //没有双师资模板
                 res.rows.forEach((item) => {
@@ -859,12 +889,13 @@ export default {
     },
     //切换老师
     switchTeacher(data, index, teacherIndex){
-        // console.log(data,'data',  index, teacherIndex);
+        console.log(data,'data',  index, teacherIndex);
+        console.log(this.subjectList,'this.subjectList');
         this.States[teacherIndex] = index
         this.teaIndex = index
         this.goodsTeacher.forEach((item,index) => {
             if(item.teaList && item.teaList.length > 0){
-               let list = item.teaList.filter(x => x.aliasName == data.aliasName)
+               let list = item.teaList.filter(x => x.courseId == data.courseId)
                if(list && list.length > 0){
                   item.courseList.forEach((course,courseIndex) => {
                       if(course.courseId == data.courseId){
@@ -878,6 +909,7 @@ export default {
                }
             }
         })
+        console.log(this.goodsTeacher,'this.goodsTeacher');
     },
     getGoodsData(res) {
       return new Promise((resolve, reject) => {
@@ -1038,6 +1070,14 @@ export default {
           item.showStatus = !item.showStatus;
           return;
         }
+        //获取节试卷列表
+        this.$request
+          .reSectionExamList({
+            chapterId: 0,
+            courseId:item.courseId,
+            gradeId:item.gradeId}).then((res) => {
+              this.sectionExamList = res.data
+        })
         this.$request
           .reMenuList({
             courseId: item.courseId,
@@ -1109,6 +1149,14 @@ export default {
           item.showStatus = !item.showStatus;
           return;
         }
+        //获取节试卷列表
+        this.$request
+          .reSectionExamList({
+            chapterId: type === 1 ? item.menuId : item.chapterId,
+            courseId:item.courseId,
+            gradeId:item.gradeId}).then((res) => {
+              this.sectionExam = res.data
+        })
         this.$request
           .reSectionList({
             chapterId: type === 1 ? item.menuId : item.chapterId,
@@ -1319,9 +1367,24 @@ export default {
             });
         });
     },
-    async getResource(courseLists, section,type) {
-      //type:1章卷,2节卷,3模考卷
-      console.log(section);
+    async getResource(courseLists, section,type,flag) {
+      //type:1章卷,2节卷,3模考卷,4习题
+      if(flag){
+        let data = this.sectionExamList.filter(x => x.sectionId = section.menuId)
+        if(data && data.length > 0){
+          section = data[0]
+        }else{
+          section.typeId =''
+        }
+      }else if(type && type == 2){
+        let data = this.sectionExam.filter(x => x.sectionId = section.sectionId)
+        if(data && data.length > 0){
+          section = data[0]
+        }else{
+          section.typeId =''
+        }
+      }
+      console.log(section,'section');
       if (section.type == 2) {
         //试卷
         console.log("试卷");
@@ -1351,6 +1414,7 @@ export default {
                   courseId: courseLists.courseId,
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
+                  sectionId: section.sectionId || 0,
                   examId: section.typeId,
                   type: type,
                   chapterId: section.chapterId || 0,
@@ -1366,6 +1430,7 @@ export default {
                   courseId: courseLists.courseId,
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
+                  sectionId: section.sectionId || 0,
                   examId: section.typeId,
                   type: type,
                   chapterId: section.chapterId || 0,
@@ -1439,6 +1504,7 @@ export default {
                   courseId: courseLists.courseId,
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
+                  sectionId: section.sectionId || 0,
                   examId: section.typeId,
                   type: type,
                   chapterId: section.chapterId || 0,
@@ -1453,6 +1519,7 @@ export default {
                   courseId: courseLists.courseId,
                   gradeId: this.goodsData.gradeId,
                   moduleId: section.moduleId || 0,
+                  sectionId: section.sectionId || 0,
                   examId: section.typeId,
                   type: type,
                   chapterId: section.chapterId || 0,
@@ -1490,6 +1557,7 @@ export default {
                 courseId: courseLists.courseId,
                 gradeId: this.goodsData.gradeId,
                 moduleId: section.moduleId || 0,
+                sectionId: section.sectionId || 0,
                 examId: section.typeId,
                 type: type,
                 chapterId: section.chapterId || 0,
@@ -1505,6 +1573,7 @@ export default {
                 courseId: courseLists.courseId,
                 gradeId: this.goodsData.gradeId,
                 moduleId: section.moduleId || 0,
+                sectionId: section.sectionId || 0,
                 examId: section.typeId,
                 type: type,
                 chapterId: section.chapterId || 0,
@@ -1529,7 +1598,30 @@ export default {
         return;
       }
     },
-
+    //校验节是否有试卷
+    checkSection(item){
+      if(this.sectionExam.length == 0){
+        return false
+      }
+      if(this.sectionExam.some((section) => section.sectionId == item.sectionId)){
+        return true
+      }else{
+        return false
+      }
+    },
+    //校验节是否有试卷
+    checkSectionList(item){
+      console.log(item,'item');
+      console.log(this.sectionExamList,'this.sectionExamList');
+      if(this.sectionExamList.length == 0){
+        return false
+      }
+      if(this.sectionExamList.some((section) => section.sectionId == item.menuId)){
+        return true
+      }else{
+        return false
+      }
+    },
     // 新增用户视频学习日志
     studyLog(moduleId, chapterId, sectionId, courseLists) {
       this.$axios({
@@ -1819,6 +1911,7 @@ export default {
   border-radius: 4px;
 }
 .sizeStyle {
+  font-size: 12px;
   background-color: #fff !important;
   border-color: #979ea5 !important;
   color: #979ea5 !important;