林旭祥 vor 8 Monaten
Ursprung
Commit
76e99be298

+ 1 - 1
src/components/OptionWindow/index.vue

@@ -303,7 +303,7 @@ const confirm = (data: any) => {
 onMounted(() => {
 })
 
-onUnmounted(() => {
+onBeforeUnmount(() => {
   loading.value = false;
 })
 

+ 59 - 7
src/components/ReportWindow/index.vue

@@ -69,17 +69,29 @@
           <div class="content">
             <div class="video" v-if="reportDetails.video_urls?.length" v-show="currentTab == 1 ? true : false">
               <!--视频开始-->
-              <video v-for="(item, index) in reportDetails.video_urls" :key="index"
-                style="width: 100%; object-fit: fill" :src="item"
-                :poster="item?.replace('  ', '') + '?x-oss-process=video/snapshot,t_100,f_jpg,w_0,h_0,ar_auto'" controls
-                autoplay>
-                您的浏览器不支持 video 标签。
-              </video>
+              <swiper ref="swiperVideoRef" :slides-per-view="1" :slides-per-group="1" :space-between="0"
+                :modules="[Navigation, Pagination]" :navigation="{
+                  prevEl: '.btn-left1',
+                  nextEl: '.btn-right1',
+                }" :pagination="{ el: '.swiper-pagination-new1', type: 'fraction' }">
+                <swiper-slide v-for="(item, index) in reportDetails.video_urls" :key="index">
+                  <video style="width: 100%; object-fit: fill" :src="item"
+                    :poster="item?.replace(' ', '') + '?x-oss-process=video/snapshot,t_100,f_jpg,w_0,h_0,ar_auto'"
+                    controls autoplay>
+                    您的浏览器不支持 video 标签。
+                  </video>
+                </swiper-slide>
+              </swiper>
+              <div class="navigationBox1">
+                <div class="btn-left1"></div>
+                <div class="swiper-pagination-new1"></div>
+                <div class="btn-right1"></div>
+              </div>
               <!--视频结束-->
             </div>
             <div class="pic" v-if="reportDetails.image_urls?.length" v-show="currentTab == 2 ? true : false">
               <!--图片开始-->
-              <swiper ref="refSwiper" :slides-per-view="1" :slides-per-group="1" :space-between="0"
+              <swiper ref="swiperPicRef" :slides-per-view="1" :slides-per-group="1" :space-between="0"
                 :modules="[Navigation, Pagination]" :navigation="{
                   prevEl: '.btn-left',
                   nextEl: '.btn-right',
@@ -321,6 +333,7 @@ defineExpose({
             margin: 0 auto 2vh auto;
             box-sizing: border-box;
             border: 0.44rem solid rgba(26, 41, 58, 0.6315);
+            position: relative;
 
             img {
               width: 100%;
@@ -506,10 +519,49 @@ defineExpose({
         $maxHeight: calc(77.5vh - 40px - 3.2rem - 16px - 13vh - 2rem);
 
         .video {
+          position: relative;
+
           video {
             max-height: $maxHeight;
             max-width: 100%;
           }
+
+          .navigationBox1 {
+            width: 14rem;
+            display: flex;
+            justify-content: space-between;
+            position: absolute;
+            z-index: 2;
+            left: 50%;
+            bottom: -1.6rem;
+            margin-left: -7rem;
+
+            .btn-left1 {
+              cursor: pointer;
+              width: 2.2rem;
+              height: 2.2rem;
+              background: url("@/assets/images/ranking/btn-left.png") center center no-repeat;
+              background-size: 100% 100%;
+            }
+
+            .btn-right1 {
+              cursor: pointer;
+              width: 2.2rem;
+              height: 2.2rem;
+              background: url("@/assets/images/ranking/btn-right.png") center center no-repeat;
+              background-size: 100% 100%;
+            }
+
+            .swiper-pagination-new1 {
+              width: 7rem;
+              height: 2.2rem;
+              line-height: 2.2rem;
+              color: #1F3A4F;
+              font-size: 1.6rem;
+              border-radius: 1.6rem;
+              background: #D8D8D8;
+            }
+          }
         }
 
         .pic {

+ 1 - 1
src/layout/index.vue

@@ -40,7 +40,7 @@ onMounted(() => {
   getCountDown()
 })
 
-onUnmounted(() => {
+onBeforeUnmount(() => {
   getClearTimer()
 })
 </script>

+ 1 - 1
src/views/gesture/index.vue

@@ -118,7 +118,7 @@ onBeforeMount(() => {
 onMounted(() => {
 
 })
-onUnmounted(() => {
+onBeforeUnmount(() => {
   getClearTimer();
 })
 </script>

+ 2 - 2
src/views/ranking/index.vue

@@ -6,7 +6,7 @@
         <div class="top-left">
           <div class="title1">{{ pageType == 1 ? "运动风云榜" : pageType == 2 ? currentClass.name : "" }} · {{
             projectObj.title
-          }}</div>
+            }}</div>
           <div class="title2" @click="choiceClassWindow = true">{{ pageType == 1 ? "切换到班级榜" : pageType == 2 ? "切换到班级" :
             "" }}</div>
         </div>
@@ -779,7 +779,7 @@ onMounted(() => {
   getProject();
 })
 
-onUnmounted(() => {
+onBeforeUnmount(() => {
   clearInterval(timer.value);
   clearInterval(countDownTimer.value);
 })

+ 2 - 2
src/views/train/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="train">
     <Header @confirmExit="getExit" :showTool="false" closeClass="close2"></Header>
-    <div class="menu" :class="projectList.length <= 12 ? 'menu1' : 'menu2'">
+    <div class="menu" v-if="projectList.length" :class="projectList.length <= 12 ? 'menu1' : 'menu2'">
       <swiper :slides-per-view="6" :modules="[Grid]" :grid="{
         fill: projectList.length <= 12 ? 'row' : 'column',
         rows: 2,
@@ -89,7 +89,7 @@ onBeforeMount(() => {
   getInitExam();
 })
 
-onUnmounted(() => {
+onBeforeUnmount(() => {
   getClearTimer();
 })
 </script>

+ 2 - 1
src/views/train/multiple.vue

@@ -201,6 +201,7 @@ const getExit = () => {
   getClearTimer();//清除计时器
   examEnds();//通知工作站关闭
   speckCancel()//停止播报;
+  window.onbeforeunload = null;//移除事件处理器
   router.push({ path: '/' });//跳转
 };
 
@@ -624,7 +625,7 @@ onMounted(() => {
   }, 10000);
 })
 
-onUnmounted(() => {
+onBeforeUnmount(() => {
   getExit();
 })
 </script>

+ 22 - 2
src/views/train/run.vue

@@ -4,7 +4,7 @@
     <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
       <div class="time" v-show="[42].includes(examState)">{{
         countdownNumFormat
-      }}</div>
+        }}</div>
     </Transition>
     <div class="main">
       <template v-if="isLongRun">
@@ -211,6 +211,9 @@ const getMessage = (e: any) => {
     examState.value = e.data;
     if (e.data === 3) {
       initProject();
+      if (showTestAgain.value) {
+        reportListRef.value.getIniReportList();
+      }
     }
     if (e.data === 40) {
       cleanData();
@@ -304,6 +307,16 @@ const getFaceConfirmOnly = (data?: any) => {
       return item;
     })
   }
+  //重组数据
+  list = list.map((item: any) => {
+    let obj = {
+      student_id: item.student_id,
+      student_name: item.student_name,
+      gender: item.gender,
+      track: item.track
+    }
+    return obj;
+  })
   faceConfirmOnly(list, () => {
   });
 };
@@ -474,6 +487,7 @@ const getExit = () => {
   getClearTimer();//清除计时器
   examEnds();//通知工作站关闭
   speckCancel()//停止播报;
+  window.onbeforeunload = null;//移除事件处理器
   router.push({ path: '/' });//跳转
 };
 
@@ -805,9 +819,15 @@ onBeforeMount(() => {
   });
   //初始化语音
   initSpeech();
+  //刷新关闭
+  window.onbeforeunload = function (e) {
+    var confirmationMessage = "刷新/关闭页面将会关闭页面,是否确认退出页面?";
+    (e || window.event).returnValue = confirmationMessage; // 兼容 Gecko + IE
+    return confirmationMessage; // 兼容 Gecko + Webkit, Safari, Chrome
+  };
 })
 
-onUnmounted(() => {
+onBeforeUnmount(() => {
   getExit();
 })
 </script>

+ 7 - 4
src/views/train/test.vue

@@ -21,7 +21,7 @@
               :leave-active-class="proxy?.animate.dialog.leave">
               <div class="time" v-show="needStart && [42].includes(examState)">{{
                 time.countdownNum
-                }}</div>
+              }}</div>
             </Transition>
             <div class="tips" v-if="examState == 41">
               <img v-if="parameter.gesture" src="@/assets/images/test/ready1.png" />
@@ -196,6 +196,10 @@ const getMessage = (e: any) => {
     examState.value = e.data;
     if (e.data === 3) {
       initProject();
+      if (faceCheckStu.value.student_id) {
+        reportListRef.value.getIniReportList();
+        faceWindowRef.value.open("right");
+      }
     }
     if (e.data === 40) {
       cleanData();
@@ -379,6 +383,7 @@ const getExit = () => {
   getClearTimer();//清除计时器
   examEnds();//通知工作站关闭
   speckCancel()//停止播报;
+  window.onbeforeunload = null;//移除事件处理器
   router.push({ path: '/' });//跳转
 };
 
@@ -624,8 +629,6 @@ const getAchievement = (data: any) => {
     } else {
       speckText(faceCheckStu?.value.name + "成绩为" + (chineseNumber(count) || 0) + unit.value + ",请下一位准备!" || "");
     }
-    reportListRef.value.getIniReportList();
-    faceWindowRef.value.open("right");
     //然后定时自动关闭
     setTimeout(() => {
       faceWindowRef.value.close();
@@ -804,7 +807,7 @@ onBeforeMount(() => {
   initHand();
 })
 
-onUnmounted(() => {
+onBeforeUnmount(() => {
   getExit();
 })
 </script>