fix:全部对战页面对接新结算页面

This commit is contained in:
2026-05-09 15:51:51 +08:00
parent eaa1950a18
commit 834841a3d5
5 changed files with 25 additions and 41 deletions

View File

@@ -129,17 +129,10 @@ function onAudioEnded(s) {
function onBattleEnd() {
if (matchStatus.value === 2) {
// 好友约战way===1跳转专属结算页其他模式保持跳转旧结算页
// 后期如需新增更多模式的专属页面,在此扩展 if/else 分支即可
if (battleWay.value === 1) {
uni.redirectTo({
url: `/pages/friend-battle-result?battleId=${battleId.value}`,
});
} else {
uni.redirectTo({
url: `/pages/battle-result?battleId=${battleId.value}`,
});
}
// 全部跳转到新结算页
uni.redirectTo({
url: `/pages/friend-battle-result?battleId=${battleId.value}`,
});
}
}
@@ -215,17 +208,10 @@ onShow(async () => {
const result = await getBattleAPI(battleId.value);
if (!result) return;
if (result.status === 2) {
// 比赛已结束(如切后台再回来):跳结算页,按 way 分流
// 与 onBattleEnd 保持一致,避免返回首页
if (result.way === 1) {
uni.redirectTo({
url: `/pages/friend-battle-result?battleId=${result.matchId}`,
});
} else {
uni.redirectTo({
url: `/pages/battle-result?battleId=${result.matchId}`,
});
}
// 比赛已结束(如切后台再回来):跳结算页
uni.redirectTo({
url: `/pages/friend-battle-result?battleId=${result.matchId}`,
});
} else {
recoverData(result, {force: true});
}