From 8768efaf973cb6d59a15e8bc60b6af9e68a232c8 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 13 Dec 2021 11:49:16 +0800
Subject: [PATCH] +加入退出后继续考试

---
 src/views/startexam/index.vue |   35 ++++++++++++++++++++++-------------
 1 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/src/views/startexam/index.vue b/src/views/startexam/index.vue
index d4e2dbf..3ed2ac3 100644
--- a/src/views/startexam/index.vue
+++ b/src/views/startexam/index.vue
@@ -254,13 +254,20 @@
     },
   },
   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;
@@ -282,14 +289,19 @@
       // 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) {
       //倒计时循环
@@ -331,6 +343,7 @@
     validateExamTime() {
       getCurrentTime()
         .then((response) => {
+          // console.log(response, 7777);
           const currentTime = moment(response.data.data);
           if (currentTime.isAfter(this.exam.endTime)) {
             messageWarn(this, "考试已结束");
@@ -442,6 +455,7 @@
             }
             //适应时间
             const datyTime = objs.examScore.examTime;
+            // console.log(objs, "datyTimedatyTimedatyTime");
             var duibiTime = function (newTime, oldTime) {
               var newYear = newTime.split(" ")[0],
                 newDat = newTime.split(" ")[1],
@@ -476,7 +490,6 @@
               // return false;
             };
             var listTime = duibiTime(currentTime._i, datyTime);
-            // console.log(listTime, "listTimelistTimelistTime");
             const current = currentTime.valueOf();
             this.currentTime = current;
             this.startTime = current;
@@ -546,11 +559,7 @@
           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) {

--
Gitblit v1.9.3