This commit is contained in:
kron
2025-07-05 16:50:54 +08:00
parent 1c70471959
commit c269a4b431
2 changed files with 26 additions and 30 deletions

View File

@@ -18,8 +18,8 @@ const totalPoints = ref(0);
onLoad(async (options) => { onLoad(async (options) => {
battleId.value = options.battleId; battleId.value = options.battleId;
const result = await getGameAPI( const result = await getGameAPI(
options.battleId || "BATTLE-1750867490990424058-718" // options.battleId || "BATTLE-1750867490990424058-718"
// options.battleId || "BATTLE-1750688536849458226-518" options.battleId || "BATTLE-1750688536849458226-518"
); );
data.value = result; data.value = result;
if (result.mode === 1 && result.redPlayers[user.value.id]) { if (result.mode === 1 && result.redPlayers[user.value.id]) {
@@ -81,7 +81,12 @@ const checkBowData = () => {
<image src="../static/battle-result.png" mode="widthFix" /> <image src="../static/battle-result.png" mode="widthFix" />
<view /> <view />
</view> </view>
<view class="players"> <view
class="players"
:style="{
height: `${Math.max(data.players.length > 5 ? '330' : '300')}px`,
}"
>
<view <view
v-for="(player, index) in data.players" v-for="(player, index) in data.players"
:key="index" :key="index"
@@ -280,13 +285,11 @@ const checkBowData = () => {
margin: 0 20px; margin: 0 20px;
} }
.players { .players {
color: #fff6; flex-wrap: wrap;
display: flex; display: flex;
flex-direction: column; overflow: auto;
align-items: center;
justify-content: center;
width: calc(100% - 60px); width: calc(100% - 60px);
height: 300px; color: #fff6;
margin: 0 30px; margin: 0 30px;
} }
.players > view { .players > view {

View File

@@ -5,6 +5,7 @@ import Avatar from "@/components/Avatar.vue";
import BowData from "@/components/BowData.vue"; import BowData from "@/components/BowData.vue";
import ScrollList from "@/components/ScrollList.vue"; import ScrollList from "@/components/ScrollList.vue";
import { getBattleListAPI, getPractiseResultListAPI } from "@/apis"; import { getBattleListAPI, getPractiseResultListAPI } from "@/apis";
import { meleeAvatarColors } from "@/constants";
import { ref } from "vue"; import { ref } from "vue";
@@ -105,11 +106,15 @@ const onPractiseLoading = async (page) => {
</view> </view>
</block> </block>
</view> </view>
<view v-if="item.mode === 2" class="contest-multi"> <view v-if="item.mode === 2" class="contest-melee">
<view <view
class="player" class="player"
v-for="(p, index2) in item.players" v-for="(p, index2) in item.players"
:key="index2" :key="index2"
:style="{
width: `${Math.max(100 / item.players.length, 18)}vw`,
backgroundColor: meleeAvatarColors[index2],
}"
> >
<Avatar :rank="index2 + 1" :src="p.avatar" /> <Avatar :rank="index2 + 1" :src="p.avatar" />
<text>{{ p.name }}</text> <text>{{ p.name }}</text>
@@ -143,11 +148,15 @@ const onPractiseLoading = async (page) => {
/> />
</view> </view>
</view> </view>
<view v-if="item.mode === 2" class="contest-multi"> <view v-if="item.mode === 2" class="contest-melee">
<view <view
class="player" class="player"
v-for="(p, index2) in item.players" v-for="(p, index2) in item.players"
:key="index2" :key="index2"
:style="{
width: `${Math.max(100 / item.players.length, 18)}vw`,
backgroundColor: meleeAvatarColors[index2],
}"
> >
<Avatar :rank="index2 + 1" :src="p.avatar" /> <Avatar :rank="index2 + 1" :src="p.avatar" />
<text>{{ p.name }}</text> <text>{{ p.name }}</text>
@@ -238,6 +247,7 @@ const onPractiseLoading = async (page) => {
padding-top: 10px; padding-top: 10px;
padding-bottom: 5px; padding-bottom: 5px;
position: relative; position: relative;
flex: 0 0 auto;
} }
.player > text { .player > text {
margin-top: 5px; margin-top: 5px;
@@ -255,10 +265,11 @@ const onPractiseLoading = async (page) => {
bottom: 0; bottom: 0;
} }
.contest-team, .contest-team,
.contest-multi { .contest-melee {
width: 100%;
display: flex; display: flex;
justify-content: space-around;
margin-bottom: 10px; margin-bottom: 10px;
overflow-x: auto;
} }
.contest-team > view { .contest-team > view {
width: 50%; width: 50%;
@@ -269,24 +280,6 @@ const onPractiseLoading = async (page) => {
.contest-team > view:last-child { .contest-team > view:last-child {
background-color: #692735; background-color: #692735;
} }
.contest-multi > view {
width: 20%;
}
.contest-multi > view:nth-child(1) {
background-color: #364469;
}
.contest-multi > view:nth-child(2) {
background-color: #692735;
}
.contest-multi > view:nth-child(3) {
background-color: #934b4b;
}
.contest-multi > view:nth-child(4) {
background-color: #a98b69;
}
.contest-multi > view:nth-child(5) {
background-color: #8268a2;
}
.practice-record { .practice-record {
color: #fff9; color: #fff9;
border-bottom: 1px solid #fff9; border-bottom: 1px solid #fff9;