Эх сурвалжийг харах

三力测试新增弹窗,成绩建设中

JXDS18FUJT 2 жил өмнө
parent
commit
b389414780

+ 15 - 7
src/components/countDown/index.vue

@@ -12,7 +12,7 @@
 </template>
 
 <script>
-let t
+let t;
 export default {
   data() {
     return {
@@ -61,19 +61,27 @@ export default {
       this.privateTime = Number(newVal);
     },
   },
-  destroyed(){
-    clearInterval(t)
-
+  destroyed() {
+    clearInterval(t);
   },
   mounted() {
     t = setInterval(() => {
       this.privateTime = this.privateTime - 1000;
       //第一参数是剩余时间,第二个是过去的时间
-      this.$emit("change", this.formatterTime(this.privateTime, "mm:ss"),this.formatterTime(this.time-this.privateTime, "mm:ss"));
+      this.$emit(
+        "change",
+        this.formatterTime(this.privateTime, "mm:ss"),
+        this.formatterTime(this.time - this.privateTime, "mm:ss")
+      );
       if (this.privateTime == 0) {
         clearInterval(t);
-          //第一参数是剩余时间,第二个是过去的时间
-        this.$emit("end", this.formatterTime(this.privateTime, "mm:ss"),this.formatterTime(this.time-this.privateTime, "mm:ss"));
+        //第一参数是剩余时间,第二个是过去的时间
+
+        this.$emit(
+          "end",
+          this.formatterTime(this.privateTime, "mm:ss"),
+          this.formatterTime(this.time - this.privateTime, "mm:ss")
+        );
       }
     }, 1000);
   },

+ 1 - 1
src/otherPages/teacherVideo/index.vue

@@ -3,7 +3,7 @@
     <view class="road">
       <view class="nav"
         ><view class="left">科目三真实考场</view
-        ><view class="right" @click="goPath">
+        ><view class="right" @click="goPath('/otherPages/')">
           查找我的考场<van-icon color="#498EF5" name="arrow"
         /></view>
       </view>

+ 42 - 17
src/otherPages/threeExam/index.vue

@@ -255,6 +255,7 @@
           class="submit-button"
           ><text>交卷</text
           ><countDown
+            @change="getThreeExamTime"
             @end="submitExam"
             background=""
             :time="examTime"
@@ -282,21 +283,25 @@
         </view>
       </view>
     </view>
-    <van-popup :zIndex="1000" round :show="submitExamVisible">
+    <van-popup :zIndex="1005" round :show="submitExamVisible">
       <view class="tip1">
         <view class="title"> 确认交卷 </view>
         <view class="score">
           <view class="score-list">
-            <view class="score-dont"> 20</view>
+            <view class="score-dont">
+              {{ problemList.length - trueNum - falseNum }}</view
+            >
             <view style="font-size: 28rpx; color: #8a9099">未答题数</view>
           </view>
           <view class="score-list"
-            ><view class="score-rest" style="margin: 0 auto"> 19:59</view>
-            <view style="font-size: 28rpx; color: #8a9099">未答题数</view></view
+            ><view class="score-rest" style="margin: 0 auto">
+              {{ restTime }}</view
+            >
+            <view style="font-size: 28rpx; color: #8a9099">剩余时间</view></view
           >
           <view class="score-list"
-            ><view class="score-exam"> 2</view>
-            <view style="font-size: 28rpx; color: #8a9099">未答题数</view></view
+            ><view class="score-exam"> {{ score }}</view>
+            <view style="font-size: 28rpx; color: #8a9099">考试得分</view></view
           >
         </view>
         <view class="bottom">
@@ -312,7 +317,7 @@
           <view
             @click="
               () => {
-                submitExamVisible = true;
+                resultExamVisible = true;
               }
             "
             class="right"
@@ -321,12 +326,7 @@
         </view>
       </view>
     </van-popup>
-    <van-popup
-      custom-class="no-bg"
-      :zIndex="1001"
-      round
-      :show="resultExamVisible"
-    >
+    <van-popup :zIndex="1006" round :show="resultExamVisible">
       <view class="tip2">
         <view style="position: relative">
           <image
@@ -365,8 +365,17 @@
             >
             <view class="tip2-bottom">
               <!-- <view class="tip2-bottom-1">试试答题技巧,提分更快</view> -->
-              <view class="tip2-bottom-2">现在交卷</view>
-              <view class="tip2-bottom-3">继续答题</view>
+              <view @click="goPath" class="tip2-bottom-2">现在交卷</view>
+              <view
+                @click="
+                  () => {
+                    resultExamVisible = false;
+                    submitExamVisible = false;
+                  }
+                "
+                class="tip2-bottom-3"
+                >继续答题</view
+              >
             </view>
           </view>
         </view>
@@ -377,11 +386,14 @@
 
 <script>
 import api from "@/api";
-const dayjs = require("dayjs");
+import utils from '@/utils'
 import countDown from "@/components/countDown/index";
 export default {
   data() {
     return {
+      query:{
+
+      },
       anLength: 7,
       problemList: [
         {
@@ -461,9 +473,12 @@ export default {
       submitExamVisible: false,
       resultExamVisible: false,
       examTime: 1000 * 60 * 20,
+      restTime: "",
+      useTime: "",
     };
   },
-  onLoad() {
+  onLoad(query) {
+    this.query = query
     api.exam.studentThreeForceSelectTestQuestionInfoList().then((res) => {
       if (Array.isArray(res.rows) && res.rows.length > 0) {
         res.rows.forEach((element) => {
@@ -475,7 +490,17 @@ export default {
     });
   },
   methods: {
+    goPath(url){
+      uni.navigateTo({
+        url:url+'?'+utils.mapToUrlQuery(this.query)
+      })
+    },
+    getThreeExamTime(a, b) {
+      this.restTime = a;
+      this.useTime = b;
+    },
     submitExam(e) {
+      console.log(e);
       uni.showModal({
         title: "是否交卷",
         success(res) {

+ 0 - 0
src/otherPages/threeExamScore/index.vue