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

@@ -223,16 +223,24 @@ function closeOverlay() {
}
/**
* 返回对应的战斗房间
* 若有 roomId 则跳转到房间页,否则返回上一页
* 底部按钮文案:好友约战显示“返回房间”,排位赛等其他模式显示“返回”
*/
const exitBtnText = computed(() => data.value.way === 1 ? '返回房间' : '返回');
/**
* 点击底部按钮跳转
* - 好友约战way=1返回对战房间
* - 其他模式(排位赛等):跳转到排位赛首页
*/
function exit() {
if (data.value.roomId) {
if (data.value.way === 1) {
uni.redirectTo({
url: `/pages/battle-room?roomNumber=${data.value.roomId}`,
});
} else {
uni.navigateBack();
uni.redirectTo({
url: '/pages/ranking',
});
}
}
@@ -428,7 +436,7 @@ function goBack() {
<view
:class="['btn-return', data.mode > 3 ? 'btn-return-melee' : 'btn-return-battle']"
@click="exit"
>返回房间</view>
>{{ exitBtnText }}</view>
</view>
<!-- ===== 进场覆盖动效层初始显示点击或2.5s后消失===== -->