Skip to content

Commit

Permalink
修复一些错误
Browse files Browse the repository at this point in the history
  • Loading branch information
cunoe committed May 14, 2024
1 parent 0ec1386 commit e6d941c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion components/player/EnemyCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ function getClan(){
<div class="absolute right-4 top-4 leading-loose text-end hover-scale">
<div class="text-white font-bold text-xl join"><p>{{ playerInfo.name }}</p><p :style="{color: getClanColorFromUtil(battleData.clan_type)}">{{getClan()}}</p></div>
<div class="flex flex-row gap-1 justify-end">
<div class="badge font-bold" :style="{backgroundColor: getBLTColorFromUtil(battleData.user_profile.blt)}">场次 {{battleData.ship_profile.blt}}</div>
<div class="badge font-bold" :style="{backgroundColor: getPRColorFromUtil(battleData.user_profile.pr)}">评分 {{battleData.user_profile.pr}}</div>
<div class="badge font-bold" :style="{backgroundColor: getWRColorFromUtil(battleData.user_profile.wr)}">胜率 {{battleData.user_profile.wr.toFixed()}}%</div>
</div>
<div class="flex flex-row gap-1 justify-end">
<div class="badge font-bold" :style="{backgroundColor: getFRColorFromUtil(battleData.user_profile.fr)}">击杀 {{battleData.ship_profile.fr}}</div>
<div class="badge font-bold" :style="{backgroundColor: getExpColorFromUtil(battleData.user_profile.exp)}">经验 {{battleData.user_profile.exp}}</div>
<div class="badge font-bold" :style="{backgroundColor: getDMGColorFromUtil(battleData.user_profile.dmg, '')}">伤害 {{battleData.user_profile.dmg}}</div>
</div>
</div>
</a>
<a @click="modal.open(PlayerShipInfoModal, {player: playerInfo, playerServer: server, battleData: battleData})" class="text-white/50 cursor-pointer font-bold">
<div class="absolute inset-y-0 left-0 bg-[#7678ed] rounded-lg shadow-lg p-12 w-[26rem] hover-scale">
<div class="absolute inset-y-0 left-0 bg-[#7678ed] rounded-lg shadow-lg p-12 w-[22rem] hover-scale">
<div class="absolute left-4 top-4 text-start">
<h2 class="text-white font-bold text-xl">{{playerInfo.shipInfo ? numberToRoman(playerInfo.shipInfo.tier)+' '+playerInfo.shipInfo.ship_name.zh_sg : '不认识这艘船捏'}}</h2>
<div class="flex flex-row gap-1">
Expand Down
6 changes: 4 additions & 2 deletions components/player/PlayerHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const props = defineProps<{
const toast = useToast()
const info = ref('正在解析数据,请稍后')
const gameInfo = ref<GameData>(null as unknown as GameData)
const teammates = ref<Vehicle[]>([])
const enemies = ref<Vehicle[]>([])
Expand Down Expand Up @@ -144,6 +145,7 @@ onMounted(async () => {
toast.add({
title: "获取数据失败:" + err.message,
})
info.value = '获取数据失败:' + err.message
console.log(err)
})
}
Expand All @@ -165,7 +167,7 @@ onMounted(async () => {
class="w-3/5 rounded-lg shadow-sm p-5 border-dashed border border-blue-500 flex flex-col sm:flex-row justify-center items-center gap-2 sm:gap-0 text-center">
<div class="flex flex-col sm:flex-row justify-center items-center gap-4">
<div class="text-center">
<div class="stat-value text-3xl">正在解析数据,请稍后</div>
<div class="stat-value text-3xl">{{info}}</div>
<span class="loading loading-infinity loading-lg"></span>
</div>
</div>
Expand All @@ -188,7 +190,7 @@ onMounted(async () => {
</div>
</div>
</div>
<GameStats :duration="duration" :gameData="gameInfo" :player="player" />
<GameStats :duration="duration" :gameData="gameInfo" :player="player" :battle-data="battleDataResp" />
<div class="flex justify-center">
<div class="stats container">
<div class="stat text-center">
Expand Down
2 changes: 1 addition & 1 deletion components/player/PlayerInfoModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function getFRColorFromUtil(fr: number) {
</div>
</div>
<div v-if="isReady">
<div class="flex flex-row bg-fuchsia-600 text-white text-xl rounded-lg font-bold text-center justify-center items-center">
<div class="flex flex-row text-white text-xl rounded-lg font-bold text-center justify-center items-center" :style="{backgroundColor: getPRColorFromUtil(playerData.data.bt.pvp_solo.pr)}">
{{getPersonalRateData(playerData.data.pr.pr).name}} {{playerData.data.pr.pr}}
</div>
<div class="p-1"></div>
Expand Down
4 changes: 2 additions & 2 deletions components/player/PlayerShipInfoModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ function getFRColorFromUtil(fr: number) {
</div>
</div>
<div v-if="isReady">
<div class="flex flex-row bg-fuchsia-600 text-white text-xl rounded-lg font-bold text-center justify-center items-center">
<!-- {{getPersonalRateData(shipData.data.pr.pr).name}} {{shipData.data.pr.pr}}-->
<div class="flex flex-row text-white text-xl rounded-lg font-bold text-center justify-center items-center" :style="{backgroundColor: getPRColorFromUtil(shipData.data.pr.pr)}">
{{getPersonalRateData(shipData.data.pr.pr).name}} {{shipData.data.pr.pr}}
</div>
<div class="p-1"></div>
<div class="flex justify-center">
Expand Down
4 changes: 3 additions & 1 deletion components/player/TeammateCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ function getClanColorFromUtil(clanType: number) {
<div class="flex flex-row gap-1">
<div class="badge font-bold" :style="{backgroundColor: getWRColorFromUtil(battleData.user_profile.wr)}">胜率 {{battleData.user_profile.wr.toFixed()}}%</div>
<div class="badge font-bold" :style="{backgroundColor: getPRColorFromUtil(battleData.user_profile.pr)}">评分 {{battleData.user_profile.pr}}</div>
<div class="badge font-bold" :style="{backgroundColor: getBLTColorFromUtil(battleData.user_profile.blt)}">场次 {{battleData.ship_profile.blt}}</div>
</div>
<div class="flex flex-row gap-1">
<div class="badge font-bold" :style="{backgroundColor: getDMGColorFromUtil(battleData.user_profile.dmg, '')}">伤害 {{battleData.user_profile.dmg}}</div>
<div class="badge font-bold" :style="{backgroundColor: getExpColorFromUtil(battleData.user_profile.exp)}">经验 {{battleData.user_profile.exp}}</div>
<div class="badge font-bold" :style="{backgroundColor: getFRColorFromUtil(battleData.user_profile.fr)}">击杀 {{battleData.ship_profile.fr}}</div>
</div>
</div>
</a>
<a @click="modal.open(PlayerShipInfoModal, {player: playerInfo, playerServer: server, battleData: battleData})" class="text-white/50 cursor-pointer font-bold">
<div class="absolute inset-y-0 right-0 bg-[#7678ed] rounded-lg shadow-lg p-12 w-[26rem] hover-scale">
<div class="absolute inset-y-0 right-0 bg-[#7678ed] rounded-lg shadow-lg p-12 w-[22rem] hover-scale">
<div class="absolute right-4 top-4 text-end">
<h2 class="text-white font-bold text-xl">{{playerInfo.shipInfo ? playerInfo.shipInfo.ship_name.zh_sg+' '+numberToRoman(playerInfo.shipInfo.tier) : '不认识这艘船捏'}}</h2>
<div class="flex flex-row gap-1 justify-end">
Expand Down
4 changes: 2 additions & 2 deletions utils/get.clan.color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default function getClanColor(clanType: number): string {
switch (clanType){
case 0: return RatingColor['SuperUnicum']
case 1: return RatingColor['Good']
case 2: return RatingColor['Average']
case 4: return RatingColor['BelowAverage']
case 2: return '#D4AF37'
case 4: return '#B58735'
default: return '#C0C0C0'
}
}

0 comments on commit e6d941c

Please sign in to comment.