From 45cb785ba41d2f8ce9c616c27657ea8303a26012 Mon Sep 17 00:00:00 2001 From: chenlimao Date: Sat, 9 May 2026 15:23:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=A4=A7=E4=B9=B1=E6=96=97?= =?UTF-8?q?=E6=AF=94=E8=B5=9B=E9=A1=B5=E9=9D=A2=E7=BB=93=E6=9D=9F=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E6=96=B0=E7=BB=93=E7=AE=97=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/friend-battle-result.vue | 59 ++++++++++++++++-------------- src/pages/melee-battle.vue | 17 +++++++-- 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/pages/friend-battle-result.vue b/src/pages/friend-battle-result.vue index ba27555..cf24129 100644 --- a/src/pages/friend-battle-result.vue +++ b/src/pages/friend-battle-result.vue @@ -165,16 +165,10 @@ function getMeleeAvatarBorderColor(rank) { // ---- 生命周期 ---- onLoad(async (options) => { - // TODO: 调试用固定 battleId,联调完成后删除 fallback - const battleId = options.battleId || "92368717727535104"; - if (!battleId) return; + if (!options.battleId) return; - const result = await getBattleAPI(battleId); + const result = await getBattleAPI(options.battleId); data.value = result; - // DEBUG: 打印接口原始数据,联调完成后删除 - console.log("[friend-battle-result] raw result:", JSON.stringify(result)); - console.log("[friend-battle-result] mode:", result.mode, "resultList:", result.resultList, "teams keys:", result.teams ? Object.keys(result.teams) : null); - console.log("[friend-battle-result] current user.id:", user.value.id, "type:", typeof user.value.id); // 判断当前用户是否在胜利队伍中 // 优先使用接口返回的 winTeam 字段;若缺失则以队伍得分高低作为兜底判断 @@ -361,9 +355,9 @@ function goBack() { {{ item.totalRing }} - + @@ -737,8 +731,9 @@ function goBack() { .exp-gained { display: block; text-align: center; - color: #FFD700; - font-size: 24rpx; + color: #FAE6BC; + font-size: 20rpx; + font-weight: 400; margin-bottom: 12rpx; } @@ -757,17 +752,19 @@ function goBack() { .exp-bar-bg { flex: 1; - height: 16rpx; - background: rgba(255, 255, 255, 0.15); - border-radius: 8rpx; + height: 10rpx; + background: #454545; + border-radius: 5rpx; overflow: hidden; } .exp-bar-fg { height: 100%; - background: linear-gradient(90deg, #FF8C00 0%, #FFD200 100%); - border-radius: 8rpx; + background: linear-gradient(90deg, #DD7B13 0%, #DD7B13 75%, rgba(244, 255, 176, 0.84) 100%); + border-radius: 5rpx; transition: width 0.8s ease-out; + /* 发光效果:近似 rgba(244,255,176,0.84) + blur 7.7px 叠加层 */ + box-shadow: 0 0 14rpx rgba(244, 255, 176, 0.84); } .exp-progress { @@ -936,22 +933,25 @@ function goBack() { display: flex; align-items: center; height: 116rpx; - box-sizing: border-box; background: rgba(35, 33, 30, 0.85); - /* 透明边框占位,避免 isSelf 时撑开布局 */ - border: 2rpx solid transparent; /* 相对定位,使背景装饰图可绝对定位于行内 */ position: relative; overflow: hidden; } -/* 当前用户所在行:红色边框高亮 */ +/* 当前用户所在行:内嵌阴影高亮,不影响尺寸与相邻条目间距 */ .rank-item-self { - border-color: #ff4d4d; + box-shadow: inset 0 0 0 2rpx #ff4d4d; +} + +/* 斑马色块侸数行(rank 1/3/5...):白色 5% 透明底 */ +.rank-item-light { + background: rgba(255, 255, 255, 0.05); } /* 前三名行背景装饰图(SVG 设计尺寸 156×58@2x = 312×116rpx,左对齐绝对定位)*/ .rank-bg-deco { + display: block; /* 消除 image 默认 inline-block 行高撑开导致的条目间缝隙 */ position: absolute; left: 0; top: 0; @@ -1033,19 +1033,22 @@ function goBack() { /* 总环数(靠右对齐,与用户信息区对比)*/ .rank-score { display: flex; - align-items: baseline; - gap: 2rpx; + align-items: center; + gap: 8rpx; flex-shrink: 0; } .rank-score-num { - font-size: 36rpx; - font-weight: 700; + font-size: 26rpx; + font-weight: 400; color: #ffffff; + line-height: 1; } .rank-score-unit { font-size: 22rpx; - color: rgba(255, 255, 255, 0.65); + font-weight: 400; + color: rgba(255, 255, 255, 0.5); + line-height: 1; } diff --git a/src/pages/melee-battle.vue b/src/pages/melee-battle.vue index 4364aec..fa7a5b9 100644 --- a/src/pages/melee-battle.vue +++ b/src/pages/melee-battle.vue @@ -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); } }