This commit is contained in:
kron
2025-07-17 17:24:23 +08:00
parent cdddf57cc5
commit 84be88182a
4 changed files with 19 additions and 15 deletions

View File

@@ -35,7 +35,7 @@ onShow(() => {
data: JSON.stringify({ event: "ping", data: {} }), data: JSON.stringify({ event: "ping", data: {} }),
fail: () => { fail: () => {
// 如果发送失败,说明连接已断开,需要重新连接 // 如果发送失败,说明连接已断开,需要重新连接
websocket.createWebSocket(token, updateConnect, (content) => { websocket.createWebSocket(token, (content) => {
uni.$emit("socket-inbox", content); uni.$emit("socket-inbox", content);
}); });
}, },

View File

@@ -136,6 +136,7 @@ onLoad(async (options) => {
tips.value = `请蓝队射箭-第${roundsName[currentRound.value]}`; tips.value = `请蓝队射箭-第${roundsName[currentRound.value]}`;
} }
} }
if (battleInfo.fireTime > 0) {
const remain = Date.now() / 1000 - battleInfo.fireTime; const remain = Date.now() / 1000 - battleInfo.fireTime;
if (remain > 0 && remain < 15) { if (remain > 0 && remain < 15) {
// 等渲染好再通知 // 等渲染好再通知
@@ -143,6 +144,7 @@ onLoad(async (options) => {
uni.$emit("update-ramain", remain); uni.$emit("update-ramain", remain);
}, 300); }, 300);
} }
}
} else if (battleInfo.config.mode === 2) { } else if (battleInfo.config.mode === 2) {
tips.value = "请连续射出6支箭"; tips.value = "请连续射出6支箭";
players.value = [...battleInfo.blueTeam, ...battleInfo.redTeam]; players.value = [...battleInfo.blueTeam, ...battleInfo.redTeam];
@@ -152,7 +154,7 @@ onLoad(async (options) => {
scores.value = p.arrows; scores.value = p.arrows;
} }
}); });
if (battleInfo.startTime) { if (battleInfo.startTime > 0) {
const remain = Date.now() / 1000 - battleInfo.startTime; const remain = Date.now() / 1000 - battleInfo.startTime;
if (remain <= 90) { if (remain <= 90) {
setTimeout(() => { setTimeout(() => {

View File

@@ -67,7 +67,7 @@ onLoad(async (options) => {
scores.value = p.arrows; scores.value = p.arrows;
} }
}); });
if (battleInfo.startTime) { if (battleInfo.startTime > 0) {
const remain = Date.now() / 1000 - battleInfo.startTime; const remain = Date.now() / 1000 - battleInfo.startTime;
if (remain <= 90) { if (remain <= 90) {
setTimeout(() => { setTimeout(() => {

View File

@@ -103,6 +103,7 @@ onLoad(async (options) => {
tips.value = `请蓝队射箭-第${roundsName[currentRound.value]}`; tips.value = `请蓝队射箭-第${roundsName[currentRound.value]}`;
} }
} }
if (battleInfo.fireTime > 0) {
const remain = Date.now() / 1000 - battleInfo.fireTime; const remain = Date.now() / 1000 - battleInfo.fireTime;
if (remain > 0 && remain <= 15) { if (remain > 0 && remain <= 15) {
// 等渲染好再通知 // 等渲染好再通知
@@ -111,6 +112,7 @@ onLoad(async (options) => {
}, 300); }, 300);
} }
} }
}
} else { } else {
gameType.value = options.gameType; gameType.value = options.gameType;
teamSize.value = options.teamSize; teamSize.value = options.teamSize;