林旭祥 hace 3 semanas
padre
commit
ed37c567c8
Se han modificado 2 ficheros con 18 adiciones y 4 borrados
  1. 10 0
      src/components/ActionConfirmWindow/index.vue
  2. 8 4
      src/views/game/index.vue

+ 10 - 0
src/components/ActionConfirmWindow/index.vue

@@ -247,6 +247,15 @@ const getOpen = async (game: any, area: any) => {
   }) || [];
   areaStateList.value = list;
   actionState.value = true;
+  if (currentGame.value == 'game_fruit') {
+    speckText("举手开始游戏");
+  }
+  if (currentGame.value == 'game_basketball') {
+    speckText("请做投篮动作开始游戏");
+  }
+  if (currentGame.value == 'game_football') {
+    speckText("请踢腿开始游戏");
+  }
 };
 
 /**
@@ -339,6 +348,7 @@ defineExpose({
       i {
         width: 3vh;
         height: 3vh;
+        margin-right: 3px;
         display: block;
         background-image: url('@/assets/images/game/prompt.png');
         background-position: bottom;

+ 8 - 4
src/views/game/index.vue

@@ -60,7 +60,7 @@
         </div>
       </div>
     </Transition>
-    <div class="close" v-if="currentGame" @click="getExitGame"></div>
+    <div class="close" v-if="start" @click="getExitGame"></div>
     <ActionConfirmWindow ref="actionConfirmRef" @confirmExit="getExitGame(1)" @confirmStart="getStartGame">
     </ActionConfirmWindow>
   </div>
@@ -169,9 +169,12 @@ const getInit = async () => {
       if (!currentGame.value) {
         return false;
       }
+      if (!start.value) {
+        //传给预备窗口
+        actionConfirmRef.value.getInit(e);
+        return false;
+      }
       let area = e.ctrl_name.replace('bodyposecontroller_', '');
-      //传给预备窗口
-      actionConfirmRef.value.getInit(e);
       //传给游戏窗口
       if (currentGame.value == 'bodyposecontroller') {
         if (currentGameArea.value.length == 2) {
@@ -242,18 +245,19 @@ const getExit = () => {
  * 退出游戏
  */
 const getExitGame = (type: any) => {
-  start.value = false;
   if (type == 1) {
     currentGameArea.value.forEach((item: any) => {
       terminateBodypose(item);
     })
     currentGame.value = "";
+    start.value = false;
   } else {
     proxy?.$modal.confirm("确定退出吗?").then(() => {
       currentGameArea.value.forEach((item: any) => {
         terminateBodypose(item);
       })
       currentGame.value = "";
+      start.value = false;
     }).finally(() => {
     });
   }