瀏覽代碼

日常开发

林旭祥 2 周之前
父節點
當前提交
5fa1f45ed5
共有 2 個文件被更改,包括 13 次插入12 次删除
  1. 9 9
      src/views/game/components/basketball.vue
  2. 4 3
      src/views/game/index.vue

+ 9 - 9
src/views/game/components/basketball.vue

@@ -862,15 +862,15 @@ const draw = () => {
 
     // 保留点击退出的功能
     if (gameState.click) {
-      clearTimeout(gameState.exitTimer);
-      gameState.gameOver = false;
-      gameState.started = false;
-      gameState.score = 0;
-      gameState.time = 60;
-      gameState.balls = [];
-      gameState.state = 'menu';
-      gameState.click = false;
-      gameState.exitTimer = null;
+      // clearTimeout(gameState.exitTimer);
+      // gameState.gameOver = false;
+      // gameState.started = false;
+      // gameState.score = 0;
+      // gameState.time = 60;
+      // gameState.balls = [];
+      // gameState.state = 'menu';
+      // gameState.click = false;
+      // gameState.exitTimer = null;
     }
   }
 };

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

@@ -127,6 +127,7 @@ const { projectList, wsState, bodyposeState, deviceInfo, currentGame, currentGam
 watch(
   () => areaStateList.value,
   (newData, oldData) => {
+    console.log("areaStateList.value", areaStateList.value)
     //如果当前都是结束了就再重新弹窗
     let state = newData.every((item: any) => {
       return item.gameover;
@@ -322,9 +323,6 @@ const getStartGame = (data: any) => {
  * 继续游戏
  */
 const getResumeGame = () => {
-  areaStateList.value.forEach((item: any, index: number) => {
-    areaStateList.value[index].gameover = false;
-  })
   resumeGame.value = false;
 
   timerNum.value = 5;
@@ -333,6 +331,9 @@ const getResumeGame = () => {
     timerNum.value--;
     speckText(timerNum.value);
     if (timerNum.value == 0) {
+      areaStateList.value.forEach((item: any, index: number) => {
+        areaStateList.value[index].gameover = false;
+      })
       clearInterval(timer.value);
       timer.value = null;
       if (currentGame.value == 'game_basketball') {