细节完善

This commit is contained in:
kron
2025-08-15 11:23:23 +08:00
parent 2a9a373743
commit b46bc7aaa5
9 changed files with 121 additions and 80 deletions

View File

@@ -21,12 +21,10 @@ function exit() {
}
onLoad(async (options) => {
// const myId = user.value.id;
const myId = 39;
const myId = user.value.id;
if (options.battleId) {
const result = await getGameAPI(
options.battleId || "BATTLE-1754302650041171466-546"
// options.battleId || "BATTLE-1754017978280570919-571"
options.battleId || "BATTLE-1755156795334880000-865"
);
data.value = {
...result,
@@ -58,12 +56,17 @@ onLoad(async (options) => {
} else {
const battleInfo = uni.getStorageSync("last-battle");
if (!battleInfo) return;
data.value = battleInfo;
data.value = {
mvps: [],
...battleInfo,
};
if (battleInfo.mode === 1) {
battleInfo.playerStats.forEach((p) => {
if (p.team === 1) data.value.bluePlayers = [p];
if (p.team === 0) data.value.redPlayers = [p];
if (p.mvp) data.value.mvps.push(p);
});
data.value.mvps.sort((a, b) => b.totalRings - a.totalRings);
}
rank.value = 0;
const mine = battleInfo.playerStats.find((p, index) => {
@@ -90,7 +93,7 @@ const checkBowData = () => {
<block v-if="data.mode === 1">
<view class="header-team" :style="{ marginTop: '25%' }">
<image src="../static/battle-result.png" mode="widthFix" />
<!-- <view class="header-solo">
<view class="header-solo" v-if="data.teamSize === 2">
<text
:style="{
background:
@@ -110,47 +113,38 @@ const checkBowData = () => {
:borderColor="data.winner === 1 ? '#5FADFF' : '#FF5656'"
mode="widthFix"
/>
</view> -->
</view>
</view>
<view class="header-mvp">
<image src="../static/red-team-win.png" mode="widthFix" />
<view class="header-mvp" v-if="data.teamSize !== 2">
<image
:src="`../static/${data.winner === 1 ? 'blue' : 'red'}-team-win.png`"
mode="widthFix"
/>
<view>
<view>
<view v-if="data.mvps && data.mvps[0].totalRings">
<image src="../static/title-mvp.png" mode="widthFix" />
<text
>斩获<text
:style="{ color: '#fed847', fontSize: '18px', margin: '0 2px' }"
>60</text
>{{ data.mvps[0].totalRings }}</text
></text
>
</view>
<view>
<view>
<view v-if="data.mvps && data.mvps.length">
<view v-for="(player, index) in data.mvps" :key="index">
<view class="team-avatar">
<Avatar
:src="user.avatar"
:src="player.avatar"
:size="40"
:borderColor="data.myTeam === 1 ? '#5fadff' : '#ff6060'"
/>
<text :style="{ backgroundColor: '#ff6060' }">自己</text>
<text
v-if="player.id === user.id"
:style="{ backgroundColor: '#ff6060' }"
>自己</text
>
</view>
<text>某某某</text>
</view>
<view>
<Avatar
:src="user.avatar"
:size="40"
:borderColor="data.myTeam === 1 ? '#5fadff' : '#ff6060'"
/>
<text>某某某</text>
</view>
<view>
<Avatar
:src="user.avatar"
:size="40"
:borderColor="data.myTeam === 1 ? '#5fadff' : '#ff6060'"
/>
<text>某某某</text>
<text>{{ player.name }}</text>
</view>
</view>
</view>
@@ -513,7 +507,7 @@ const checkBowData = () => {
.header-mvp > view > view:first-child > text {
color: #fff;
font-size: 14px;
transform: translateY(-4px) skewY(-6deg);
transform: translateY(-4px) skewY(-6deg);
}
.header-mvp > view > view:last-child {
display: flex;
@@ -522,6 +516,7 @@ const checkBowData = () => {
font-size: 8px;
text-align: center;
transform: translateY(-16px) skewY(-6deg);
min-width: 40%;
}
.header-mvp > view > view:last-child > view {
margin-right: 4vw;