fix:大乱斗结算页面结构样式完成

This commit is contained in:
2026-05-09 13:57:36 +08:00
parent d8a94c8ff6
commit 6e62ec4348
13 changed files with 1095 additions and 10 deletions

View File

@@ -39,6 +39,9 @@
{ {
"path": "pages/battle-result" "path": "pages/battle-result"
}, },
{
"path": "pages/friend-battle-result"
},
{ {
"path": "pages/point-book-edit" "path": "pages/point-book-edit"
}, },

File diff suppressed because it is too large Load Diff

View File

@@ -38,10 +38,14 @@ const showRoundTip = ref(false);
const isFinalShoot = ref(false); const isFinalShoot = ref(false);
const matchStatus = ref(undefined); const matchStatus = ref(undefined);
const updateRemainSecond = ref(0); const updateRemainSecond = ref(0);
/** 对战来源类型1=好友约战2=匹配对战),用于结算页分流 */
const battleWay = ref(0);
const recoverData = (battleInfo, {force = false, arrowOnly = false} = {}) => { const recoverData = (battleInfo, {force = false, arrowOnly = false} = {}) => {
try { try {
battleId.value = battleInfo.matchId; battleId.value = battleInfo.matchId;
// 存储对战来源,供结算跳转分流使用
if (battleInfo.way !== undefined) battleWay.value = battleInfo.way;
// 优先使用接口返回的队伍数据,如果没有则尝试从缓存读取(应对匹配刚完成接口未就绪的情况) // 优先使用接口返回的队伍数据,如果没有则尝试从缓存读取(应对匹配刚完成接口未就绪的情况)
const t1 = battleInfo.teams?.[1] || {}; const t1 = battleInfo.teams?.[1] || {};
@@ -118,15 +122,24 @@ function onAudioEnded(s) {
uni.$emit("update-remain", {stop: false, value: updateRemainSecond.value, team: team}); uni.$emit("update-remain", {stop: false, value: updateRemainSecond.value, team: team});
} }
if (s.indexOf("比赛结束") >= 0) { if (s.indexOf("比赛结束") >= 0) {
console.log("比赛结束");
onBattleEnd() onBattleEnd()
} }
} }
function onBattleEnd() { function onBattleEnd() {
if (matchStatus.value === 2) { if (matchStatus.value === 2) {
uni.redirectTo({ // 好友约战way===1跳转专属结算页其他模式保持跳转旧结算页
url: `/pages/battle-result?battleId=${battleId.value}`, // 后期如需新增更多模式的专属页面,在此扩展 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}`,
});
}
} }
} }
@@ -202,13 +215,17 @@ onShow(async () => {
const result = await getBattleAPI(battleId.value); const result = await getBattleAPI(battleId.value);
if (!result) return; if (!result) return;
if (result.status === 2) { if (result.status === 2) {
uni.showToast({ // 比赛已结束(如切后台再回来):跳结算页,按 way 分流
title: "比赛已结束", // 与 onBattleEnd 保持一致,避免返回首页
icon: "none", if (result.way === 1) {
}); uni.redirectTo({
uni.navigateBack({ url: `/pages/friend-battle-result?battleId=${result.matchId}`,
delta: 2, });
}); } else {
uni.redirectTo({
url: `/pages/battle-result?battleId=${result.matchId}`,
});
}
} else { } else {
recoverData(result, {force: true}); recoverData(result, {force: true});
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,11 @@
<svg width="156" height="58" viewBox="0 0 156 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#231;&#188;&#150;&#231;&#187;&#132; 5">
<rect id="&#231;&#159;&#169;&#229;&#189;&#162;&#229;&#164;&#135;&#228;&#187;&#189;" width="156" height="58" fill="url(#paint0_linear_1394_738459)"/>
</g>
<defs>
<linearGradient id="paint0_linear_1394_738459" x1="0" y1="87" x2="156" y2="87" gradientUnits="userSpaceOnUse">
<stop stop-color="#7E3627"/>
<stop offset="1" stop-color="#292826" stop-opacity="0.01"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 540 B

View File

@@ -0,0 +1,11 @@
<svg width="156" height="58" viewBox="0 0 156 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#231;&#188;&#150;&#231;&#187;&#132; 12">
<rect id="&#231;&#159;&#169;&#229;&#189;&#162;&#229;&#164;&#135;&#228;&#187;&#189;" width="156" height="58" fill="url(#paint0_linear_1394_738487)"/>
</g>
<defs>
<linearGradient id="paint0_linear_1394_738487" x1="0" y1="87" x2="156" y2="87" gradientUnits="userSpaceOnUse">
<stop stop-color="#573E25"/>
<stop offset="1" stop-color="#292826" stop-opacity="0.01"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 541 B

View File

@@ -0,0 +1,11 @@
<svg width="156" height="58" viewBox="0 0 156 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#231;&#188;&#150;&#231;&#187;&#132; 9">
<rect id="&#231;&#159;&#169;&#229;&#189;&#162;&#229;&#164;&#135;&#228;&#187;&#189;" width="156" height="58" fill="url(#paint0_linear_1394_738473)"/>
</g>
<defs>
<linearGradient id="paint0_linear_1394_738473" x1="0.251953" y1="86.9532" x2="156" y2="86.9532" gradientUnits="userSpaceOnUse">
<stop stop-color="#25476F"/>
<stop offset="1" stop-color="#292826" stop-opacity="0.01"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
src/static/mvp-blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
src/static/mvp-red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
src/static/mvp-tip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB