完善数据

This commit is contained in:
kron
2025-07-03 11:40:03 +08:00
parent 88becbbe82
commit 23041e460b

View File

@@ -10,15 +10,20 @@ const { getLvlName } = store;
const isIos = ref(true);
const selectedIndex = ref(0);
const currentList = ref([]);
const myData = ref(null);
onMounted(async () => {
const deviceInfo = uni.getDeviceInfo();
isIos.value = deviceInfo.osName === "ios";
currentList.value = rankData.value.rank;
myData.value = rankData.value.rank.find(
(item) => item.userId === user.value.id
);
});
const handleSelect = (index) => {
selectedIndex.value = index;
myData.value = null;
if (index === 0) {
currentList.value = rankData.value.rank;
} else if (index === 2) {
@@ -26,6 +31,9 @@ const handleSelect = (index) => {
} else {
currentList.value = [];
}
myData.value = rankData.value.rank.find(
(item) => item.userId === user.value.id
);
};
const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
@@ -121,18 +129,18 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
>
</view>
</view>
<view class="my-rank-data" v-if="user.id">
<view class="my-rank-data" v-if="myData">
<image src="../static/modal-content-bg.png" mode="widthFix" />
<text>{{ user.ranking }}</text>
<text>{{ myData.rank }}</text>
<Avatar :src="user.avatar" />
<view class="rank-item-content">
<text class="truncate">{{ user.nickName }}</text>
<text>{{ user.lvlName }}20</text>
<text>{{ user.lvlName }}{{ myData.TotalGames }}</text>
</view>
<text class="rank-item-integral"
><text
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
>{{ user.scores }}</text
>{{ myData.totalScore }}</text
></text
>
</view>