Michael Wang 6 лет назад
Родитель
Сommit
bc088935cf
1 измененных файлов с 12 добавлено и 3 удалено
  1. 12 3
      src/features/OnlineExam/OnlineExamHome.vue

+ 12 - 3
src/features/OnlineExam/OnlineExamHome.vue

@@ -25,13 +25,13 @@ export default {
   data() {
     return {
       previousUrl: "",
+      autoCloseModal: 10,
       courses: []
     };
   },
   beforeRouteEnter(to, from, next) {
     next(vm => {
       vm.previousUrl = from.path;
-      console.log("from.path:", from.path);
     });
   },
   beforeMount() {
@@ -46,16 +46,22 @@ export default {
                   欢迎使用考试系统,祝顺利完成考试!
                 </div>
                 <div style="font-weight:bold; line-height: 25px;">
-                  姓名:{this.$store.state.user.name} -{" "}
+                  姓名:{this.$store.state.user.name} -
                   {this.$store.state.user.studentCode}
                 </div>
                 <div style="font-weight:bold; line-height: 25px;">
-                  专业:{this.$store.state.user.specialty}{" "}
+                  专业:{this.$store.state.user.specialty}
                 </div>
               </div>
             </div>
           )
         });
+        this.interval = setInterval(() => {
+          this.autoCloseModal--;
+          if (this.autoCloseModal <= 0) {
+            this.$Modal.remove();
+          }
+        }, 1000);
       }
     });
   },
@@ -67,6 +73,9 @@ export default {
 
     this.courses = res.data;
   },
+  beforeDestroy() {
+    clearInterval(this.interval);
+  },
   components: {
     "ecs-online-list": EcsOnlineList,
     PhoneVerifyForDD