zhangyujun 3 жил өмнө
parent
commit
977fcafcea

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
   <meta charset="UTF-8">
   <link rel="icon" href="/favicon.ico" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <title>真模拟考试</title>
+  <title>真模拟考试</title>
 </head>
 <body>
   <div id="app"></div>

BIN
src/assets/img/subject1@2x.png


BIN
src/assets/img/subject4@2x.png


+ 10 - 11
src/components/mask/beforeSubmitMask.vue

@@ -37,26 +37,24 @@ export default {
       count: 0,
     });
     const sendPaper = () => {
-        emit("confirm");
-
+      emit('confirm');
+    };
+    const cancelSubmit = () => {
+      emit('cancel');
     };
-    const cancelSubmit=()=>{
-        emit("cancel");
-
-    }
 
     return {
       ...toRefs(state),
       props,
       sendPaper,
-      cancelSubmit
+      cancelSubmit,
     };
   },
   props: {
     show: {
-        type:Boolean,
-        required:true,
-        default:false
+      type: Boolean,
+      required: true,
+      default: false,
     },
     correctScore: {
       type: Number,
@@ -90,7 +88,7 @@ export default {
   align-items: center;
   justify-content: center;
   .dialog {
-    width: 400px;
+    width: 420px;
     height: 210px;
     background: #fff;
     .title {
@@ -105,6 +103,7 @@ export default {
       width: 100%;
       background: #fff;
       height: 120px;
+      font-size: 14px;
       padding-left: 10px;
       padding-right: 10px;
       .mid-line1 {

+ 2 - 11
src/components/mask/submitMask.vue

@@ -82,17 +82,8 @@ export default {
       type: Number,
       required: true,
       default: 0,
-    },
-    errorScore: {
-      type: Number,
-      required: true,
-      default: 0,
-    },
-    total: {
-      type: Number,
-      required: true,
-      default: 0,
-    },
+    }
+ 
   },
 };
 </script>

+ 0 - 3
src/hooks/examTest.ts

@@ -452,9 +452,6 @@ export function useExamTest() {
         if (e.target?.dataset?.key) {
             listIndex.value = Number(e.target?.dataset?.key) - 1;
         }
-
-
-
     };
     let selectExamAnswer = (item: string) => {
         list.value[listIndex.value] = { ...list.value[listIndex.value], userAnswer: item };

+ 63 - 22
src/views/exam/begin.vue

@@ -1,7 +1,9 @@
 <template>
   <div class="container">
-    <div>
-      <div class="header">驾驶人科目一考试系统</div>
+    <div style="background: #f4f3ef">
+      <div class="header-text-left">Sub of a Driver Training System</div>
+      <div class="headerImg"><img :src="subjectImg" /></div>
+      <div class="header-text-right">Sub of a Driver Training System</div>
       <div class="content">
         <div class="box1">
           <div class="info">考试须知:</div>
@@ -15,13 +17,10 @@
           <div>8.爱护公物及考试设备。</div>
         </div>
         <div class="box2">
-          <div>驾考理论考试01号考台:</div>
-          <div style="color: red" class="">身份证号:123456789101112131415161718</div>
-          <div style="color: red">考生姓名:极速驾培</div>
-          <div class="mt15" style="color: #8a9099">
-            操作提示:每题考试答案确认后,点击【下一题】,电脑立即判定所选答案,如选择错误,系统将提示正确答案,提示后不允许修改答案。
-          </div>
-          <div class="pl24 mt15">
+          <div class="info">驾考理论考试01号考台:</div>
+          <div style="color: #ba2f35" class="">身份证号:123456789101112131415161718</div>
+          <div style="color: #ba2f35">考生姓名:极速驾培</div>
+          <div class="pl138 mt15">
             <div
               @click="
                 () => {
@@ -36,6 +35,9 @@
               开始考试
             </div>
           </div>
+          <div class="mt15" style="color: #32312D">
+          操作提示:每题考试答案确认后,点击【下一题】,电脑立即判定所选答案,如选择错误,系统将提示正确答案,提示后不允许修改答案。
+          </div>
         </div>
       </div>
     </div>
@@ -47,15 +49,21 @@ 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"
 export default defineComponent({
   setup() {
-    window.localStorage.setItem("token","eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjllNTU3NDk1LWQyOGQtNDMyNy1hYTBjLTdjOTk2OTk5NTk1YiJ9.GvGgys5erlFYJMLEhk2S1e7W_9CKDJohfXfW8fZpitkpZ8RWni5u9VvTGjl8dhD1916s-4MTM_7TsNaTNwsuPg")
+    // window.localStorage.setItem(
+    //   'token',
+    //   'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjllNTU3NDk1LWQyOGQtNDMyNy1hYTBjLTdjOTk2OTk5NTk1YiJ9.GvGgys5erlFYJMLEhk2S1e7W_9CKDJohfXfW8fZpitkpZ8RWni5u9VvTGjl8dhD1916s-4MTM_7TsNaTNwsuPg',
+    // );
     //旋转你的屏幕
     const phone = new Phone();
     phone.displayRow();
     const push = useRouter().push;
     const route = useRoute();
     const query = route.query;
+    const subjectImg = query.subject=="1"?subject1Img:subject4Img
     console.log(query);
 
     if (query.token) {
@@ -69,24 +77,29 @@ export default defineComponent({
     return {
       query,
       push,
+      subjectImg
     };
   },
 });
 </script>
 
 <style lang="scss" scoped>
+.pl138{
+  padding-left: 138px;
+}
 .pl24 {
   padding-left: 24px;
 }
 .exam-button {
-  width: 246px;
-  height: 37px;
-  background: #498ef5;
+  width: 93px;
+  height: 28px;
+  background: #02A9ED;
   opacity: 1;
-  border-radius: 18px;
-  line-height: 37px;
+  line-height: 28px;
   color: #fff;
   text-align: center;
+  border-radius: 4px;
+  font-size: 16px;
 }
 .container {
   width: 100%;
@@ -103,41 +116,69 @@ export default defineComponent({
   line-height: 21.8vh;
   color: white;
 }
+.header-text-left {
+  color: #a9a9a1;
+  text-align: left;
+  height: 13px;
+  line-height: 13px;
+  font-size: 8px;
+}
+.header-text-right {
+  color: #a9a9a1;
+  text-align: right;
+  height: 13px;
+  line-height: 13px;
+  font-size: 8px;
+  border-bottom: 1px solid #d8d7d3;
+  padding-right: 15px;
+}
+.headerImg {
+  width: 100%;
+  height: auto;
+
+  > img {
+    width: 100%;
+    height: auto;
+  }
+}
 .mt15 {
   margin-top: 15px;
 }
 .content {
   width: 723px;
-  background: #e8e8e8;
   height: 67vh;
   padding: 0 0;
   margin: 0 auto;
-  margin-top: 13px;
+  margin-top: 4px;
   display: flex;
   flex-wrap: wrap;
   .box1 {
     width: 50%;
     height: 100%;
-    padding-top: 20px;
+    padding-top: 18px;
     padding-left: 17px;
+    color: #3d3c38;
+    border: 1px solid #eae9e5;
     .info {
       font-size: 14px;
-      font-weight: 600;
-      margin-bottom: 13px;
+      margin-bottom: 7px;
     }
     div {
       text-align: left;
       font-size: 13px;
       margin-bottom: 4px;
-      font-weight: 600;
     }
   }
   .box2 {
     width: 50%;
     height: 100%;
     text-align: left;
-    padding-top: 20px;
+    padding-top: 18px;
+    padding-left: 17px;
     font-size: 13px;
+    .info {
+      margin-bottom: 7px;
+    }
   }
 }
 </style>

+ 105 - 70
src/views/exam/test.vue

@@ -2,28 +2,32 @@
   <div class="center">
     <beforeSubmitMask
       :show="beforeSubmitVisible"
-      @cancel="() => {
-        beforeSubmitVisible=false
-      }"
+      @cancel="
+        () => {
+          beforeSubmitVisible = false;
+        }
+      "
       :correctScore="correctScore"
       :errorScore="errorScore"
       :total="list.length"
-      @confirm="() => {
-         beforeSubmitVisible=false
-         submitVisible=true
-      }"
+      @confirm="
+        () => {
+          beforeSubmitVisible = false;
+          submitVisible = true;
+        }
+      "
     ></beforeSubmitMask>
-    <submitMask  v-if="submitVisible" :correctScore="correctScore"></submitMask>
+    <submitMask v-if="submitVisible" :correctScore="correctScore"></submitMask>
     <div class="box">
       <div class="main">
         <div class="container1">
           <div class="kaoti">
             <div class="kaoti-header">金牌驾考</div>
-            <div class="mt16">第01考台</div>
+            <div class="kaoti-headerText">第01考台</div>
           </div>
-          <div class="student mt16">
+          <div class="student mt6">
             <div class="student-header">考生信息</div>
-            <div class="mt19">
+            <div class="mt13">
               <img class="driver" :src="headimg" />
               <div class="driverInfo">
                 <div>姓名:{{ username }}</div>
@@ -34,13 +38,13 @@
           </div>
           <div class="restTime">
             <div class="restTime-header">剩余时间</div>
-            <div class="mt16">{{ countdownTime }}</div>
+            <div class="restTime-headerText">{{ countdownTime }}</div>
           </div>
         </div>
         <div class="container2">
           <div class="topic">
             <div class="topic-header">考试题目</div>
-            <div class="topic-issue" style="font-weight: 600; text-align: left">
+            <div class="topic-issue">
               <span>{{ listIndex + 1 }}.{{ list[listIndex].issue }}</span>
             </div>
             <div class="mt9 topic-select">
@@ -56,7 +60,7 @@
           </div>
           <div class="answer">
             <span>您选择的答案:</span>
-            <div style="display: flex">
+            <div style="display: flex; align-items: center">
               <span>选项:</span>
               <div class="answer-list">
                 <div
@@ -73,9 +77,6 @@
                 <!-- <div class="answer-list-item answer-list-item_select">B</div> -->
               </div>
             </div>
-            <div class="mt16">
-              <img class="answer-img" v-if="list[listIndex].image" :src="list[listIndex].image" />
-            </div>
           </div>
         </div>
         <div class="container3">
@@ -143,7 +144,7 @@
 
       <div class="bottom">
         <div class="left">
-          <div style="color: red; width: 100%">操作提示:选择题</div>
+          <div style="color: #bc322d; width: 100%">操作提示:选择题</div>
           <div>请在备选答案中选择你认为正确的答案!</div>
         </div>
         <div class="right">
@@ -152,6 +153,9 @@
           <div @click="submitScore" class="right-button2">交卷</div>
         </div>
       </div>
+      <div class="mt16">
+        <img class="answer-img" v-if="list[listIndex].image" :src="list[listIndex].image" />
+      </div>
     </div>
   </div>
 </template>
@@ -160,7 +164,7 @@
 import { defineComponent, reactive, ref, onMounted } from 'vue';
 import dayjs from 'dayjs';
 import beforeSubmitMask from '@/components/mask/beforeSubmitMask.vue';
-import submitMask from "@/components/mask/submitMask.vue"
+import submitMask from '@/components/mask/submitMask.vue';
 // import Api from '@/api/api';
 import { countdownTime, countdown, countdownTimer } from '@/hooks/countdown';
 import { useStore } from 'vuex';
@@ -190,7 +194,7 @@ export default defineComponent({
       getPgae,
       correctScore,
       errorScore,
-      submitVisible
+      submitVisible,
     } = useExamTest();
     //设置开始时间
     store.commit('SET_BEGINTIME', {
@@ -703,12 +707,18 @@ export default defineComponent({
   },
   components: {
     beforeSubmitMask,
-    submitMask
+    submitMask,
   },
 });
 </script>
 
 <style lang="scss" scoped>
+.mt6 {
+  margin-top: 6px;
+}
+.mt13 {
+  margin-top: 13px;
+}
 .border-none {
   border: none;
 }
@@ -716,7 +726,7 @@ export default defineComponent({
   background: #498ef5;
 }
 .bottom {
-  margin-top: 14px;
+  margin-top: 3px;
   display: flex;
   padding: 0px 8px;
   font-size: 13px;
@@ -727,6 +737,9 @@ export default defineComponent({
   height: 46px;
   border: 1px solid #b8c0cc;
   border-radius: 6px;
+  padding: 4px 0px;
+  padding-left: 6px;
+  padding-right: 12px;
   .left {
     display: flex;
     width: 50%;
@@ -767,9 +780,9 @@ export default defineComponent({
 }
 .center {
   display: flex;
-  align-content: center;
-  align-items: center;
+
   height: 100vh;
+  background: #f6f2f1;
 }
 .box {
   padding-top: 16px;
@@ -787,15 +800,14 @@ export default defineComponent({
 }
 .container2 {
   box-sizing: border-box;
-  padding-left: 10px;
-  padding-right: 10px;
+  padding-left: 3px;
+  padding-right: 3px;
   width: 454px;
-  height: 258px;
+  height: 151px;
 }
 .container1 {
   display: flex;
-  height: 258px;
-  width: 109px;
+  width: 73px;
   flex-direction: column;
 }
 .coll {
@@ -853,7 +865,13 @@ export default defineComponent({
       border-bottom: 1px solid #b8c0cc;
       border-right: 1px solid #b8c0cc;
 
-      font-size: 12px;
+      div {
+        font-size: 8px;
+        width: 15px;
+        height: 15px;
+        line-height: 15px;
+      }
+      // font-size: 12px;
       .coll-table-topic-item {
         border: none;
 
@@ -872,21 +890,21 @@ export default defineComponent({
 .answer {
   font-size: 13px;
   text-align: left;
-  margin-top: 13px;
-  height: 24px;
-  line-height: 24px;
+  height: 31px;
+  line-height: 31px;
   font-weight: 600;
   display: flex;
   justify-content: space-between;
+  align-items: center;
+  align-content: center;
   flex-wrap: wrap;
-  .answer-img {
-    width: 321px;
-    height: 128px;
-  }
+  padding-left: 18px;
+
   .answer-list {
     display: flex;
     justify-content: space-between;
     width: auto;
+    height: 24px;
     .answer_selected {
       color: #fff;
       background: #498ef5;
@@ -908,28 +926,34 @@ export default defineComponent({
     }
   }
 }
+.answer-img {
+
+  height: 63px;
+}
 .topic {
   border: 1px solid #b8c0cc;
   width: 100%;
-  height: 93px;
-  border-radius: 6px;
+  height: 161px;
   position: relative;
   .topic-issue {
-    margin-top: 14px;
+    margin-top: 8px;
     font-size: 13px;
     padding-left: 10px;
+    font-weight: normal;
+    text-align: left;
   }
   .topic-header {
     color: #498ef5;
     position: absolute;
-    background: #fff;
+    background: #f6f2f1;
     top: 0;
-    left: 15%;
+    left: 30px;
     transform: translate(-50%, -50%);
     text-align: left;
-    padding-left: 8px;
-    padding-right: 8px;
+    padding-left: 2px;
+    padding-right: 2px;
     white-space: nowrap;
+    font-size: 10px;
   }
   .topic-select {
     display: flex;
@@ -937,8 +961,7 @@ export default defineComponent({
     height: 37px;
     padding-left: 10px;
     padding-right: 10px;
-    font-size: 13px;
-    font-weight: 600;
+    font-size: 14px;
     flex-wrap: wrap;
   }
   .topic-select-item {
@@ -949,69 +972,77 @@ export default defineComponent({
 }
 .student {
   border: 1px solid #b8c0cc;
-  width: 101px;
-  height: 150px;
+  width: 70px;
+  height: 125px;
   font-size: 13px;
   position: relative;
   .student-header {
     color: #498ef5;
     position: absolute;
-    background: #fff;
+    background: #f6f2f1;
     top: 0;
     left: 50%;
     transform: translate(-50%, -50%);
     text-align: left;
-    padding-left: 8px;
-    padding-right: 8px;
+    padding-left: 2px;
+    padding-right: 2px;
     white-space: nowrap;
     font-weight: 600;
+    font-size: 10px;
   }
   .driver {
-    width: 46px;
-    height: 46px;
+    width: 57px;
+    height: 57px;
   }
   .driverInfo {
-    font-size: 13px;
+    font-size: 9px;
     font-weight: 600;
-    padding-top: 10px;
+    padding-top: 6px;
     text-align: left;
-    padding-left: 10px;
+    padding-left: 2px;
+    div {
+      margin-bottom: 4px;
+    }
   }
 }
 .kaoti {
-  width: 101px;
+  width: 70px;
   position: relative;
-  height: 37px;
+  height: 26px;
   border: 1px solid #b8c0cc;
   font-size: 13px;
   font-weight: 600;
-  border-radius: 6px;
   .kaoti-header {
     color: #498ef5;
     position: absolute;
-    background: #fff;
+    background: #f6f2f1;
     top: 0;
     left: 50%;
+    font-size: 10px;
     transform: translate(-50%, -50%);
     text-align: left;
-    padding-left: 8px;
-    padding-right: 8px;
+    padding-left: 2px;
+    padding-right: 2px;
     white-space: nowrap;
   }
+  .kaoti-headerText {
+    font-size: 8px;
+    font-weight: normal;
+    margin-top: 8px;
+  }
 }
 .restTime {
-  width: 101px;
+  width: 70px;
   position: relative;
-  height: 37px;
+  height: 26px;
   border: 1px solid #b8c0cc;
-  font-size: 13px;
+  font-size: 9px;
   font-weight: 600;
-  border-radius: 6px;
-  margin-top: 14px;
+  margin-top: 6px;
   .restTime-header {
     color: #498ef5;
     position: absolute;
-    background: #fff;
+    background: #f6f2f1;
     top: 0;
     left: 50%;
     transform: translate(-50%, -50%);
@@ -1020,9 +1051,13 @@ export default defineComponent({
     padding-right: 8px;
     white-space: nowrap;
   }
+  .restTime-headerText {
+    margin-top: 7px;
+    font-size: 12px;
+  }
 }
-.mt16 {
-  margin-top: 14px;
+.mt6 {
+  margin-top: 6px;
 }
 .mt9 {
   margin-top: 9px;