| | |
| | | }, |
| | | }, |
| | | created() { |
| | | if (window.name == "") { |
| | | // console.log("首次被加载"); |
| | | window.name = "first"; // 在首次进入页面时我们可以给window.name设置一个固定值 |
| | | this.first = true; |
| | | } else if (window.name == "first") { |
| | | // console.log("页面被刷新"); |
| | | var useInfo = this.$store.state.exam.examUserData; |
| | | |
| | | if (useInfo.isExam == 3) { |
| | | window.name = "first"; |
| | | this.first = false; |
| | | } else { |
| | | if (window.name == "") { |
| | | // console.log("首次被加载"); |
| | | window.name = "first"; // 在首次进入页面时我们可以给window.name设置一个固定值 |
| | | this.first = true; |
| | | } else if (window.name == "first") { |
| | | // console.log("页面被刷新"); |
| | | this.first = false; |
| | | } |
| | | } |
| | | |
| | | const examInfo = this.$route.params.id; |
| | |
| | | // this.exam.totalScore = this.$route.query.totalScore |
| | | // this.exam.status = this.$route.query.examStatus |
| | | // this.exam.remark = this.$route.query.remark |
| | | |
| | | this.validateExamTime(); |
| | | } |
| | | }, |
| | | methods: { |
| | | countDownS_cb: function () { |
| | | // console.log(12456); |
| | | messageSuccess(this, "考试开始"); |
| | | this.startTime = this.getCurrentTimes(); |
| | | }, |
| | | countDownE_cb: function () { |
| | | messageWarn(this, "考试结束"); |
| | | // this.disableSubmit = true; |
| | | // this.submitExam("over"); |
| | | }, |
| | | bottonControl(time) { |
| | | //倒计时循环 |
| | |
| | | validateExamTime() { |
| | | getCurrentTime() |
| | | .then((response) => { |
| | | // console.log(response, 7777); |
| | | const currentTime = moment(response.data.data); |
| | | if (currentTime.isAfter(this.exam.endTime)) { |
| | | messageWarn(this, "考试已结束"); |
| | |
| | | } |
| | | //适应时间 |
| | | const datyTime = objs.examScore.examTime; |
| | | // console.log(objs, "datyTimedatyTimedatyTime"); |
| | | var duibiTime = function (newTime, oldTime) { |
| | | var newYear = newTime.split(" ")[0], |
| | | newDat = newTime.split(" ")[1], |
| | |
| | | // return false; |
| | | }; |
| | | var listTime = duibiTime(currentTime._i, datyTime); |
| | | // console.log(listTime, "listTimelistTimelistTime"); |
| | | const current = currentTime.valueOf(); |
| | | this.currentTime = current; |
| | | this.startTime = current; |
| | |
| | | messageFail(this, "开始考试失败!4646549888*8*"); |
| | | }); |
| | | }, |
| | | countDownE_cb: function () { |
| | | messageWarn(this, "考试结束"); |
| | | // this.disableSubmit = true; |
| | | this.submitExam("over"); |
| | | }, |
| | | |
| | | last() { |
| | | for (let i = 0; i < this.subjectIds.length; i++) { |
| | | if (this.subjectIds[i].everyID == this.query.subjectId) { |