排行榜数据显示

This commit is contained in:
kron
2025-06-27 10:50:09 +08:00
parent a229b18b31
commit 9f29a92d3d
3 changed files with 25 additions and 14 deletions

View File

@@ -4,7 +4,7 @@ import Avatar from "@/components/Avatar.vue";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
const { user, config } = storeToRefs(store);
const { user, config, rankData } = storeToRefs(store);
const props = defineProps({
showRank: {
type: Boolean,
@@ -89,13 +89,18 @@ watch(
src="../static/global-rank.png"
mode="widthFix"
/>
<text>本赛季</text>
<text>暂未上榜</text>
<!-- <text class="rank-number"
><text :style="{ color: '#ffd700' }"
>{{ user.points }}/{{ user.rankLvl }}</text
></text
> -->
<block v-if="user.ranking > 0 && rankData.rank.length">
<text>本赛季全国</text>
<text class="rank-number"
><text :style="{ color: '#ffd700' }"
>{{ user.ranking }}/{{ rankData.rank.length }}</text
></text
>
</block>
<block v-else>
<text>本赛季</text>
<text>暂未上榜</text>
</block>
</view>
</block>
<block v-else>