Michael Wang hace 5 años
padre
commit
addc6fc732

+ 2 - 1
src/components/MainLayout/MainLayout.vue

@@ -64,8 +64,9 @@
         class="qm-primary-text"
         style="display: inline-block; margin-right: 20px; text-align: center;"
         @click="() => logout('?LogoutReason=正常退出')"
-        >退出登录</a
       >
+        {{ isEpcc ? "返回" : "退出登录" }}
+      </a>
     </header>
     <transition name="fade" appear>
       <main :key="$route.path" class="content">

+ 25 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -205,6 +205,31 @@ export default {
     // examQuestionList(val, oldVal) {
     //   // console.log(val, oldVal);
     // }
+    remainTime(val) {
+      if (val === 5 * 60 * 1000) {
+        this.reaminModalCreated = true;
+        this.$Modal.info({
+          render: () => (
+            <div>
+              <h3>温馨提醒</h3>
+              <div style="margin-top: 20px; margin-left: 20px; flex: 1">
+                <div style="margin-bottom: 1.5em">
+                  剩余考试时间为
+                  <span style="font-weight: bold; color: red;"> 5 </span>分钟!
+                </div>
+              </div>
+            </div>
+          ),
+          onOk: () => {
+            this.reaminModalClosed = true;
+          },
+        });
+      } else if (val === 5 * 60 * 1000 - 10 * 1000) {
+        if (this.reaminModalCreated && !this.reaminModalClosed) {
+          this.$Modal.remove();
+        }
+      }
+    },
   },
   async created() {
     this.timeoutTimeout = setTimeout(() => (this.timeouted = true), 30 * 1000);

+ 12 - 0
src/features/OnlineExam/OnlineExamList.vue

@@ -29,6 +29,7 @@
               <i-button
                 class="qm-primary-button qm-primary-button-padding-fix"
                 :disabled="disableTheCourse(course)"
+                :title="disableTheCourse(course) ? disableReason(course) : ''"
                 @click="
                   () => {
                     if (isEpcc) {
@@ -155,6 +156,17 @@ export default {
         moment(course.endTime)
       );
     },
+    disableReason(course) {
+      if (!this.courseInBetween(course)) {
+        return "当前时间不在考试开放时间范围";
+      } else if (course.allowExamCount < 1) {
+        return "无剩余考试次数";
+      } else if (this.isEpcc && this.countdown > 0) {
+        return "请稍后点击";
+      } else {
+        return "";
+      }
+    },
     disableTheCourse(course) {
       return (
         !this.courseInBetween(course) ||

+ 31 - 3
src/features/OnlineExam/OnlineExamOverview.vue

@@ -12,9 +12,9 @@
         style="display: inline-block; width: 100%;"
         @click="goToPaper"
       >
-        {{ isForceRead ? "强制阅读" : "开始答题" }} (倒计时:{{
-          remainTimeFormatted
-        }}
+        {{ isForceRead ? "强制阅读" : "开始答题" }} (倒计时:
+        <span class="animated infinite pulse"> {{ remainTimeFormatted }} </span
+        >
       </i-button>
     </div>
 
@@ -164,6 +164,34 @@ export default {
   text-align: right;
   float: right;
 }
+
+.animated {
+  animation-duration: 1s;
+  animation-fill-mode: both;
+  display: inline-block;
+}
+
+.animated.infinite {
+  animation-iteration-count: infinite;
+}
+
+@keyframes pulse {
+  from {
+    transform: scale3d(1, 1, 1);
+  }
+
+  50% {
+    transform: scale3d(1.05, 1.05, 1.05);
+  }
+
+  to {
+    transform: scale3d(1, 1, 1);
+  }
+}
+
+.pulse {
+  animation-name: pulse;
+}
 </style>
 
 <style>