数据展示优化

This commit is contained in:
kron
2025-06-18 02:02:09 +08:00
parent 970040c7b4
commit a782e141ab
6 changed files with 48 additions and 18 deletions

View File

@@ -13,6 +13,14 @@ defineProps({
type: Array,
default: () => [],
},
showRank: {
type: Boolean,
default: false,
},
winner: {
type: Number,
default: 1,
},
});
const bgColors = ["#364469", "#692735", "#934B4B", "#A98B69", "#8268A2 "];
</script>
@@ -29,7 +37,11 @@ const bgColors = ["#364469", "#692735", "#934B4B", "#A98B69", "#8268A2 "];
:key="index"
:style="{ backgroundColor: bgColors[index] }"
>
<Avatar :src="player.avatar" :size="40" />
<Avatar
:src="player.avatar"
:size="40"
:rank="showRank ? index + 1 : 0"
/>
<text class="player-name">{{ player.name }}</text>
</view>
</view>
@@ -38,7 +50,7 @@ const bgColors = ["#364469", "#692735", "#934B4B", "#A98B69", "#8268A2 "];
<Avatar :src="blueTeam[0].avatar" frame />
<text class="player-name">{{ blueTeam[0].name }}</text>
<image
v-if="blueTeam[0].winner"
v-if="winner === 1"
src="../static/winner-badge.png"
mode="widthFix"
/>
@@ -47,7 +59,7 @@ const bgColors = ["#364469", "#692735", "#934B4B", "#A98B69", "#8268A2 "];
<Avatar v-if="redTeam[0]" :src="redTeam[0].avatar" frame />
<text class="player-name">{{ redTeam[0].name }}</text>
<image
v-if="redTeam[0].winner"
v-if="winner === 0"
src="../static/winner-badge.png"
mode="widthFix"
/>

View File

@@ -76,7 +76,7 @@ watch(
class="score-item"
:style="{ width: '13vw', height: '13vw' }"
>
{{ score.ringScore }}
{{ score.ring }}
</view>
</view>
</view>

View File

@@ -115,7 +115,7 @@ watch(
class="score-item"
:style="{ width: '13vw', height: '13vw' }"
>
{{ score.ringScore }}
{{ score.ring }}
</view>
</view>
</view>