fix:大乱斗比赛页面结束跳转到新结算页面
This commit is contained in:
@@ -20,6 +20,8 @@ const { user } = storeToRefs(store);
|
||||
const title = ref("");
|
||||
const start = ref(null);
|
||||
const battleId = ref("");
|
||||
/** 对战模式:1=好友约战 2=排位赛,用于结算页跳转判断 */
|
||||
const way = ref(0);
|
||||
const currentRound = ref(1);
|
||||
const tips = ref("即将开始...");
|
||||
const players = ref([]);
|
||||
@@ -37,6 +39,8 @@ function recoverData(battleInfo, { force = false } = {}) {
|
||||
try {
|
||||
if (battleInfo.way === 1) title.value = "好友约战 - 大乱斗";
|
||||
if (battleInfo.way === 2) title.value = "排位赛 - 大乱斗";
|
||||
// 保存 way 供结算跳转时使用
|
||||
way.value = battleInfo.way ?? 0;
|
||||
|
||||
// 优先使用接口数据,否则使用缓存
|
||||
if (battleInfo.teams?.[0]?.players) {
|
||||
@@ -122,9 +126,16 @@ async function onReceiveMessage(msg) {
|
||||
tips.value = "准备下半场";
|
||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: "/pages/battle-result?battleId=" + msg.matchId,
|
||||
});
|
||||
// 好友约战(way=1)跳转新结算页,其余跳旧结算页
|
||||
if (way.value === 1) {
|
||||
uni.redirectTo({
|
||||
url: "/pages/friend-battle-result?battleId=" + msg.matchId,
|
||||
});
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: "/pages/battle-result?battleId=" + msg.matchId,
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user