diff --git a/src/components/BackToGame.vue b/src/components/BackToGame.vue index 1a45a97..30cb246 100644 --- a/src/components/BackToGame.vue +++ b/src/components/BackToGame.vue @@ -14,7 +14,11 @@ onShow(async () => { show.value = isGaming; }); const onClick = async () => { - const result = await getCurrentGameAPI(); + const isGaming = await isGamingAPI(); + show.value = isGaming; + if (isGaming) { + const result = await getCurrentGameAPI(); + } }; diff --git a/src/pages/battle-room.vue b/src/pages/battle-room.vue index 80687a2..118db61 100644 --- a/src/pages/battle-room.vue +++ b/src/pages/battle-room.vue @@ -140,6 +140,7 @@ onLoad(async (options) => { } if (battleInfo.fireTime > 0) { const remain = Date.now() / 1000 - battleInfo.fireTime; + console.log(`当前箭剩余${remain}秒`); if (remain > 0 && remain < 15) { // 等渲染好再通知 setTimeout(() => { @@ -165,6 +166,7 @@ onLoad(async (options) => { scores.value.length ? "下半场-" : "上半场-" }请连续射出6支箭`; const remain = Date.now() / 1000 - battleInfo.startTime; + console.log(`当前局剩余${remain}秒`); if (remain <= 90) { setTimeout(() => { uni.$emit("update-ramain", remain); diff --git a/src/pages/melee-match.vue b/src/pages/melee-match.vue index d3c9007..3dc5871 100644 --- a/src/pages/melee-match.vue +++ b/src/pages/melee-match.vue @@ -73,6 +73,7 @@ onLoad(async (options) => { scores.value.length ? "下半场-" : "上半场-" }请连续射出6支箭`; const remain = Date.now() / 1000 - battleInfo.startTime; + console.log(`当前局剩余${remain}秒`); if (remain <= 90) { setTimeout(() => { uni.$emit("update-ramain", remain); diff --git a/src/pages/team-match.vue b/src/pages/team-match.vue index 8f39815..5379a83 100644 --- a/src/pages/team-match.vue +++ b/src/pages/team-match.vue @@ -106,6 +106,7 @@ onLoad(async (options) => { } } if (battleInfo.fireTime > 0) { + console.log(`当前箭剩余${remain}秒`); const remain = Date.now() / 1000 - battleInfo.fireTime; if (remain > 0 && remain <= 15) { // 等渲染好再通知 diff --git a/src/static/battle1v1.png b/src/static/battle1v1.png index c85f7fb..6e4fa03 100644 Binary files a/src/static/battle1v1.png and b/src/static/battle1v1.png differ