chenxiong пре 3 година
родитељ
комит
f18437542b

+ 0 - 1
src/axios.js

@@ -9,7 +9,6 @@ export const tenantId = '867735392558919680'
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
 
-import { Notification, MessageBox, Message } from 'element-ui'
 import tools from './common/tools'
 import router from './router'
 

+ 2 - 0
src/pages/bank-exam-all-explain/index.vue

@@ -109,6 +109,7 @@
                       <div class="question__content">
                         <div class="question-list" v-if="!question.ques">
                           <el-checkbox
+                            disabled
                             class="checkbox"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
@@ -333,6 +334,7 @@
                                   v-if="!question.ques[jsonIndex]"
                                 >
                                   <el-checkbox
+                                    disabled
                                     class="checkbox"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"

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

@@ -889,8 +889,55 @@ export default {
       examData: {},
       orderGoodsId: "",
       collectList: [],
+      isSubmit: false,
     };
   },
+  beforeRouteLeave(to, from, next) {
+    if (this.isSubmit) {
+      //交卷
+      next();
+      return;
+    }
+
+    let ansCount = this.questionOverNum(true); //已答题数
+    this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
+
+    //所有题目答完
+    if (this.lastCount == 0) {
+      // this.testOver = true;
+      this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
+        confirmButtonText: "结束做题",
+        cancelButtonText: "下次继续",
+        type: "warning",
+      })
+        .then(() => {
+          this.examSubmit();
+        })
+        .catch(() => {
+          this.examRecordEdit();
+          next();
+        });
+      //未答完
+    } else {
+      this.$confirm(
+        `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
+        "温馨提示",
+        {
+          confirmButtonText: "继续作答",
+          cancelButtonText: "下次继续",
+          type: "warning",
+        }
+      )
+        .then(() => {
+          // confirmButton回调
+        })
+        .catch(() => {
+          this.examRecordEdit();
+          next();
+        });
+      // this.isLastCount = true;
+    }
+  },
   async mounted() {
     this.goodsId = this.$route.params.goodsId;
     this.examId = this.$route.query.examId;
@@ -1568,6 +1615,120 @@ export default {
           console.log(err, "err");
         });
     },
+
+    /**
+     * 离开页面统计回答正确题数
+     */
+    examRecordEdit() {
+      let number = 0;
+      let score = 0;
+      let doQuestionNum = 0;
+      let doQuestionIds = []; //做过的题目id
+      this.questionList.forEach((item, index) => {
+        if (item.type == 1) {
+          if (item.ques == item.ans) {
+            score += item.score;
+            number++;
+          }
+
+          if (item.ques) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item.type == 2) {
+          let isRight =
+            item.ans &&
+            item.ans.every((quesItem, quesIndex) => {
+              if (item.ques) {
+                return item.ques[quesIndex] == item.ans[quesIndex];
+              } else {
+                return false;
+              }
+            });
+
+          if (isRight) {
+            score += item.score;
+            number++;
+          } else {
+            let checkboxScore = item.score; //获取单题总分数
+            item.ques &&
+              item.ques.forEach((ques, quesIndex) => {
+                //选错一个全扣
+                if (item.ques) {
+                  if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
+                    checkboxScore = 0;
+                  }
+                } else {
+                  checkboxScore = 0;
+                }
+              });
+            console.log(checkboxScore);
+
+            //没选错
+            if (checkboxScore) {
+              item.ans.forEach((ans, quesIndex) => {
+                //漏选扣一部分
+                if (item.ques) {
+                  if (item.ques.indexOf(item.ans[quesIndex]) == -1) {
+                    checkboxScore = item.partScore;
+                  }
+                } else {
+                  checkboxScore = 0;
+                }
+              });
+            }
+
+            if (checkboxScore <= 0) {
+              //0分
+            } else {
+              //部分分
+              // number++;
+              score += checkboxScore;
+            }
+          }
+          if (item.ques && item.ques.length) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item.type == 3) {
+          if (item.ques == item.ans) {
+            score += item.score;
+            number++;
+          }
+
+          if (item.ques) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item == 4) {
+          if (item.ques.length) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item.type == 5) {
+          if (item.ques && (item.ques.imageList.length || item.ques.text)) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        }
+      });
+
+      this.$request
+        .examRecordEdit({
+          examId: this.examId,
+          goodsId: this.goodsId,
+          recordId: this.recordId,
+          orderGoodsId: this.orderGoodsId,
+          doQuestionIds: doQuestionIds.join(","),
+          rightQuestionNum: number,
+          moduleExamId: this.moduleId || 0,
+          chapterExamId: this.chapterId || 0,
+          status: 0,
+          doQuestionNum: doQuestionNum,
+          historyExamJson: JSON.stringify(this.questionList),
+        })
+        .then((res) => {});
+    },
   },
 };
 </script>
@@ -1866,7 +2027,7 @@ export default {
                   }
 
                   .collect {
-                    width: 100%;
+                    width: 100px;
                     cursor: pointer;
                     position: absolute;
                     right: 0;
@@ -1876,6 +2037,10 @@ export default {
                     font-weight: 400;
                     color: #3f8dfd;
                     line-height: 24px;
+
+                    i {
+                      font-size: 20px;
+                    }
                   }
                 }
               }

+ 2 - 0
src/pages/bank-exam-explain/index.vue

@@ -107,6 +107,7 @@
                       <div class="question__content">
                         <div class="question-list" v-if="!question.ques">
                           <el-checkbox
+                            disabled
                             class="checkbox"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
@@ -327,6 +328,7 @@
                                   v-if="!question.ques[jsonIndex]"
                                 >
                                   <el-checkbox
+                                    disabled
                                     class="checkbox"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"

+ 2 - 0
src/pages/bank-exam-wrong-explain/index.vue

@@ -109,6 +109,7 @@
                       <div class="question__content">
                         <div class="question-list" v-if="!question.ques">
                           <el-checkbox
+                            disabled
                             class="checkbox"
                             v-for="(item, index) in question.jsonStr"
                             :key="index"
@@ -333,6 +334,7 @@
                                   v-if="!question.ques[jsonIndex]"
                                 >
                                   <el-checkbox
+                                    disabled
                                     class="checkbox"
                                     v-for="(item, index) in json.optionsList"
                                     :key="index"

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

@@ -926,6 +926,7 @@ export default {
       examData: {},
       orderGoodsId: "",
       collectList: [],
+      isSubmit: false,
     };
   },
   async mounted() {
@@ -947,16 +948,90 @@ export default {
     } catch (err) {}
   },
   beforeRouteLeave(to, from, next) {
-    this.$confirm("系统可能不会保存您所做的更改。", "离开此页面?", {
-      confirmButtonText: "离开",
-      cancelButtonText: "取消",
-      type: "warning",
-    })
-      .then(() => {
-        // confirmButton回调
-        next();
-      })
-      .catch(() => {});
+    if (this.isSubmit) {
+      //交卷
+      next();
+    } else {
+      //离开
+      if (this.bankType == 1) {
+        console.log(1);
+        let ansCount = this.questionOverNum(true); //已答题数
+        this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
+
+        //所有题目答完
+        if (this.lastCount == 0) {
+          // this.testOver = true;
+          this.$confirm("您还未交卷,确定结束做题吗?", "温馨提示", {
+            confirmButtonText: "结束做题",
+            cancelButtonText: "下次继续",
+            type: "warning",
+          })
+            .then(() => {
+              this.examSubmit();
+            })
+            .catch(() => {
+              this.examRecordEdit();
+              next();
+            });
+          //未答完
+        } else {
+          this.$confirm(
+            `您还有${this.lastCount}道题未作答, 现在继续作答,还是下次继续?`,
+            "温馨提示",
+            {
+              confirmButtonText: "继续作答",
+              cancelButtonText: "下次继续",
+              type: "warning",
+            }
+          )
+            .then(() => {
+              // confirmButton回调
+            })
+            .catch(() => {
+              this.examRecordEdit();
+              next();
+            });
+          // this.isLastCount = true;
+        }
+      } else if (this.bankType == 2) {
+        console.log(2);
+        let ansCount = this.questionOverNum(true); //已答题数
+        this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
+
+        //所有题目答完
+        if (this.lastCount == 0) {
+          this.$confirm(`您已完成所有题目,快去交卷吧!`, "温馨提示", {
+            confirmButtonText: "立即交卷",
+            cancelButtonText: "暂不交卷",
+            type: "warning",
+          })
+            .then(() => {
+              // confirmButton回调
+              this.examSubmit();
+              next();
+            })
+            .catch(() => {});
+          //未答完
+        } else {
+          this.$confirm(
+            `您当前正在测试,还剩${this.lastCount}道题未完成,离开视为交卷`,
+            "温馨提示",
+            {
+              confirmButtonText: "继续离开",
+              cancelButtonText: "暂不离开",
+              type: "warning",
+            }
+          )
+            .then(() => {
+              // confirmButton回调
+              console.log(12);
+              this.leaveNow();
+              next();
+            })
+            .catch(() => {});
+        }
+      }
+    }
   },
   methods: {
     ...mapMutations(["setExamResult"]),
@@ -994,6 +1069,27 @@ export default {
         });
     },
 
+    /**
+     * 是否做完所有题目
+     */
+    isDoOver() {
+      let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
+      if (this.questionList.length == questionOverNum) {
+        //全部做完弹窗
+        this.cgType = 9;
+        this.$confirm("您已完成所有题目,快去交卷吧!", "提示", {
+          confirmButtonText: "立即交卷",
+          cancelButtonText: "暂不交卷",
+          type: "warning",
+        })
+          .then(() => {
+            // confirmButton回调
+            next();
+          })
+          .catch(() => {});
+      }
+    },
+
     /**
      * 请求题目列表
      */
@@ -1207,6 +1303,9 @@ export default {
       });
     },
 
+    /**
+     * 离开页面统计回答正确题数
+     */
     examRecordEdit() {
       let number = 0;
       let score = 0;
@@ -1863,6 +1962,9 @@ export default {
         return "";
       }
     },
+    /**
+     * 交卷,跳转报告页
+     */
     examSubmit() {
       let score = 0; //计算总分
       let reportStatus = 0;
@@ -2061,6 +2163,179 @@ export default {
         .then((res) => {})
         .catch((err) => {});
     },
+
+    /**
+     * 交卷,不用跳转
+     */
+    leaveNow() {
+      let score = 0; //计算总分
+      let reportStatus = 0;
+      let number = 0; //做对的题目数量
+      let doQuestionNum = 0; //做过的题目数量
+      let allScore = 0; //总分
+      let passScore = 0;
+      let doWrongQuestionIds = []; //错题和未做题id(客观题)
+      let doQuestionIds = []; //做过的题目id
+      let rightQuestionIds = []; //做对的题目id
+      console.log(111);
+      this.questionList.forEach((item, index) => {
+        passScore = item.passScore;
+        if (item.type == 1) {
+          //正确
+          if (item.ques == item.ans) {
+            item.scoreResult = item.score;
+            score += item.score;
+            number++;
+            rightQuestionIds.push(item.questionId);
+          } else {
+            //错误
+            item.scoreResult = 0;
+            doWrongQuestionIds.push(item.questionId);
+          }
+          allScore += item.score;
+          if (item.ques) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item.type == 2) {
+          let isRight =
+            item.ans &&
+            item.ans.every((quesItem, quesIndex) => {
+              if (item.ques) {
+                return item.ques[quesIndex] == item.ans[quesIndex];
+              } else {
+                return false;
+              }
+            });
+
+          if (isRight) {
+            score += item.score;
+            number++;
+            item.scoreResult = item.score;
+            rightQuestionIds.push(item.questionId);
+          } else {
+            let checkboxScore = item.score; //获取单题总分数
+            item.ques &&
+              item.ques.forEach((ques, quesIndex) => {
+                //选错一个全扣
+                if (item.ques) {
+                  if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
+                    checkboxScore = 0;
+                  }
+                } else {
+                  checkboxScore = 0;
+                }
+              });
+            console.log(checkboxScore);
+
+            //没选错
+            if (checkboxScore) {
+              item.ans.forEach((ans, quesIndex) => {
+                //漏选扣一部分
+                if (item.ques) {
+                  if (item.ques.indexOf(item.ans[quesIndex]) == -1) {
+                    checkboxScore = item.partScore;
+                  }
+                } else {
+                  checkboxScore = 0;
+                }
+              });
+            }
+
+            if (checkboxScore <= 0) {
+              //0分
+              item.scoreResult = 0;
+              doWrongQuestionIds.push(item.questionId);
+            } else {
+              //部分分
+              // number++;
+              doWrongQuestionIds.push(item.questionId);
+              item.scoreResult = checkboxScore;
+              score += checkboxScore;
+              // rightQuestionIds.push(item.questionId)
+            }
+          }
+          allScore += item.score;
+          if (item.ques && item.ques.length) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item.type == 3) {
+          if (item.ques == item.ans) {
+            item.scoreResult = item.score;
+            score += item.score;
+            number++;
+            rightQuestionIds.push(item.questionId);
+          } else {
+            item.scoreResult = 0;
+            doWrongQuestionIds.push(item.questionId);
+          }
+          allScore += item.score;
+          if (item.ques) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item.type == 4) {
+          allScore += item.score;
+          if (item.ques && item.ques.length) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        } else if (item.type == 5) {
+          allScore += item.score;
+          if (item.ques && (item.ques.imageList.length || item.ques.text)) {
+            doQuestionNum++;
+            doQuestionIds.push(item.questionId);
+          }
+        }
+      });
+
+      //大于及格
+      if (score >= passScore) {
+        reportStatus = 1;
+      } else {
+        reportStatus = 0;
+      }
+
+      console.log(333);
+      //交卷
+      this.$request
+        .examRecordEdit({
+          examId: this.examId,
+          goodsId: this.goodsId,
+          orderGoodsId: this.orderGoodsId,
+          reportStatus: reportStatus,
+          recordId: this.recordId,
+          rightQuestionNum: number,
+          status: 1,
+          moduleExamId: this.moduleId || 0,
+          chapterExamId: this.chapterId || 0,
+          doQuestionIds: doQuestionIds.join(","),
+          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),
+        })
+        .then((res) => {
+          clearInterval(this.timer);
+        });
+
+      console.log(222);
+      //错题集id提交(客观题)
+      this.$request
+        .examWrongRecord({
+          orderGoodsId: this.orderGoodsId,
+          examId: this.examId,
+          goodsId: this.goodsId,
+          questionIds: doWrongQuestionIds,
+          recordId: this.recordId,
+        })
+        .then((res) => {})
+        .catch((err) => {});
+    },
   },
 };
 </script>

+ 170 - 137
src/pages/course-detail/index.vue

@@ -2320,8 +2320,27 @@ export default {
     }
 
     this.courseCourseList();
-    this.getbaseprofiletplists();
     this.dictList();
+
+    this.getbaseprofiletplists().then((res) => {
+      let noteSecond = this.$route.query.noteSecond;
+      if (noteSecond > 0) {
+        let item = {
+          sectionId: this.$route.query.sectionId,
+          recordingUrl: this.$route.query.recordingUrl,
+          noteSecond: noteSecond,
+          studyDuration: noteSecond,
+          moduleId: this.$route.query.moduleId,
+          chapterId: this.$route.query.chapterId,
+        };
+
+        this.sectionItem = item;
+        this.playSectionId = this.$route.query.sectionId;
+        setTimeout(() => {
+          this.noteClick(item);
+        }, 1000);
+      }
+    });
   },
   beforeDestroy() {
     try {
@@ -3075,146 +3094,156 @@ export default {
     },
 
     getbaseprofiletplists() {
-      let self = this;
-      this.$request
-        .getbaseprofiletplists({
-          goodsId: this.goodsId,
-          orderGoodsId: this.orderGoodsId,
-        })
-        .then((res) => {
-          console.log(res, "res");
-          if (res.code === 200 && res.rows.length) {
-            if (res.rows[0].keyValue) {
-              self.$request.getbaseprofiletpId(self.goodsId).then((baseRes) => {
-                if (baseRes.code === 200) {
-                  if (baseRes.data) {
-                    self.$request
-                      .getbaseprofiletpgetInfo({
-                        goodsId: self.goodsId,
-                        orderGoodsId: self.orderGoodsId,
-                      })
-                      .then((result) => {
-                        console.log(result, "result");
-                        if (result.code === 200) {
-                          if (
-                            !result.data ||
-                            (result.data.status === 3 &&
-                              result.data.changeStatus === 1)
-                          ) {
-                            if (!result.data) {
-                              self.needProfileModal = true;
-
-                              this.$confirm(`请填写资料`, "提示", {
-                                confirmButtonText: "确定",
-                                cancelButtonText: "返回",
-                                closeOnClickModal: false,
-                                closeOnPressEscape: false,
-                                distinguishCancelAndClose: false,
-                                showClose: false,
-                              })
-                                .then((_) => {
-                                  this.showInfoDetailModal = true;
-                                  this.getInfo();
-                                })
-                                .catch((_) => {
-                                  this.$router.back(-1);
-                                });
-                            } else {
-                              this.$confirm(
-                                `资料审核不通过,请前往重新填写`,
-                                "提示",
-                                {
-                                  confirmButtonText: "确定",
-                                  cancelButtonText: "返回",
-                                  closeOnClickModal: false,
-                                  closeOnPressEscape: false,
-                                  distinguishCancelAndClose: false,
-                                  showClose: false,
+      return new Promise((resolve) => {
+        let self = this;
+        this.$request
+          .getbaseprofiletplists({
+            goodsId: this.goodsId,
+            orderGoodsId: this.orderGoodsId || "",
+          })
+          .then((res) => {
+            console.log(res, "res");
+            if (res.code === 200 && res.rows.length) {
+              if (res.rows[0].keyValue) {
+                self.$request
+                  .getbaseprofiletpId(self.goodsId)
+                  .then((baseRes) => {
+                    if (baseRes.code === 200) {
+                      if (baseRes.data) {
+                        self.$request
+                          .getbaseprofiletpgetInfo({
+                            goodsId: self.goodsId,
+                            orderGoodsId: self.orderGoodsId,
+                          })
+                          .then((result) => {
+                            console.log(result, "result");
+                            if (result.code === 200) {
+                              if (
+                                !result.data ||
+                                (result.data.status === 3 &&
+                                  result.data.changeStatus === 1)
+                              ) {
+                                if (!result.data) {
+                                  self.needProfileModal = true;
+
+                                  this.$confirm(`请填写资料`, "提示", {
+                                    confirmButtonText: "确定",
+                                    cancelButtonText: "返回",
+                                    closeOnClickModal: false,
+                                    closeOnPressEscape: false,
+                                    distinguishCancelAndClose: false,
+                                    showClose: false,
+                                  })
+                                    .then((_) => {
+                                      this.showInfoDetailModal = true;
+                                      this.getInfo();
+                                    })
+                                    .catch((_) => {
+                                      this.$router.back(-1);
+                                    });
+                                } else {
+                                  this.$confirm(
+                                    `资料审核不通过,请前往重新填写`,
+                                    "提示",
+                                    {
+                                      confirmButtonText: "确定",
+                                      cancelButtonText: "返回",
+                                      closeOnClickModal: false,
+                                      closeOnPressEscape: false,
+                                      distinguishCancelAndClose: false,
+                                      showClose: false,
+                                    }
+                                  )
+                                    .then((_) => {
+                                      this.showInfoDetailModal = true;
+                                      this.getInfo();
+                                    })
+                                    .catch((_) => {
+                                      this.$router.back(-1);
+                                    });
                                 }
-                              )
-                                .then((_) => {
-                                  this.showInfoDetailModal = true;
-                                  this.getInfo();
-                                })
-                                .catch((_) => {
-                                  this.$router.back(-1);
-                                });
-                            }
-                          } else if (
-                            result.data.status === 1 &&
-                            JSON.parse(res.rows[0].keyValue2)[0]
-                          ) {
-                            self.$request
-                              .getbaseprofileStampgetInfo({
-                                goodsId: self.goodsId,
-                                orderGoodsId: self.orderGoodsId,
-                              })
-                              .then((k) => {
-                                if (k.code === 200) {
-                                  if (
-                                    !k.data ||
-                                    (k.data.status === 3 &&
-                                      k.data.changeStatus === 1)
-                                  ) {
-                                    if (!k.data) {
-                                      this.$confirm(
-                                        `请前往填写盖章资料`,
-                                        "提示",
-                                        {
-                                          confirmButtonText: "确定",
-                                          cancelButtonText: "返回",
-                                          closeOnClickModal: false,
-                                          closeOnPressEscape: false,
-                                          distinguishCancelAndClose: false,
-                                          showClose: false,
-                                        }
-                                      )
-                                        .then((_) => {
-                                          this.showStampDetailModail = true;
-                                          this.getInfoStamp();
-                                        })
-                                        .catch((_) => {
-                                          this.$router.back(-1);
-                                        });
-                                    } else {
-                                      self.needProfileModal = true;
-                                      this.$confirm(
-                                        `资料盖章审核不通过,请前往重新填写`,
-                                        "提示",
-                                        {
-                                          confirmButtonText: "确定",
-                                          cancelButtonText: "返回",
-                                          closeOnClickModal: false,
-                                          closeOnPressEscape: false,
-                                          distinguishCancelAndClose: false,
-                                          showClose: false,
+                              } else if (
+                                result.data.status === 1 &&
+                                JSON.parse(res.rows[0].keyValue2)[0]
+                              ) {
+                                self.$request
+                                  .getbaseprofileStampgetInfo({
+                                    goodsId: self.goodsId,
+                                    orderGoodsId: self.orderGoodsId,
+                                  })
+                                  .then((k) => {
+                                    if (k.code === 200) {
+                                      if (
+                                        !k.data ||
+                                        (k.data.status === 3 &&
+                                          k.data.changeStatus === 1)
+                                      ) {
+                                        if (!k.data) {
+                                          this.$confirm(
+                                            `请前往填写盖章资料`,
+                                            "提示",
+                                            {
+                                              confirmButtonText: "确定",
+                                              cancelButtonText: "返回",
+                                              closeOnClickModal: false,
+                                              closeOnPressEscape: false,
+                                              distinguishCancelAndClose: false,
+                                              showClose: false,
+                                            }
+                                          )
+                                            .then((_) => {
+                                              this.showStampDetailModail = true;
+                                              this.getInfoStamp();
+                                            })
+                                            .catch((_) => {
+                                              this.$router.back(-1);
+                                            });
+                                        } else {
+                                          self.needProfileModal = true;
+                                          this.$confirm(
+                                            `资料盖章审核不通过,请前往重新填写`,
+                                            "提示",
+                                            {
+                                              confirmButtonText: "确定",
+                                              cancelButtonText: "返回",
+                                              closeOnClickModal: false,
+                                              closeOnPressEscape: false,
+                                              distinguishCancelAndClose: false,
+                                              showClose: false,
+                                            }
+                                          )
+                                            .then((_) => {
+                                              this.showStampDetailModail = true;
+                                              this.getInfoStamp();
+                                            })
+                                            .catch((_) => {
+                                              this.$router.back(-1);
+                                            });
                                         }
-                                      )
-                                        .then((_) => {
-                                          this.showStampDetailModail = true;
-                                          this.getInfoStamp();
-                                        })
-                                        .catch((_) => {
-                                          this.$router.back(-1);
-                                        });
+                                      }
                                     }
-                                  }
-                                }
-                              });
-                          }
-                        }
-                      });
-                  }
-                }
-              });
+                                  });
+                              } else {
+                                resolve();
+                              }
+                            }
+                          });
+                      } else {
+                        resolve();
+                      }
+                    }
+                  });
+              } else {
+                resolve();
+              }
             }
-          }
-        });
-      if (this.gradeId > 0) {
-        //提交完资料返回判断是否已开班
+          });
+        if (this.gradeId > 0) {
+          //提交完资料返回判断是否已开班
 
-        this.getGradeInfo();
-      }
+          this.getGradeInfo();
+        }
+      });
     },
 
     getInfoStamp() {
@@ -4356,12 +4385,15 @@ export default {
     loadPlayer() {
       var self = this;
       const polyvPlayer = window.polyvPlayer;
+      console.log(polyvPlayer);
       self.$request.obtainpolyvvideosign(self.vid).then((res) => {
+        console.log(res, "res2");
         self.player = polyvPlayer({
           wrap: "#player",
           width: 810,
           height: 455,
           speed: 2,
+          ban_history_time: "on",
           vid: self.vid,
           teaser_show: 1,
           tail_show: 1,
@@ -5087,6 +5119,7 @@ export default {
           polyvPlayerContext.changeVid(note.recordingUrl);
         } else {
           this.vid = note.recordingUrl;
+          console.log(note.recordingUrl);
           this.moduleId = note.moduleId;
           this.chapterId = note.chapterId;
           this.playSectionId = note.sectionId;
@@ -5273,7 +5306,7 @@ export default {
               }
             });
           });
-          console.log(copydata2)
+          console.log(copydata2);
           copydata2.forEach((it) => {
             for (let i = 0; i < data1.length; i++) {
               const STATUS = data1[i].newArraysAnswerList.some((items) => {

+ 7 - 0
src/pages/goods-detail/course-detail.vue

@@ -837,6 +837,13 @@ export default {
             next();
           },
         });
+
+        self.player.on("s2j_onPlayOver", () => {
+          this.$message({
+            type: "success",
+            message: "试看结束,购买课程可学习全部",
+          });
+        });
       });
     },
     /**

+ 0 - 1
src/pages/login/index.vue

@@ -343,7 +343,6 @@
       class="agreement"
       :visible.sync="showAgreementModal"
       width="800px"
-      :before-close="handleClose"
     >
       <div class="agreement__content">
         <div class="content">

+ 30 - 2
src/pages/payment-success/index.vue

@@ -13,11 +13,29 @@
               <div class="goods_item">订单编号:{{ orderSn }}</div>
               <div class="goods_item">订单金额:{{ total | toFixed }} 元</div>
 
-              <div class="links">
+              <div class="links" v-if="isBK">
+                <a @click="go('/person-center/my-course')">返回我的网课</a>
+                <el-button
+                  type="primary"
+                  size="small"
+                  round
+                  @click="
+                    go('/person-center/my-classhour/appointment', {
+                      goodsId: goodsId,
+                      gradeId: gradeId,
+                      orderGoodsId: orderGoodsId,
+                    })
+                  "
+                  >继续本次考试预约</el-button
+                >
+              </div>
+              <div class="links" v-else>
                 <a @click="go('/person-center/my-order', { state: '2' })"
                   >查看订单详情</a
                 >
-                <a @click="go('/')">继续逛逛</a>
+                <el-button type="primary" size="small" round @click="go('/')"
+                  >继续逛逛</el-button
+                >
               </div>
             </div>
           </div>
@@ -75,13 +93,23 @@ export default {
   },
   data() {
     return {
+      isBK: "",
       orderSn: "",
       total: 0,
+      goodsId: 0,
+      gradeId: 0,
+      orderGoodsId: 0,
     };
   },
   mounted() {
     this.orderSn = this.$route.params.orderSn;
     this.total = this.$route.params.total;
+    this.isBK = this.$route.params.isBK;
+    this.goodsId = this.$route.params.goodsId;
+    this.gradeId = this.$route.params.gradeId;
+    this.orderGoodsId = this.$route.params.orderGoodsId;
+
+    console.log(this.$route.params, "this.$route.params");
   },
   methods: {
     go(path, query) {

+ 25 - 8
src/pages/payment/index.vue

@@ -111,6 +111,7 @@ export default {
       checkOrderTimer: null,
       loading: null,
       countTimer: null,
+      isBK: "",
     };
   },
   computed: {
@@ -122,6 +123,7 @@ export default {
   },
   mounted() {
     console.log(this.checkGoodsList);
+    this.isBK = this.$route.query.isBK;
     if (this.checkGoodsList.length <= 0 && !this.$route.params.orderSn) {
       this.$router.back(-1);
       return;
@@ -288,14 +290,29 @@ export default {
           if (res.data) {
             this.setCheckGoodsList([]);
             clearInterval(this.checkOrderTimer);
-            this.$router.replace({
-              path: "/payment-success",
-              name: "支付成功",
-              params: {
-                orderSn: this.orderSn,
-                total: this.total,
-              },
-            });
+            if (this.isBK) {
+              this.$router.replace({
+                path: "/payment-success",
+                name: "支付成功",
+                params: {
+                  orderSn: this.orderSn,
+                  total: this.total,
+                  isBK: this.isBK,
+                  goodsId: this.checkGoodsList[0].learnGoodsId,
+                  gradeId: this.checkGoodsList[0].learnGradeId,
+                  orderGoodsId: this.checkGoodsList[0].learnOrderGoodsId,
+                },
+              });
+            } else {
+              this.$router.replace({
+                path: "/payment-success",
+                name: "支付成功",
+                params: {
+                  orderSn: this.orderSn,
+                  total: this.total,
+                },
+              });
+            }
           }
         })
         .catch((err) => {});

+ 6 - 0
src/pages/person-center/index.vue

@@ -44,6 +44,12 @@
                 <router-link to="/person-center/bank-record">
                   <div class="item">做题记录</div>
                 </router-link>
+                <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>
               </div>
             </div>
             <div class="nav__section">

+ 5 - 2
src/pages/person-center/my-classhour/appointment/index.vue

@@ -20,9 +20,9 @@
         <div class="invoice-content__header">
           <el-descriptions :title="listData.applyName" :column="1">
             <el-descriptions-item label="报名时间"
-              >{{ $tools.timestampToTime(listData.applyStartTime) }} ~
+              >{{ $tools.timestampToTime(listData.applyStartTime) || "" }} ~
               {{
-                $tools.timestampToTime(listData.applyEndTime)
+                $tools.timestampToTime(listData.applyEndTime) || ""
               }}</el-descriptions-item
             >
             <el-descriptions-item label="温馨提示">{{
@@ -158,6 +158,9 @@ export default {
                         .commonGoodsDetail(this.goodsIdBK)
                         .then((res) => {
                           let detail = res.data;
+                          detail.learnOrderGoodsId = this.orderGoodsId;
+                          detail.learnGradeId = this.gradeId;
+                          detail.learnGoodsId = this.goodsId;
                           let selectGoodsList = JSON.parse(
                             JSON.stringify([detail])
                           );

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

@@ -135,7 +135,7 @@
                 <div
                   class="item"
                   v-for="(item, index) in listData.informVo.informCourseVo"
-                  :key="index"
+                  :key="'informVo' + index"
                 >
                   <div class="item__title">{{ item.goodsName }}</div>
                   <div class="item__desc">
@@ -151,7 +151,7 @@
                 <div
                   class="item"
                   v-for="(item, index) in listData.informVo.informExamVo"
-                  :key="index"
+                  :key="'informExamVo' + index"
                 >
                   <div class="item__title">{{ item.goodsName }}</div>
                   <div class="item__desc">
@@ -780,19 +780,6 @@ export default {
         },
       });
       console.log(item);
-      uni.navigateTo({
-        url:
-          "/pages2/bank/questionBank?current=" +
-          (item.topicNum - 1) +
-          "&id=" +
-          item.examId +
-          "&goodsid=" +
-          item.goodsId +
-          "&chapterId=" +
-          item.moduleId +
-          "&moduleId=" +
-          item.moduleId,
-      });
     },
   },
 };

+ 85 - 1
src/router/index.js

@@ -1,8 +1,15 @@
 import Vue from 'vue'
 import Router from 'vue-router'
 import store from '../store/index'
+import request from '@/request'
+import { Notification, MessageBox, Message } from 'element-ui'
 Vue.use(Router)
 
+let bankAdmin = ['/person-center/bank-record','/person-center/my-bank/index','/person-center/my-collect','/person-center/my-wrong','/person-center/my-bank/bank-detail/','/person-center/my-bank/bank-statistics/','/person-center/my-bank/bank-explain-detail/','/bank-exam-continue/','/bank-exam/','/subject/collect-bank/','/bank-exam-explain/','/bank-report/'];
+let canToBank = null;
+let courseAdmin = []
+let canToCourse = null;
+
 const router =  new Router({
   mode:'history',
   scrollBehavior: () => ({ y: 0 }),
@@ -199,6 +206,18 @@ const router =  new Router({
           name: '做题记录'
         },
         
+        {
+          path: 'my-collect',
+          component: resolve => require(['@/pages/person-center/my-collect/index'],resolve),
+          name: '收藏集'
+        },
+        
+        {
+          path: 'my-wrong',
+          component: resolve => require(['@/pages/person-center/my-wrong/index'],resolve),
+          name: '错题集'
+        },
+        
         {
           path: 'record-list/:goodsId',
           component: resolve => require(['@/pages/person-center/bank-record/record-list/index'],resolve),
@@ -288,7 +307,8 @@ Router.prototype.push = function push(location) {
 }
 
 router.beforeEach((to,from,next) => {
-
+  console.log(to,'to')
+  console.log(from,'from')
   if(to.path === '/login'){
 
     next();
@@ -304,6 +324,70 @@ router.beforeEach((to,from,next) => {
         //获取用户信息
         store.dispatch('getUserInfo')
       }
+
+      //题库页面要检测是否有人锁定
+      let isLock = bankAdmin.some(item => {
+        return to.path.indexOf(item) != -1
+      })
+
+      console.log(isLock,'isLock')
+      if(isLock) {
+        console.log(canToBank,'canToBank')
+        
+        //没有执行定时器,开启锁定
+        if(!canToBank) {
+          console.log(123)
+          request
+            .lockLockStatus({
+              action: "bank",
+            })
+            .then((res) => {
+              console.log(res,'res')
+              //有其他端在操作,不能学习
+              Message({
+                type: "warning",
+                message: res.msg,
+              });
+              
+              if(from.path=='/') {
+                next('/')
+              }
+
+            }).catch(err => {
+              // console.log(err,'err')
+              // //可以学习,开启锁定
+              //   canToBank = 1;
+              // request.lockLockAction({
+              //   action:'bank'
+              // }).then(res => {
+              // })
+              // canToBank = setInterval(() => {
+              //   request.lockLockAction({
+              //     action:'bank'
+              //   }).then(res => {
+                  
+              //   })
+              // }, 10000);
+              next()
+            })
+
+            return;
+        } else {
+          //正在执行定时器,可以直接进入
+          next()
+        }
+        
+        return;
+      } else {
+        //非题库页面删除锁定
+        clearInterval(canToBank)
+        canToBank = null;
+        request.lockDelLock({
+          action:'bank'
+        }).then(res => {
+          
+        })
+      }
       
       next()
     } else {