| | |
| | | // this.startTime = this.getCurrentTimes(); |
| | | }, |
| | | countDownE_c: function() { |
| | | messageWarn(this, "考试结束123"); |
| | | messageWarn(this, "考试结束"); |
| | | this.overExam(); |
| | | // this.disableSubmit = true; |
| | | // this.submitExam("over"); |
| | |
| | | var that = this; |
| | | if (that.option.data[0].isExam == 3) { |
| | | that.resData["examScoreId"] = that.scoreId; |
| | | console.log(that.resData); |
| | | // console.log(that.resData); |
| | | that.$router.push({ |
| | | path: `/startexam/${that.resData.scoreId}`, |
| | | query: that.resData |
| | |
| | | // // type: "warning", |
| | | // }); |
| | | // return; |
| | | // debugger; |
| | | updateApplyStatus(data).then(res => { |
| | | that.resData["examScoreId"] = res.data.id; |
| | | this.$store.commit("SetScoreId", res.data.id); |
| | |
| | | }); |
| | | }, |
| | | getUserInfoBYExam() { |
| | | console.log(this.option,456123) |
| | | var that = this; |
| | | let setData = ({ color, subtext, isExam }) => { |
| | | that.option.data = [ |
| | |
| | | that.$store.commit("SetexamUserData", that.option.data[0]); |
| | | }; |
| | | var duibiTime = function(newTime, oldTime) { |
| | | var newYear = newTime.split(" ")[0], |
| | | newDat = newTime.split(" ")[1], |
| | | oldYear = oldTime.split(" ")[0], |
| | | oldDat = oldTime.split(" ")[1]; |
| | | if (newYear !== oldYear) { |
| | | return false; |
| | | } else { |
| | | let newD = { |
| | | s: +newDat.split(":")[0], |
| | | f: +newDat.split(":")[1], |
| | | m: +newDat.split(":")[2] |
| | | }; |
| | | let oldD = { |
| | | s: +oldDat.split(":")[0], |
| | | f: +oldDat.split(":")[1], |
| | | m: +oldDat.split(":")[2] |
| | | }; |
| | | if (newD.s - oldD.s > 1) { |
| | | return false; |
| | | } else if (newD.s - oldD.s == 1) { |
| | | if (newD.f < oldD.f) { |
| | | return oldD.f - newD.f; |
| | | } else { |
| | | return false; |
| | | } |
| | | } else if (newD.s == oldD.s) { |
| | | return 60 - (newD.f - oldD.f); |
| | | } |
| | | // return [newD, oldD]; |
| | | return false; |
| | | } |
| | | var newtimes = new Date(newTime.replace(/-/g,'/')).getTime(); |
| | | var oldtimes = new Date(oldTime.replace(/-/g,'/')).getTime(); |
| | | |
| | | var dif = Math.ceil((newtimes - oldtimes)/(1000*60)) |
| | | return 90-dif |
| | | // var newYear = newTime.split(" ")[0], |
| | | // newDat = newTime.split(" ")[1], |
| | | // oldYear = oldTime.split(" ")[0], |
| | | // oldDat = oldTime.split(" ")[1]; |
| | | // debugger; |
| | | // if (newYear !== oldYear) { |
| | | // return false; |
| | | // } else { |
| | | // let newD = { |
| | | // s: +newDat.split(":")[0], |
| | | // f: +newDat.split(":")[1], |
| | | // m: +newDat.split(":")[2] |
| | | // }; |
| | | // let oldD = { |
| | | // s: +oldDat.split(":")[0], |
| | | // f: +oldDat.split(":")[1], |
| | | // m: +oldDat.split(":")[2] |
| | | // }; |
| | | // if (newD.s - oldD.s > 1) { |
| | | // return false; |
| | | // } else if (newD.s - oldD.s == 1) { |
| | | // if (newD.f < oldD.f) { |
| | | // // return oldD.f - newD.f; |
| | | // return 90 - (newD.f - oldD.f); |
| | | // } else { |
| | | // return false; |
| | | // } |
| | | // } else if (newD.s == oldD.s) { |
| | | // return 90 - (newD.f - oldD.f); |
| | | // } |
| | | // // return [newD, oldD]; |
| | | // return false; |
| | | // } |
| | | // return false; |
| | | }; |
| | | |
| | |
| | | that.resData = res.data.data[0]; |
| | | |
| | | var data = res.data.data[0]; |
| | | // console.log(data,333); |
| | | |
| | | //当前时间 |
| | | var nowD, |
| | | startD = new Date(data.startTime), |
| | |
| | | } |
| | | // console.log(data, 123456); |
| | | if (data.isExam == 3) { |
| | | that.$store.commit("SetScoreId", data.scoreId); |
| | | this.scoreId = data.scoreId; |
| | | setData({ color: "success", subtext: "继续考试", isExam: 3 }); |
| | | const currentTimeSTART = moment(data.examStartTime); |