Browse Source

音频修改

林旭祥 4 weeks ago
parent
commit
fa50f2821e

BIN
public/static/audio/PleaseIdentify3.mp3


BIN
public/static/audio/PleaseIdentify4.mp3


BIN
public/static/audio/startTesting.mp3


BIN
public/static/audio/testCompleted.mp3


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

@@ -17,7 +17,7 @@
               <img src="@/assets/images/test/profilePicture.png" />
             </div>
             <div class="name" :class="{ 'name2': faceCheckStu.student_id }">
-              {{ faceCheckStu.student_id ? faceCheckStu.name : gesture ? "请举右手看摄像头人脸识别" : "请看摄像头进行人脸识别" }}
+              {{ faceCheckStu.student_id ? faceCheckStu.name : gesture ? "请举右手看摄像头进行人脸识别" : "请看摄像头进行人脸识别" }}
             </div>
           </div>
         </div>

+ 4 - 0
src/utils/speech.ts

@@ -93,6 +93,8 @@ export const speckText = (text: any) => {
     // '还有10秒,坚持住!': 'countdown10s.mp3',
     // '预备': 'Ready.mp3',
     // { lable: '预备2', value: 'Ready2.mp3' },
+    { lable: '请看摄像头进行人脸识别', value: 'PleaseIdentify3.mp3' },
+    { lable: '请举右手看摄像头进行人脸识别', value: 'PleaseIdentify4.mp3' },
     { lable: '5', value: '5.mp3' },
     { lable: '4', value: '4.mp3' },
     { lable: '3', value: '3.mp3' },
@@ -104,6 +106,8 @@ export const speckText = (text: any) => {
     { lable: '哨声', value: 'shaosheng.mp3' },
     { lable: '哨声2', value: 'shaosheng2.mp3' },
     { lable: '预备3', value: 'Ready3.mp3' },
+    { lable: '请开始测试', value: 'startTesting.mp3' },
+    { lable: '测试结束', value: 'testCompleted.mp3' },
   ];
   speechText = '';
   let obj = list.find((item: any) => {

+ 1 - 1
src/views/game/square.vue

@@ -593,7 +593,7 @@ const getCounting = (type: string) => {
  */
 const getFaceWindow = (data: boolean, num: number = 0) => {
   let total = num + 1; //叠加三次后不再播放
-  let txt = parameter.value.gesture === true ? '请举右手看摄像头人脸识别' : '请看摄像头进行人脸识别';
+  let txt = parameter.value.gesture === true ? '请举右手看摄像头进行人脸识别' : '请看摄像头进行人脸识别';
   speckText(txt);
   //data=true为弹出框,data=false为不要弹出框
   if (data) {

+ 7 - 7
src/views/train/multiple.vue

@@ -64,9 +64,9 @@
         <div class="confirmDiaBg" v-show="examState == 43 && time.ready">
           <div class="confirmDiaWindow">
             <div class="readyBox">
-              <!-- <div class="lable">倒计时</div>
-              <div class="value" :class="{ 'transparent': time.ready > 5 }">{{ time.ready }}</div> -->
-              <div class="lable2">预 备</div>
+              <div class="lable">倒计时</div>
+              <div class="value" :class="{ 'transparent': time.ready > 5 }">{{ time.ready }}</div>
+              <!-- <div class="lable2">预 备</div> -->
             </div>
           </div>
         </div>
@@ -454,7 +454,7 @@ const returnData = (data: any) => {
     if (flag) {
       console.log('变更状态:', 41);
       examState.value = 41;
-      let txt = parameter.value.gesture ? '请举右手看摄像头人脸识别' : '请看摄像头进行人脸识别';
+      let txt = parameter.value.gesture ? '请举右手看摄像头进行人脸识别' : '请看摄像头进行人脸识别';
       speckText(txt);
       //如果过段时候后仍在识别中就提示停止识别
       // setTimeout(() => {
@@ -566,16 +566,16 @@ const getReady = () => {
       multipleItemRefList.value[i].getStopFace();
     }
   }
-  speckText("预备3");
+  //speckText("预备3");
   //speckText("各就位!预备!");
-  time.value.ready = 3;
+  time.value.ready = 6;
   timerManager.value.readyTimer = setInterval(() => {
     time.value.ready--;
     if (time.value.ready <= 0) {
       getClearTimer('readyTimer');
       getStartOneTest();
     } else {
-      //speckText(time.value.ready);
+      speckText(time.value.ready);
     }
   }, 1000);
 };

+ 36 - 26
src/views/train/test.vue

@@ -18,8 +18,10 @@
             </div>
           </div>
           <div class="top-right">
-            <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
-              <div class="time" v-show="needStart && [42].includes(examState) && !['basketballv1', 'footballv1'].includes(parameter.project)">
+            <Transition :enter-active-class="proxy?.animate.dialog.enter"
+              :leave-active-class="proxy?.animate.dialog.leave">
+              <div class="time"
+                v-show="needStart && [42].includes(examState) && !['basketballv1', 'footballv1'].includes(parameter.project)">
                 {{
                   time.countdownNum
                 }}
@@ -29,15 +31,15 @@
               <img v-if="parameter.gesture" src="@/assets/images/test/ready1.png" />
               <img v-if="!parameter.gesture" src="@/assets/images/test/ready2.png" />
             </div>
-            <div
-              class="complete"
-              :class="{ 'complete2': needStart && [42].includes(examState) }"
-              v-if="faceCheckStu.student_id && time.ready <= 0 && examState != 43 && examState != 41"
-            >
+            <div class="complete" :class="{ 'complete2': needStart && [42].includes(examState) }"
+              v-if="faceCheckStu.student_id && time.ready <= 0 && examState != 43 && examState != 41">
               <div class="scoreBox">
-                <div class="score" v-if="currentResultObj?.count && currentResultObj.count>=0">{{ currentResultObj.count }}</div>
-                <div class="prompt" v-if="currentResultObj?.count && currentResultObj.count==0 && examState == 42">请开始测试</div>
-                <div class="unit" v-if="!['basketballv1', 'footballv1'].includes(parameter.project) && currentResultObj.count && !needStart">
+                <div class="score" v-if="currentResultObj?.count && currentResultObj.count >= 0">{{ currentResultObj.count
+                  }}</div>
+                <div class="prompt" v-if="currentResultObj?.count && currentResultObj.count == 0 && examState == 42">请开始测试
+                </div>
+                <div class="unit"
+                  v-if="!['basketballv1', 'footballv1'].includes(parameter.project) && currentResultObj.count && !needStart">
                   {{ unit }}
                 </div>
               </div>
@@ -56,7 +58,8 @@
               </div>
             </div>
             <div class="foulBox" v-if="examState == 42 && backReason.length">
-              <Transition :enter-active-class="proxy?.animate.mask.enter" :leave-active-class="proxy?.animate.mask.leave">
+              <Transition :enter-active-class="proxy?.animate.mask.enter"
+                :leave-active-class="proxy?.animate.mask.leave">
                 <div class="foul" v-show="backReasonStr ? true : false">
                   <div class="lable">!</div>
                   <div class="value">{{ backReasonStr }}</div>
@@ -90,7 +93,8 @@
             <div v-show="examState == 43 && !faceCheckStu.student_id">
               <div class="btn btn2" @click="getChooseStudent">点击重新识别</div>
             </div>
-            <div class="btn" @click="getReady" v-if="needStart && examState == 43 && faceCheckStu.student_id && !time.ready && readyState">开 始</div>
+            <div class="btn" @click="getReady"
+              v-if="needStart && examState == 43 && faceCheckStu.student_id && !time.ready && readyState">开 始</div>
             <!-- <div v-if="needStart"> -->
             <!-- <div class="btn" @click="getOpenOneTestAndStartFace" v-if="examState < 41">开始识别</div> -->
             <!-- <div class="btn" @click="getStopFace" v-if="examState == 41 && !parameter.gesture">停止人脸识别</div> -->
@@ -116,7 +120,8 @@
     </div>
     <FaceWindow ref="faceWindowRef" :faceCheckStu="faceCheckStu" :gesture="parameter.gesture" />
     <ChooseStudent ref="chooseStudentRef" @returnData="returnStudent" />
-    <JumpRopeGame ref="gameContainer" v-if="['test'].includes(parameter.project) && (!readyState || [42].includes(examState))" />
+    <JumpRopeGame ref="gameContainer"
+      v-if="['test'].includes(parameter.project) && (!readyState || [42].includes(examState))" />
     <div class="close" @click="confirmExit"></div>
   </div>
 </template>
@@ -378,7 +383,7 @@ const getRetestFace = () => {
         }
       }
     })
-    .finally(() => {});
+    .finally(() => { });
 };
 
 /**
@@ -415,7 +420,8 @@ const getStartOneTest = () => {
         getCounting('-');
       }
     } else {
-      speckText(faceCheckStu.value.name + ',请开始测试');
+      //speckText(faceCheckStu.value.name + ',请开始测试');
+      speckText('请开始测试');
     }
   });
 };
@@ -454,7 +460,7 @@ const confirmExit = () => {
     .then(() => {
       getExit();
     })
-    .finally(() => {});
+    .finally(() => { });
 };
 
 /**
@@ -597,7 +603,7 @@ const getCounting = (type: string) => {
  */
 const getFaceWindow = (data: boolean, num: number = 0) => {
   let total = num + 1; //叠加三次后不再播放
-  let txt = parameter.value.gesture === true ? '请举右手看摄像头人脸识别' : '请看摄像头进行人脸识别';
+  let txt = parameter.value.gesture === true ? '请举右手看摄像头进行人脸识别' : '请看摄像头进行人脸识别';
   speckText(txt);
   //data=true为弹出框,data=false为不要弹出框
   if (data) {
@@ -710,16 +716,19 @@ const getAchievement = (data: any) => {
       speckText('请重新测试');
       return false;
     }
-    if (['basketballv1', 'footballv1'].includes(type)) {
-      speckText(
-        faceCheckStu?.value.name +
+    speckText('测试结束');
+    setTimeout(() => {
+      if (['basketballv1', 'footballv1'].includes(type)) {
+        speckText(
+          faceCheckStu?.value.name +
           '成绩为' +
           (chineseNumber(proxy?.$utils.runTime(data?.[dic.typeResultKey[type]], false, 0, 1)) || 0) +
           ',请下一位准备!' || ''
-      );
-    } else {
-      speckText(faceCheckStu?.value.name + '成绩为' + (chineseNumber(count) || 0) + unit.value + ',请下一位准备!' || '');
-    }
+        );
+      } else {
+        speckText(faceCheckStu?.value.name + '成绩为' + (chineseNumber(count) || 0) + unit.value + ',请下一位准备!' || '');
+      }
+    }, 2000)
     reportListRef.value.getIniReportList();
     faceWindowRef.value.open();
     //然后定时自动关闭
@@ -773,7 +782,7 @@ const getMusic = async () => {
 /**
  * 设置音乐
  */
-const setMusic = async (data:any) => {
+const setMusic = async (data: any) => {
   //console.log("data",data)
   parameter.value.music = data;
 };
@@ -787,7 +796,7 @@ const getDevice = async () => {
     startDevice({ deviceid: deviceid });
   } else {
     proxy?.$modal.msgError(`缺少设备信息请重新登录!`);
-    await proxy?.$http.common.logout({}).then((res: any) => {});
+    await proxy?.$http.common.logout({}).then((res: any) => { });
     proxy?.$modal?.closeLoading();
     //清空缓存
     // localStorage.clear();
@@ -1561,6 +1570,7 @@ $waiPadding: 6.51rem;
     overflow: hidden;
   }
 }
+
 .close {
   position: absolute;
   // right: calc($waiPadding - 3.2rem);