Explorar el Código

调用退出网页的方法

zhangyujun hace 3 años
padre
commit
cdcbbf2a30

BIN
jkt-h5-mockExam.zip


+ 4 - 0
src/components/mask/beforeSubmitMask.vue

@@ -76,6 +76,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+button {
+  border-radius: 0;
+  border: none;
+}
 .mask {
   position: fixed;
   top: 0;

+ 17 - 14
src/components/mask/submitMask.vue

@@ -18,12 +18,7 @@
           <button
             @click="
               () => {
-                router.push({
-                  name: 'examBegin',
-                  query: {
-                    ...router.currentRoute.value.query,
-                  },
-                });
+                backView();
               }
             "
           >
@@ -39,22 +34,26 @@
 <script>
 import { defineProps, reactive, toRefs, ref } from 'vue';
 import router from '@/router/';
+import Phone from '@/utils/phone';
 export default {
   setup(props, { emit }) {
     const state = reactive({
       count: 0,
     });
+    const phone = new Phone();
+    const backView = phone.backView.bind(phone);
     const time = ref(8);
     const timer = window.setInterval((e) => {
       time.value = time.value - 1;
       if (time.value === 0) {
         window.clearInterval(timer);
-        router.push({
-          name: 'examBegin',
-          query: {
-            ...router.currentRoute.value.query,
-          },
-        });
+        backView()
+        // router.push({
+        //   name: 'examBegin',
+        //   query: {
+        //     ...router.currentRoute.value.query,
+        //   },
+        // });
       }
     }, 1000);
     const sendPaper = () => {
@@ -72,6 +71,7 @@ export default {
       time,
       timer,
       router,
+      backView,
     };
   },
   beforeDestroy() {
@@ -82,13 +82,16 @@ export default {
       type: Number,
       required: true,
       default: 0,
-    }
- 
+    },
   },
 };
 </script>
 
 <style lang="scss" scoped>
+button {
+   border-radius: 0;
+  border: none;
+}
 .mask {
   position: fixed;
   top: 0;

+ 13 - 12
src/views/exam/begin.vue

@@ -9,7 +9,7 @@
           <div class="info">考试须知:</div>
           <div>1.遵守考场纪律,服从监考人员指挥。</div>
           <div>2.进入考场、手机关机。禁止抽烟,禁止吃零食。</div>
-          <div>3.未经工作人员允许,考生崇止抛意出入考场。</div>
+          <div>3.未经工作人员允许,考生禁止随意出入考场。</div>
           <div>4.考场内禁止大声题哗,禁止随意走动。</div>
           <div>5.考试中认真答题,不准交头接耳。</div>
           <div>6.考试中不准冒名顶替,不准弄虚作假。</div>
@@ -35,8 +35,8 @@
               开始考试
             </div>
           </div>
-          <div class="mt15" style="color: #32312D">
-          操作提示:每题考试答案确认后,点击【下一题】,电脑立即判定所选答案,如选择错误,系统将提示正确答案,提示后不允许修改答案。
+          <div class="mt15" style="color: #32312d">
+            操作提示:每题考试答案确认后,点击【下一题】,电脑立即判定所选答案,如选择错误,系统将提示正确答案,提示后不允许修改答案。
           </div>
         </div>
       </div>
@@ -49,8 +49,8 @@ import { defineComponent } from 'vue';
 import { useRouter, useRoute } from 'vue-router';
 // import Api from '@/api/api';
 import Phone from '@/utils/phone';
-import subject4Img from "@/assets/img/subject4@2x.png"
-import subject1Img from "@/assets/img/subject1@2x.png"
+import subject4Img from '@/assets/img/subject4@2x.png';
+import subject1Img from '@/assets/img/subject1@2x.png';
 export default defineComponent({
   setup() {
     // window.localStorage.setItem(
@@ -58,12 +58,11 @@ export default defineComponent({
     //   'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjllNTU3NDk1LWQyOGQtNDMyNy1hYTBjLTdjOTk2OTk5NTk1YiJ9.GvGgys5erlFYJMLEhk2S1e7W_9CKDJohfXfW8fZpitkpZ8RWni5u9VvTGjl8dhD1916s-4MTM_7TsNaTNwsuPg',
     // );
     //旋转你的屏幕
-    const phone = new Phone();
-    phone.displayRow();
+    // const phone = new Phone();
     const push = useRouter().push;
     const route = useRoute();
     const query = route.query;
-    const subjectImg = query.subject=="1"?subject1Img:subject4Img
+    const subjectImg = query.subject == '1' ? subject1Img : subject4Img;
     console.log(query);
 
     if (query.token) {
@@ -77,14 +76,14 @@ export default defineComponent({
     return {
       query,
       push,
-      subjectImg
+      subjectImg,
     };
   },
 });
 </script>
 
 <style lang="scss" scoped>
-.pl138{
+.pl138 {
   padding-left: 138px;
 }
 .pl24 {
@@ -93,7 +92,7 @@ export default defineComponent({
 .exam-button {
   width: 93px;
   height: 28px;
-  background: #02A9ED;
+  background: #02a9ed;
   opacity: 1;
   line-height: 28px;
   color: #fff;
@@ -107,6 +106,7 @@ export default defineComponent({
   display: flex;
   flex-direction: column;
   justify-content: center;
+  background: #f4f3ef;
 }
 .header {
   width: 100%;
@@ -152,13 +152,14 @@ export default defineComponent({
   margin-top: 4px;
   display: flex;
   flex-wrap: wrap;
+  border: 1px solid #eae9e5;
   .box1 {
     width: 50%;
     height: 100%;
     padding-top: 18px;
     padding-left: 17px;
     color: #3d3c38;
-    border: 1px solid #eae9e5;
+    border-right: 1px solid #eae9e5;
     .info {
       font-size: 14px;
       margin-bottom: 7px;