pref: 匹配成功展示准备页面

This commit is contained in:
2026-05-06 14:20:06 +08:00
parent e1a9d97596
commit 473e6df77b
3 changed files with 93 additions and 62 deletions

View File

@@ -9,7 +9,6 @@ import { MESSAGETYPESV2 } from "@/constants";
const gameType = ref(0);
const teamSize = ref(0);
const onComplete = ref(null);
const matchSuccess = ref(false);
async function stopMatch() {
uni.$showHint(3);
@@ -24,18 +23,18 @@ async function cancelMatch() {
async function onReceiveMessage(msg) {
if (msg.type === MESSAGETYPESV2.MatchSuccess) {
matchSuccess.value = true;
onComplete.value = () => {
if (gameType.value == 1) {
uni.redirectTo({
url: `/pages/team-battle?battleId=${msg.id}&gameMode=2`,
});
} else if (gameType.value == 2) {
uni.redirectTo({
url: `/pages/melee-battle?battleId=${msg.id}&gameMode=2`,
});
}
};
onComplete.value = () => {}
}
if (msg.type === MESSAGETYPESV2.AboutToStart) {
if (gameType.value == 1) {
uni.redirectTo({
url: `/pages/team-battle?battleId=${msg.id}&gameMode=2`,
});
} else if (gameType.value == 2) {
uni.redirectTo({
url: `/pages/melee-battle?battleId=${msg.id}&gameMode=2`,
});
}
}
}