pref: 匹配成功展示准备页面
This commit is contained in:
@@ -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`,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user