|
@@ -10,9 +10,9 @@
|
|
|
<!-- 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%;">
|
|
|
- 强制阅读(倒计时:{{remainTime}})</a>
|
|
|
+ 强制阅读(倒计时:{{remainTimeFormatted}})</a>
|
|
|
<a class="qm-primary-button" v-show="remainTime < 110" style="display: inline-block; width: 100%;">
|
|
|
- 开始答题(倒计时:{{remainTime}})</a>
|
|
|
+ 开始答题(倒计时:{{remainTimeFormatted}})</a>
|
|
|
</div>
|
|
|
|
|
|
<div class="exam-detail">
|
|
@@ -41,6 +41,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import moment from "moment";
|
|
|
+
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -53,6 +55,10 @@ 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);
|
|
|
+ }
|
|
|
}, 1000);
|
|
|
const exam = await this.$http.get(
|
|
|
"/api/ecs_exam_work/exam/" + this.$route.params.examId
|
|
@@ -144,6 +150,11 @@ export default {
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearInterval(this.intervalId);
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ remainTimeFormatted: function() {
|
|
|
+ return moment.utc(this.remainTime).format("hh:mm:ss");
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|