Jelajahi Sumber

日常开发

linxuxiang 6 bulan lalu
induk
melakukan
719d311859
2 mengubah file dengan 12 tambahan dan 6 penghapusan
  1. 6 4
      src/views/train/multiple.vue
  2. 6 2
      src/views/train/test.vue

+ 6 - 4
src/views/train/multiple.vue

@@ -607,7 +607,7 @@ const getDevice = async () => {
 */
 const initHand = () => {
   handWs((e: any) => {
-    if (router.currentRoute.value.path != '/train/multiple'){
+    if (router.currentRoute.value.path != '/train/multiple' || parameter.value.handcontroller == undefined){
       return false;
     }
     console.log("eeeee", e)
@@ -626,21 +626,23 @@ const initHand = () => {
       let handcontroller_id = device_info.value.handcontroller_id;
       startHand(handcontroller_id);
     }
+    //没初始化完成不监听手势动作
+    if(examState.value == 0){
+      return false;
+    }
     //左滑动
     if (e?.data?.result == "next_item") {
     }
     //举左手
     if (e?.data?.result == "left_hand") {
-      console.log("qqqqqqqqqqqqqqqqqqqq")
+
       //开始识别
       if (needStart.value && examState.value < 41) {
-        console.log("111111111111111111111")
         getOpenOneTestAndStartFace();
         return false;
       }
       //停止人脸识别
       if (needStart.value && examState.value == 41) {
-        console.log("222222222222222222222")
         getStopFace();
         return false;
       }

+ 6 - 2
src/views/train/test.vue

@@ -279,7 +279,7 @@ const getStopFace = async () => {
   // }
   getClearTimer("face");
   if (needStart.value) {
-    let txt = parameter.value.handcontroller === true ? ",请举左手开始测试" : ",请准备";
+    let txt = parameter.value.handcontroller ? ",请举左手开始测试" : ",请准备";
     speckText(faceCheckStu.value.name + txt);
   }
   if (examState.value == 41) {
@@ -720,7 +720,7 @@ const getDevice = async () => {
 */
 const initHand = () => {
   handWs((e: any) => {
-    if (router.currentRoute.value.path != '/train/test') {
+    if (router.currentRoute.value.path != '/train/test' || parameter.value.handcontroller == undefined || examState.value == 0) {
       return false;
     }
     console.log("eeeee", e)
@@ -739,6 +739,10 @@ const initHand = () => {
       let handcontroller_id = device_info.value.handcontroller_id;
       startHand(handcontroller_id);
     }
+    //没初始化完成不监听手势动作
+    if(examState.value == 0){
+      return false;
+    }
     //左滑动
     if (e?.data?.result == "next_item") {
     }