Ver Fonte

Merge branch 'dev' of http://120.79.166.78:19005/zhongzheng-edu/saas_pc into dev

谢杰标 há 3 anos atrás
pai
commit
0b77ae723a

+ 7 - 1
src/apis/bank.js

@@ -73,7 +73,12 @@ export default {
 		})
 	},
 
-
+	bankReportData(data) {
+		return request({
+			url: '/bank/record/' + data,
+			method: 'get',
+		})
+	},
 	studyExamPhotoRecord(data) {
 		return request({
 			url: '/bank/record/addPhoto',
@@ -151,6 +156,7 @@ export default {
 		})
 	},
 
+
 	examaperList(data) {
 		return request({
 			url: '/exam/paper/list',

+ 2 - 2
src/axios.js

@@ -4,9 +4,9 @@ import { Message } from 'element-ui'
 // 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.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'

+ 13 - 3
src/pages/bank-exam-all-explain/index.vue

@@ -824,6 +824,7 @@ export default {
       moduleId: 0,
       chapterId: 0,
       current: 0,
+      courseType: 1, //1题库,2视频 商品类型
     };
   },
   async mounted() {
@@ -832,6 +833,7 @@ 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.goodsQuestionList();
   },
   methods: {
@@ -858,9 +860,17 @@ export default {
      * 请求题目列表
      */
     goodsQuestionList() {
-      this.$request.examReport(this.recordId).then(async (res) => {
-        this.questionList = JSON.parse(res.data.historyExamJson);
-      });
+      if(this.courseType == 2){
+        this.$request.bankReportData(this.recordId).then(async (res) => {
+          this.questionList = res.data.historyExamJson ? JSON.parse(res.data.historyExamJson) : [];
+        });
+        
+      }else{
+        this.$request.examReport(this.recordId).then(async (res) => {
+          this.questionList = JSON.parse(res.data.historyExamJson);
+        });
+      }
+      
     },
 
     nextQuestion() {

+ 2 - 1
src/pages/bank-exam-continue/index.vue

@@ -1202,7 +1202,7 @@ export default {
         let json = JSON.parse(res.data.historyExamJson);
         this.examData = res.data;
         this.questionList = json;
-
+        this.getCollectInfo(this.current)
         //5秒保存一下做题记录
         clearInterval(this.postTimer);
         this.postTimer = setInterval(() => {
@@ -1914,6 +1914,7 @@ export default {
           goodsId: this.goodsId,
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
+          type: 1,
         })
         .then((res) => {})
         .catch((err) => {});

+ 19 - 6
src/pages/bank-exam-wrong-explain/index.vue

@@ -825,6 +825,7 @@ export default {
       chapterId: 0,
       current: 0,
       orderGoodsId: 0,
+      courseType: 1, //1题库,2视频 商品类型
     };
   },
   async mounted() {
@@ -834,6 +835,7 @@ export default {
     this.chapterId = this.$route.query.chapterId;
     this.goodsId = this.$route.query.goodsId;
     this.orderGoodsId = this.$route.query.orderGoodsId;
+    this.courseType = this.$route.query.courseType
     this.goodsQuestionList();
   },
   methods: {
@@ -860,10 +862,23 @@ export default {
      * 请求题目列表
      */
     goodsQuestionList() {
-      this.$request.examReport(this.recordId).then(async (res) => {
-        let questionList = JSON.parse(res.data.historyExamJson);
+      if (this.courseType == 2) {
+        this.$request.bankReportData(this.recordId).then(async (res) => {
+          let questionList = JSON.parse(res.data.historyExamJson);
 
-        questionList.forEach((json) => {
+          this.listForEach(questionList)
+        });
+        
+      } else {
+        this.$request.examReport(this.recordId).then(async (res) => {
+          let questionList = JSON.parse(res.data.historyExamJson);
+
+          this.listForEach(questionList)
+        });
+      }
+    },
+    listForEach(questionList) {
+      questionList.forEach((json) => {
           //只获取类型1,2,3 单选,多选,判断 ,主观题灭有对错
           if (json.type == 1 || json.type == 3) {
             //单选判断
@@ -889,10 +904,8 @@ export default {
           }
         });
 
-        console.log(this.questionList);
-      });
+        // console.log(this.questionList);
     },
-
     nextQuestion() {
       if (this.current >= this.questionList.length - 1) {
         this.$message({

+ 10 - 6
src/pages/bank-exam/index.vue

@@ -145,8 +145,8 @@
                           "
                         >
                           <template v-if="!collectList[questionIndex]"
-                            ><i class="el-icon-star-off"></i>收藏本题</template
-                          >
+                            ><i class="el-icon-star-off"></i>收藏本题
+                          </template>
                           <template v-if="collectList[questionIndex]"
                             ><i class="el-icon-star-on"></i>已收藏</template
                           >
@@ -1568,7 +1568,7 @@ export default {
 
           this.questionList = res.data;
           this.lastCount = this.questionList.length;
-
+          this.getCollectInfo(this.current)
           await this.examRecord();
         });
     },
@@ -1778,6 +1778,7 @@ export default {
       //       chapterExamId: this.chapterId || 0,
       //       questionIds: [this.questionList[questionIndex].questionId],
       //       recordId: this.recordId,
+              // type 1,
       //     })
       //     .then((res) => {});
       // }
@@ -1837,6 +1838,7 @@ export default {
       //       chapterExamId: this.chapterId || 0,
       //       questionIds: [this.questionList[questionIndex].questionId],
       //       recordId: this.recordId,
+      // type 1,
       //     })
       //     .then((res) => {});
       // }
@@ -1902,6 +1904,7 @@ export default {
       //       chapterExamId: this.chapterId || 0,
       //       questionIds: [this.questionList[questionIndex].questionId],
       //       recordId: this.recordId,
+      // type 1,
       //     })
       //     .then((res) => {});
       // }
@@ -2510,7 +2513,7 @@ export default {
       //   });
       // }, 1000);
       // return;
-      //交卷
+      //交卷 /exam/record/edit
       this.$request
         .examRecordEdit({
           examId: this.examId,
@@ -2557,7 +2560,7 @@ export default {
           this.loading = false;
         });
 
-      //错题集id提交(客观题)
+      //错题集id提交(客观题)/exam/wwrong/record
       this.$request
         .examWrongRecord({
           orderGoodsId: this.orderGoodsId,
@@ -2565,6 +2568,7 @@ export default {
           goodsId: this.goodsId,
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
+          type: 1,
         })
         .then((res) => {})
         .catch((err) => {});
@@ -2751,6 +2755,7 @@ export default {
           goodsId: this.goodsId,
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
+          type: 1,
         })
         .then((res) => {
           this.loading = false;
@@ -2786,7 +2791,6 @@ export default {
             width: 970px;
             min-height: 630px;
             border: 1px solid #eee;
-
             &__header {
               height: 40px;
               padding-left: 12px;

+ 146 - 16
src/pages/course-exam/index.vue

@@ -139,6 +139,19 @@
                       </div>
                       <div class="question__btns">
                         <!-- <div class="collect" @click="collect">收藏本题</div> -->
+                        <div
+                          class="collect"
+                          @click="
+                            collect(collectList[questionIndex], questionIndex)
+                          "
+                        >
+                          <template v-if="!collectList[questionIndex]"
+                            ><i class="el-icon-star-off"></i>收藏本题
+                          </template>
+                          <template v-if="collectList[questionIndex]"
+                            ><i class="el-icon-star-on"></i>已收藏</template
+                          >
+                        </div>
                       </div>
                     </div>
 
@@ -248,6 +261,19 @@
                           确认答案
                         </div>
                         <!-- <div class="collect" @click="collect">收藏本题</div> -->
+                        <div
+                          class="collect"
+                          @click="
+                            collect(collectList[questionIndex], questionIndex)
+                          "
+                        >
+                          <template v-if="!collectList[questionIndex]"
+                            ><i class="el-icon-star-off"></i>收藏本题</template
+                          >
+                          <template v-if="collectList[questionIndex]"
+                            ><i class="el-icon-star-on"></i>已收藏</template
+                          >
+                        </div>
                       </div>
                     </div>
 
@@ -339,6 +365,19 @@
                       </div>
                       <div class="question__btns">
                         <!-- <div class="collect" @click="collect">收藏本题</div> -->
+                        <div
+                          class="collect"
+                          @click="
+                            collect(collectList[questionIndex], questionIndex)
+                          "
+                        >
+                          <template v-if="!collectList[questionIndex]"
+                            ><i class="el-icon-star-off"></i>收藏本题</template
+                          >
+                          <template v-if="collectList[questionIndex]"
+                            ><i class="el-icon-star-on"></i>已收藏</template
+                          >
+                        </div>
                       </div>
                     </div>
 
@@ -894,6 +933,19 @@
                       </div>
                       <div class="question__btns">
                         <!-- <div class="collect" @click="collect">收藏本题</div>+ -->
+                        <div
+                          class="collect"
+                          @click="
+                            collect(collectList[questionIndex], questionIndex)
+                          "
+                        >
+                          <template v-if="!collectList[questionIndex]"
+                            ><i class="el-icon-star-off"></i>收藏本题</template
+                          >
+                          <template v-if="collectList[questionIndex]"
+                            ><i class="el-icon-star-on"></i>已收藏</template
+                          >
+                        </div>
                       </div>
                     </div>
 
@@ -994,6 +1046,19 @@
                           确认答案
                         </div>
                         <!-- <div class="collect" @click="collect">收藏本题</div> -->
+                        <div
+                          class="collect"
+                          @click="
+                            collect(collectList[questionIndex], questionIndex)
+                          "
+                        >
+                          <template v-if="!collectList[questionIndex]"
+                            ><i class="el-icon-star-off"></i>收藏本题</template
+                          >
+                          <template v-if="collectList[questionIndex]"
+                            ><i class="el-icon-star-on"></i>已收藏</template
+                          >
+                        </div>
                       </div>
                     </div>
                   </template>
@@ -1214,9 +1279,10 @@ export default {
       isTaking: true, //是否正在拍照
       stream: null,
       loading: false,
-      type: 0, //type:1章卷,2节卷,3模
+      type: 0, //type:1章卷,2节卷,3模
       bankType: 0,
       compareFaceData: 0, // 拍照匹配相似度
+      collectList: [],
     };
   },
   async mounted() {
@@ -1272,7 +1338,24 @@ export default {
         });
       });
     },
-
+    /**
+     * @param {Object} current
+     * 获取收藏信息
+     */
+     getCollectInfo(current) {
+      this.$request.getCollectInfo({
+        examId: this.examId,
+        questionId: this.questionList[current].questionId,
+        goodsId: this.goodsId,
+        orderGoodsId: this.orderGoodsId,
+      })
+      .then((res) => {
+        this.$set(this.collectList, current, res.data);
+      })
+      .catch((err) => {
+        this.$set(this.collectList, current, false);
+      });
+    },
     /**
      * 请求题目列表
      */
@@ -1415,7 +1498,7 @@ export default {
 
           this.questionList = res.data;
           this.lastCount = this.questionList.length;
-
+          this.getCollectInfo(this.current)
           await this.examRecord();
         });
     },
@@ -1706,6 +1789,7 @@ export default {
             gradeId: this.gradeId,
             totalQuestionNum: questionList,
             allQuestionNum: this.questionList.length,
+            orderGoodsId: this.orderGoodsId,
           })
           .then((res) => {
             this.recordId = res.data;
@@ -2001,6 +2085,7 @@ export default {
 
     changeIndex(index) {
       this.current = index;
+      this.getCollectInfo(this.current)
     },
     nextQuestion() {
       if (this.current >= this.questionList.length - 1) {
@@ -2011,6 +2096,7 @@ export default {
         return;
       }
       this.current++;
+      this.getCollectInfo(this.current)
     },
     prevQuestion() {
       if (this.current == 0) {
@@ -2021,6 +2107,7 @@ export default {
         return;
       } else {
         this.current--;
+        this.getCollectInfo(this.current)
       }
     },
     isCheck(item, index) {
@@ -2188,11 +2275,28 @@ export default {
       return count;
     },
 
-    collect() {
-      this.$message({
-        message: "试做题目,不支持收藏~",
-        type: "warning",
-      });
+    collect(state, index) {
+      if (!state) {
+        this.$request
+          .collectQuestion({
+            examId: this.examId,
+            questionId: this.questionList[index].questionId,
+            goodsId: this.goodsId || "",
+            orderGoodsId: this.orderGoodsId,
+          })
+          .then((res) => {
+            this.$set(this.collectList, index, true);
+            this.$message.success("收藏成功");
+            this.getCollectInfo(index);
+          });
+      } else {
+        this.$request
+          .deleteCollectQuestion(this.collectList[index].collectQuestionId)
+          .then((res) => {
+            this.$set(this.collectList, index, false);
+            this.$message.success("取消收藏成功");
+          });
+      }
       return;
     },
     submit() {
@@ -2408,30 +2512,31 @@ export default {
       }
 
       clearInterval(this.timer);
-      //交卷
+      //交卷 /bank/record/edit
       this.$request
         .bankRecordEdit({
           moduleId: this.moduleId || 0,
           chapterId: this.chapterId || 0,
           sectionId: this.sectionId || 0,
           gradeId: this.gradeId,
+          courseId: this.courseId,
+          orderGoodsId: this.orderGoodsId,
+          type: this.type, //题卷类型 1章卷 2节卷 3模块卷	
           examId: this.examId,
-          type: this.type,
           goodsId: this.goodsId,
           reportStatus: reportStatus,
           recordId: this.recordId,
-          courseId: this.courseId,
           rightQuestionNum: number,
           lessQuestionNum: lessQuestionNum,
           status: 1,
           doQuestionIds: doQuestionIds.join(","),
-          // rightQuestionIds:rightQuestionIds.join(','),
-          // doQuestionNum: doQuestionNum,
+          rightQuestionIds:rightQuestionIds.join(','),
+          doQuestionNum: doQuestionNum,
           performance: score,
           totalScore: allScore,
-          // examTime: parseInt(this.allTimes),
-          // doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
-          // historyExamJson: JSON.stringify(this.questionList)
+          examTime: parseInt(this.allTimes),
+          doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
+          historyExamJson: JSON.stringify(this.questionList)
         })
         .then((res) => {
           this.isSubmit = true;
@@ -2454,12 +2559,37 @@ export default {
             this.setExamResult(result);
             this.$router.replace({
               path: "/course-report",
+              query: {
+                // orderGoodsId: this.orderGoodsId,
+                // chapterId: this.chapterId,
+                // moduleId: this.moduleId,
+                examId: this.examId,
+                recordId: this.recordId,
+                type: this.type, //type:1章卷,2节卷,3模块卷
+              },
             });
           }, 1000);
         })
         .catch((err) => {
           console.log(err, "err");
         });
+
+        //错题集id提交(客观题)/exam/wwrong/record
+      this.$request.examWrongRecord({
+          moduleId: this.moduleId || 0,
+          chapterId: this.chapterId || 0,
+          sectionId: this.sectionId || 0,
+          gradeId: this.gradeId,
+          courseId: this.courseId,
+          orderGoodsId: this.orderGoodsId,
+          examId: this.examId,
+          goodsId: this.goodsId,
+          questionIds: doWrongQuestionIds,
+          recordId: this.recordId,
+          type: 2, // 视频课程的传2
+        })
+        .then((res) => {})
+        .catch((err) => {});
     },
   },
 };

+ 133 - 8
src/pages/course-report/index.vue

@@ -94,13 +94,13 @@
           </div>
         </div>
 
-        <!-- <div class="section__footer">
-          <el-button type="primary" class="btn">返回列表</el-button>
-          <el-button type="primary" class="btn">练习下一节</el-button>
-          <el-button type="primary" class="btn">重新做题</el-button>
-          <el-button type="primary" class="btn">错题解析</el-button>
-          <el-button type="primary" class="btn">全部解析</el-button>
-        </div> -->
+        <div class="section__footer">
+          <el-button type="primary" class="btn"  @click="backList()">返回列表</el-button>
+          <!-- <el-button type="primary" class="btn">练习下一节</el-button> -->
+          <el-button type="primary" class="btn" @click="doRepeat(reportdata)">重新做题</el-button>
+          <el-button type="primary" class="btn" @click="wrongExplain(reportdata)">错题解析</el-button>
+          <el-button type="primary" class="btn" @click="allExplain(reportdata)">全部解析</el-button>
+        </div>
 
         <div v-if="courseList.length" class="course_list">
           <div class="course__header">
@@ -163,14 +163,20 @@ export default {
 			pageNum: 1,
 			pageSize: 10,
 			total: 0,
+      recordId: '',
+      type: 0, //type:1章卷,2节卷,3模考卷
     };
   },
   computed: {
     ...mapGetters(["examResult"]),
   },
   created() {
-    this.examId = this.$route.query.examId
+    const { examId, recordId, type } = this.$route.query
+    this.examId = examId
+    this.recordId = recordId
+    this.type = type
     this.getcourList()
+    this.bankReport()
   },
   mounted() {
     if (JSON.stringify(this.examResult) == "{}") {
@@ -195,10 +201,129 @@ export default {
             }
         })
     },
+    bankReport() {
+      this.$request.bankReportData(this.recordId).then((res) => {
+        this.reportdata = res.data
+        // console.log('reportdata:', this.reportdata)
+      });
+    },
     currentChangeCou(val) {
       this.pageNum = val
       this.getcourList()
     },
+    backList() {
+      this.$router.go(-1)
+    },
+    /**
+     * 去做题
+     */
+    async doRepeat(reportdata) {
+      // /bank/record/doNum
+      let count = await this.bankRecordDoNum()
+      console.log('已做的次数', count)
+      let answerNum = await this.getExamDetail(this.reportdata.examId)
+      console.log('全部的次数', answerNum)
+      //超过答题次数
+      if (answerNum > 0 && count >= answerNum) {
+        this.$message({
+          type: "warning",
+          message: "该试卷只能答题" + answerNum + "次!",
+        });
+        return;
+      }
+      // answerNum==0没有答题次数限制
+      if (answerNum == 0 || (answerNum - count > 0 && answerNum > 0)) {
+        this.$router.push({
+          path: "/course-exam/" + this.reportdata.goodsId,
+          query: {
+            courseId: this.reportdata.courseId,
+            gradeId: this.reportdata.gradeId || 0,
+            moduleId: this.reportdata.moduleId || 0,
+            sectionId: this.reportdata.sectionId || 0,
+            examId: this.reportdata.examId,
+            type: this.type,
+            chapterId: this.reportdata.chapterId || 0,
+            orderGoodsId: this.reportdata.orderGoodsId,
+          },
+        })
+      }
+
+      // this.studyLog()
+    },
+    /**
+     * 获取试卷已做的次数
+     */
+    bankRecordDoNum() {
+      return new Promise((resolve) => {
+        this.$request
+          .bankRecordDoNum({
+            goodsId: this.reportdata.goodsId,
+            gradeId: this.reportdata.gradeId,
+            chapterId: this.reportdata.chapterId || 0,
+            courseId: this.reportdata.courseId,
+            moduleId: this.reportdata.moduleId || 0,
+            examId: this.reportdata.examId,
+          })
+          .then((res) => {
+            resolve(res.data);
+          });
+      });
+    },
+    /**
+     * @param {Object} exam_id
+     * 获取试卷可以做的次数
+     */
+    getExamDetail(exam_id) {
+      return new Promise((resolve) => {
+        this.$request.getExamDetail(exam_id).then((res) => {
+          resolve(res.data.answerNum);
+        });
+      });
+    },
+    // 新增用户视频学习日志
+    studyLog() {
+      this.$axios({
+        url: "/user/study/log",
+        method: "post",
+        data: {
+          goodsId: this.reportdata.goodsId,
+          courseId: this.reportdata.courseId,
+          moduleId: this.reportdata.moduleId || 0,
+          chapterId: this.reportdata.chapterId || 0,
+          sectionId: this.reportdata.sectionId || 0,
+          fromPlat: 2, //来源平台 1小程序 2PC网站
+          goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
+          orderGoodsId: this.reportdata.orderGoodsId,
+        },  
+      }).then((res) => {
+      });
+    },
+    wrongExplain(reportdata) {
+      this.$router.push({
+        path: "/bank-exam-wrong-explain/" + reportdata.recordId,
+        query: {
+          examId: reportdata.examId,
+          moduleId: reportdata.moduleId || 0,
+          chapterId: reportdata.chapterId || 0,
+          goodsId: reportdata.goodsId,
+          orderGoodsId: reportdata.orderGoodsId,
+          courseType: 2,
+        },
+      });
+    },
+
+    allExplain(reportdata) {
+      this.$router.push({
+        path: "/bank-exam-all-explain/" + reportdata.recordId,
+        query: {
+          examId: reportdata.examId,
+          moduleId: reportdata.moduleId || 0,
+          chapterId: reportdata.chapterId || 0,
+          goodsId: reportdata.goodsId,
+          courseType: 2,
+        },
+      });
+    },
   },
 };
 </script>

+ 1 - 1
src/pages/mock-exam/index.vue

@@ -1503,7 +1503,7 @@ export default {
 
           this.questionList = res.data;
           this.lastCount = this.questionList.length;
-
+          this.getCollectInfo(this.current)
           await this.mockRecord();
         });
     },

+ 111 - 21
src/pages/person-center/bank-record/index.vue

@@ -97,28 +97,13 @@
                       <div
                         class="btn-line__in"
                         v-if="record.status == 1"
-                        @click="
-                          go('/bank-report/' + record.goodsId, {
-                            chapterId: record.chapterExamId,
-                            moduleId: record.moduleExamId,
-                            examId: record.examId,
-                            recordId: record.recordId,
-                            orderGoodsId: record.orderGoodsId,
-                          })
-                        "
+                        @click="doReport(record)"
                       >
                         <div>做题报告</div>
                       </div>
                       <div
                         class="btn-line__in"
-                        @click="
-                          go('/person-center/record-list/' + record.goodsId, {
-                            examId: record.examId,
-                            chapterId: record.chapterExamId,
-                            moduleId: record.moduleExamId,
-                            recordId: record.recordId,
-                          })
-                        "
+                        @click="moreRecords(record)"
                       >
                         <div>更多记录</div>
                       </div>
@@ -157,7 +142,7 @@ export default {
       list: [],
       param: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 5,
         goodsId: "",
         paperId: "",
       },
@@ -200,6 +185,37 @@ export default {
         query,
       });
     },
+    moreRecords(record) {
+      let queryData = {}
+      if (record.courseType == 2) {
+        queryData = {
+          examId: record.examId,
+          gradeId: record.gradeId,
+          chapterId: record.chapterId,
+          moduleId: record.moduleId,
+          courseId: record.courseId,
+          sectionId: record.sectionId,
+          courseType: record.courseType,
+        }
+        this.$router.push({
+          path: '/person-center/record-list/' + record.goodsId, 
+          query: queryData
+        })
+
+      } else {
+        queryData = {
+          examId: record.examId,
+          chapterId: record.chapterExamId,
+          moduleId: record.moduleExamId,
+          recordId: record.recordId,
+          courseType: record.courseType,
+        }
+        this.$router.push({
+          path: '/person-center/record-list/' + record.goodsId, 
+          query: queryData
+        })
+      }
+    },
     currentChange(e) {
       this.param.pageNum = e;
       this.getExamRecordList();
@@ -212,7 +228,14 @@ export default {
     },
 
     async doRepeat(section) {
-      let count = await this.examRecordCount(section.examId);
+      console.log('section:', section)
+      let count = 0
+      if (section.courseType == 2) {
+        count = await this.bankRecordDoNum(section)
+      } else {
+        count = await this.examRecordCount(section.examId)
+      }
+      console.log('已做的次数', count)
       let answerNum = await this.getExamDetail(section.examId);
       //超过答题次数
       if (answerNum > 0 && count >= answerNum) {
@@ -232,7 +255,22 @@ export default {
         showClose: false,
       })
         .then((_) => {
-          this.$router.push({
+          if (section.courseType == 2){
+              this.$router.push({
+                path: "/course-exam/" + section.goodsId,
+                query: {
+                  courseId: section.courseId,
+                  gradeId: section.gradeId || 0,
+                  moduleId: section.moduleId || 0,
+                  sectionId: section.sectionId || 0,
+                  examId: section.examId,
+                  type: section.type, // 模块卷类型
+                  chapterId: section.chapterId || 0,
+                  orderGoodsId: section.orderGoodsId,
+                },
+            })
+          } else {
+            this.$router.push({
             path: "/bank-exam/" + section.goodsId,
             query: {
               orderGoodsId: section.orderGoodsId,
@@ -241,6 +279,8 @@ export default {
               chapterId: section.chapterExamId || 0,
             },
           });
+          }
+          
         })
         .catch((_) => {
           this.$router.push({
@@ -251,11 +291,30 @@ export default {
               chapterId: section.chapterExamId || 0,
               goodsId: section.goodsId,
               orderGoodsId: section.orderGoodsId,
+              courseType: section.courseType,
             },
           });
         });
     },
-
+    /**
+     * 获取视频试卷已做的次数
+     */
+    bankRecordDoNum(section) {
+      return new Promise((resolve) => {
+        this.$request
+          .bankRecordDoNum({
+            goodsId: section.goodsId,
+            gradeId: section.gradeId,
+            chapterId: section.chapterId || 0,
+            courseId: section.courseId,
+            moduleId: section.moduleId || 0,
+            examId: section.examId,
+          })
+          .then((res) => {
+            resolve(res.data);
+          });
+      });
+    },
     /**
      * 查询试卷历史做题次数
      */
@@ -282,6 +341,37 @@ export default {
         });
       });
     },
+    doReport(record) {
+      console.log('做题报告', record, record.courseType)
+      if (record.courseType == 2) {
+        this.$router.push({
+          path: "/course-report",
+          query: {
+            examId: record.examId,
+            recordId: record.recordId,
+            type: record.type, //type:1章卷,2节卷,3模块卷
+          },
+        })
+      } else {
+        this.$router.push({
+            path: '/bank-report/' + record.goodsId,
+            query: {
+              chapterId: record.chapterExamId,
+              moduleId: record.moduleExamId,
+              examId: record.examId,
+              recordId: record.recordId,
+              orderGoodsId: record.orderGoodsId,
+            },
+          })
+      }
+      // go('/bank-report/' + record.goodsId, {
+      //   chapterId: record.chapterExamId,
+      //   moduleId: record.moduleExamId,
+      //   examId: record.examId,
+      //   recordId: record.recordId,
+      //   orderGoodsId: record.orderGoodsId,
+      // })
+    },
   },
 };
 </script>

+ 129 - 14
src/pages/person-center/bank-record/record-list/index.vue

@@ -64,14 +64,7 @@
                       <div
                         class="btn-line__in"
                         v-if="record.status == 1"
-                        @click="
-                          go('/bank-report/' + record.goodsId, {
-                            chapterId: record.chapterExamId,
-                            moduleId: record.moduleExamId,
-                            examId: record.examId,
-                            recordId: record.recordId,
-                            orderGoodsId: record.orderGoodsId,
-                          })
+                        @click="doReport(record)
                         "
                       >
                         <div>做题报告</div>
@@ -109,14 +102,23 @@ export default {
     return {
       param: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 5,
         moduleExamId: 0,
         chapterExamId: 0,
         examId: 0,
         goodsId: 0,
       },
+      record: {
+        examId: '',
+        gradeId: '',
+        chapterId: '',
+        moduleId: '',
+        courseId: '',
+        sectionId: '',
+      },
       recordList: [],
       total: 0,
+      courseType: 1, // 2视频试卷
     };
   },
   mounted() {
@@ -124,7 +126,22 @@ export default {
     this.param.chapterExamId = this.$route.query.chapterId;
     this.param.examId = this.$route.query.examId;
     this.param.goodsId = this.$route.params.goodsId;
-    this.examRecordList();
+    this.courseType = this.$route.query.courseType
+    if (this.courseType == 2) {
+      const { examId, gradeId, chapterId, moduleId, courseId, sectionId} = this.$route.query
+      this.record = {
+        examId: +examId,
+        gradeId: +gradeId,
+        chapterId: +chapterId,
+        moduleId: +moduleId,
+        courseId: +courseId,
+        sectionId: +sectionId,
+      }
+      this.recordBankList()
+    } else {
+      this.examRecordList();
+    }
+    
   },
   methods: {
     go(path, query) {
@@ -137,7 +154,12 @@ export default {
     },
     currentChange(e) {
       this.param.pageNum = e;
-      this.getExamRecordList();
+      // this.getExamRecordList();
+      if (this.courseType == 2) {
+        this.recordBankList()
+      } else {
+        this.examRecordList();
+      }
     },
     examRecordList() {
       this.$request.examRecordList(this.param).then((res) => {
@@ -145,9 +167,37 @@ export default {
         this.total = res.total;
       });
     },
-
+    recordBankList() {
+      let params = {
+          examId: this.record.examId,
+          goodsId: this.param.goodsId,
+          pageNum: this.param.pageNum,
+          pageSize: this.param.pageSize
+        }
+        this.record.gradeId && (params['gradeId'] = this.record.gradeId)
+        this.record.chapterId && (params['chapterId'] = this.record.chapterId)
+        this.record.courseId && (params['courseId'] = this.record.courseId)
+        this.record.moduleId && (params['moduleId'] = this.record.moduleId)
+        this.record.sectionId && (params['sectionId'] = this.record.sectionId)
+        console.log('参数params', params)
+        this.$axios({
+          url: '/bank/record/bankList',
+          method: 'get',
+          params: params
+        }).then((res) => {
+          this.recordList = res.rows || []
+          this.total = res.total
+        })
+    },
     async doRepeat(section) {
-      let count = await this.examRecordCount(section.examId);
+      // let count = await this.examRecordCount(section.examId);
+      let count = 0
+      if (this.courseType == 2) {
+        count = await this.bankRecordDoNum(section)
+      } else {
+        count = await this.examRecordCount(section.examId)
+      }
+      console.log('已做的次数', count)
       let answerNum = await this.getExamDetail(section.examId);
       //超过答题次数
       if (answerNum > 0 && count >= answerNum) {
@@ -167,6 +217,21 @@ export default {
         showClose: false,
       })
         .then((_) => {
+          if (this.courseType == 2){
+              this.$router.push({
+                path: "/course-exam/" + section.goodsId,
+                query: {
+                  courseId: section.courseId,
+                  gradeId: section.gradeId || 0,
+                  moduleId: section.moduleId || 0,
+                  sectionId: section.sectionId || 0,
+                  examId: section.examId,
+                  type: section.type, // 模块卷类型
+                  chapterId: section.chapterId || 0,
+                  orderGoodsId: section.orderGoodsId,
+                },
+            })
+          } else {
           this.$router.push({
             path: "/bank-exam/" + section.goodsId,
             query: {
@@ -176,6 +241,7 @@ export default {
               chapterId: section.chapterExamId || 0,
             },
           });
+          }
         })
         .catch((_) => {
           this.$router.push({
@@ -185,12 +251,31 @@ export default {
               moduleId: section.moduleExamId || 0,
               chapterId: section.chapterExamId || 0,
               goodsId: section.goodsId,
+              courseType: this.courseType,
               orderGoodsId: section.orderGoodsId,
             },
           });
         });
     },
-
+    /**
+     * 获取视频试卷已做的次数
+     */
+    bankRecordDoNum(section) {
+      return new Promise((resolve) => {
+        this.$request
+          .bankRecordDoNum({
+            goodsId: section.goodsId,
+            gradeId: section.gradeId,
+            chapterId: section.chapterId || 0,
+            courseId: section.courseId,
+            moduleId: section.moduleId || 0,
+            examId: section.examId,
+          })
+          .then((res) => {
+            resolve(res.data);
+          });
+      });
+    },
     /**
      * 查询试卷历史做题次数
      */
@@ -217,6 +302,36 @@ export default {
         });
       });
     },
+    doReport(record) {
+      if (this.courseType == 2) {
+        this.$router.push({
+          path: "/course-report",
+          query: {
+            examId: record.examId,
+            recordId: record.recordId,
+            type: record.type, //type:1章卷,2节卷,3模块卷
+          },
+        })
+      } else {
+        this.$router.push({
+            path: '/bank-report/' + record.goodsId,
+            query: {
+              chapterId: record.chapterExamId,
+              moduleId: record.moduleExamId,
+              examId: record.examId,
+              recordId: record.recordId,
+              orderGoodsId: record.orderGoodsId,
+            },
+          })
+      }
+      // go('/bank-report/' + record.goodsId, {
+      //   chapterId: record.chapterExamId,
+      //   moduleId: record.moduleExamId,
+      //   examId: record.examId,
+      //   recordId: record.recordId,
+      //   orderGoodsId: record.orderGoodsId,
+      // })
+    },
   },
 };
 </script>

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

@@ -94,12 +94,12 @@
                 <router-link to="/person-center/bank-record">
                   <div class="item">做题记录</div>
                 </router-link>
-                <!-- <router-link to="/person-center/my-collect">
+                <router-link to="/person-center/my-collect">
                   <div class="item">收藏集</div>
                 </router-link>
                 <router-link to="/person-center/my-wrong">
                   <div class="item">错题集</div>
-                </router-link> -->
+                </router-link>
               </div>
             </div>
             <div class="nav__section">

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

@@ -398,7 +398,7 @@
                 </div>
               </div>
             </el-tab-pane>
-            <el-tab-pane label="收藏题集" name="-1">
+            <!-- <el-tab-pane label="收藏题集" name="-1">
               <div class="goods-collect">
                 <div class="goods-collect__header">
                   <div class="selects">
@@ -675,7 +675,7 @@
                   </div>
                 </div>
               </div>
-            </el-tab-pane>
+            </el-tab-pane> -->
           </el-tabs>
         </div>
         <div v-if="false" class="right-box">

+ 2 - 2
src/pages/subject/collect-bank.vue

@@ -915,9 +915,9 @@
                     >返回</el-button
                   >
                 </div>
-                <div class="right-box__footer">
+                <!-- <div class="right-box__footer">
                   <div class="submit" v-if="!explain" @click="submit">交卷</div>
-                </div>
+                </div> -->
                 <div class="right-box__header">答题卡</div>
                 <div class="right-box__body">
                   <div class="card">

+ 2 - 2
src/pages/subject/wrong-bank.vue

@@ -914,9 +914,9 @@
                     >返回</el-button
                   >
                 </div>
-                <div class="right-box__footer">
+                <!-- <div class="right-box__footer">
                   <div class="submit" v-if="!explain" @click="submit">交卷</div>
-                </div>
+                </div> -->
                 <div class="right-box__header">答题卡</div>
                 <div class="right-box__body">
                   <div class="card">

+ 1 - 1
src/router/index.js

@@ -676,7 +676,7 @@ router.beforeEach((to,from,next) => {
       let isBankLock = bankAdmin.some(item => {
         return to.path.indexOf(item) != -1
       })
-      console.log(isBankLock,'isBankLock')
+      console.log(isBankLock,'isBankLock', canToBank)
       if(isBankLock) {
         
         //没有执行定时器,开启锁定