fix:大乱斗结算页面结构样式完成
@@ -39,6 +39,9 @@
|
||||
{
|
||||
"path": "pages/battle-result"
|
||||
},
|
||||
{
|
||||
"path": "pages/friend-battle-result"
|
||||
},
|
||||
{
|
||||
"path": "pages/point-book-edit"
|
||||
},
|
||||
|
||||
1032
src/pages/friend-battle-result.vue
Normal file
@@ -38,10 +38,14 @@ const showRoundTip = ref(false);
|
||||
const isFinalShoot = ref(false);
|
||||
const matchStatus = ref(undefined);
|
||||
const updateRemainSecond = ref(0);
|
||||
/** 对战来源类型(1=好友约战,2=匹配对战),用于结算页分流 */
|
||||
const battleWay = ref(0);
|
||||
|
||||
const recoverData = (battleInfo, {force = false, arrowOnly = false} = {}) => {
|
||||
try {
|
||||
battleId.value = battleInfo.matchId;
|
||||
// 存储对战来源,供结算跳转分流使用
|
||||
if (battleInfo.way !== undefined) battleWay.value = battleInfo.way;
|
||||
|
||||
// 优先使用接口返回的队伍数据,如果没有则尝试从缓存读取(应对匹配刚完成接口未就绪的情况)
|
||||
const t1 = battleInfo.teams?.[1] || {};
|
||||
@@ -118,15 +122,24 @@ function onAudioEnded(s) {
|
||||
uni.$emit("update-remain", {stop: false, value: updateRemainSecond.value, team: team});
|
||||
}
|
||||
if (s.indexOf("比赛结束") >= 0) {
|
||||
console.log("比赛结束");
|
||||
onBattleEnd()
|
||||
}
|
||||
}
|
||||
|
||||
function onBattleEnd() {
|
||||
if (matchStatus.value === 2) {
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${battleId.value}`,
|
||||
});
|
||||
// 好友约战(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}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,13 +215,17 @@ onShow(async () => {
|
||||
const result = await getBattleAPI(battleId.value);
|
||||
if (!result) return;
|
||||
if (result.status === 2) {
|
||||
uni.showToast({
|
||||
title: "比赛已结束",
|
||||
icon: "none",
|
||||
});
|
||||
uni.navigateBack({
|
||||
delta: 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}`,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
recoverData(result, {force: true});
|
||||
}
|
||||
|
||||
BIN
src/static/friend-battle-result/game-lose.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
src/static/friend-battle-result/game-over.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
src/static/friend-battle-result/game-win.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
11
src/static/friend-battle-result/rank-one.svg
Normal 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="编组 5">
|
||||
<rect id="矩形备份" 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 |
11
src/static/friend-battle-result/rank-three.svg
Normal 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="编组 12">
|
||||
<rect id="矩形备份" 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 |
11
src/static/friend-battle-result/rank-two.svg
Normal 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="编组 9">
|
||||
<rect id="矩形备份" 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 |
BIN
src/static/friend-battle-result/vs-bg.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
src/static/mvp-blue.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src/static/mvp-red.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/static/mvp-tip.png
Normal file
|
After Width: | Height: | Size: 11 KiB |