|
@@ -9,10 +9,8 @@
|
|
|
</div>
|
|
|
<!-- data-ui-sref="exam.start({examRecordId: startInfo.id,stuExamInfoId:stateParams.stuExamInfoId,examMins:startInfo.paperMins,examId:examInfo.id,faceVerifyMinute:startInfo.faceVerifyMinute})" -->
|
|
|
|
|
|
- <a class="qm-primary-button" v-show="remainTime > 110" disabled style="display: inline-block; width: 100%;">
|
|
|
- 强制阅读(倒计时:{{remainTimeFormatted}})</a>
|
|
|
- <a class="qm-primary-button" v-show="remainTime < 110" style="display: inline-block; width: 100%;">
|
|
|
- 开始答题(倒计时:{{remainTimeFormatted}})</a>
|
|
|
+ <Button class="qm-primary-button" :disabled="remainTime > 110" @click="goToPaper" style="display: inline-block; width: 100%;">
|
|
|
+ {{ remainTime > 110 ? '强制阅读' : '开始答题'}}(倒计时:{{remainTimeFormatted}})</Button>
|
|
|
</div>
|
|
|
|
|
|
<div class="exam-detail">
|
|
@@ -54,10 +52,9 @@ export default {
|
|
|
},
|
|
|
async mounted() {
|
|
|
this.intervalId = setInterval(() => {
|
|
|
- this.remainTime = --this.remainTime;
|
|
|
- if (remainTime === 0) {
|
|
|
- this.$router.push("/online-exam/exam/:id/");
|
|
|
- window.clearInterval(this.intervalId);
|
|
|
+ this.remainTime = this.remainTime - 1; // 为了界面更新,不能写 this.remainTime--
|
|
|
+ if (this.remainTime === 0) {
|
|
|
+ this.goToPaper();
|
|
|
}
|
|
|
}, 1000);
|
|
|
const exam = await this.$http.get(
|
|
@@ -153,7 +150,17 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
remainTimeFormatted: function() {
|
|
|
- return moment.utc(this.remainTime).format("hh:mm:ss");
|
|
|
+ return moment.utc(this.remainTime * 1000).format("HH:mm:ss");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goToPaper: function() {
|
|
|
+ this.$router.push(
|
|
|
+ `/online-exam/exam/${this.$route.params.examId}/?examRecordId=${
|
|
|
+ this.examRecordId
|
|
|
+ }`
|
|
|
+ );
|
|
|
+ window.clearInterval(this.intervalId);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -193,5 +200,3 @@ export default {
|
|
|
float: right;
|
|
|
}
|
|
|
</style>
|
|
|
-
|
|
|
-
|