完善数据
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user