Browse Source

添加考生承诺书

Michael Wang 3 years ago
parent
commit
3dae50b7cf
1 changed files with 22 additions and 1 deletions
  1. 22 1
      src/features/OnlineExam/OnlineExamList.vue

+ 22 - 1
src/features/OnlineExam/OnlineExamList.vue

@@ -401,6 +401,7 @@ export default {
       }
 
       this.getNow();
+      this.spinShow = false;
       if (this.disableTheCourse(course)) {
         this.logger({ page: "在线考试列表页面", detail: "未到考试开放时间!" });
         this.$Message.error({
@@ -408,9 +409,29 @@ export default {
           duration: 15,
           closable: true,
         });
-        this.spinShow = false;
         return;
       }
+      if (course.showUndertaking) {
+        this.logger({ page: "在线考试列表页面", detail: "考生承诺书" });
+        const res = await new Promise((resolve) => {
+          this.$Modal.confirm({
+            title: "考生承诺书",
+            content: course.undertaking,
+            onOk: () => {
+              this.logger({ action: "考生承诺书", detail: "承诺同意" });
+              resolve(true);
+            },
+
+            onCancel: () => {
+              this.logger({ action: "考生承诺书", detail: "拒绝承诺" });
+              resolve(false);
+            },
+          });
+        });
+        if (!res) {
+          return;
+        }
+      }
 
       this.spinShow = true;
       this.processingMessage = "正在检测IP合法性...";