数据完善
This commit is contained in:
@@ -5,17 +5,27 @@ import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user, rankData } = storeToRefs(store);
|
||||
const { getLvlName } = store;
|
||||
|
||||
const isIos = ref(true);
|
||||
const selectedIndex = ref(0);
|
||||
const currentList = ref([]);
|
||||
|
||||
onMounted(async () => {
|
||||
const deviceInfo = uni.getDeviceInfo();
|
||||
isIos.value = deviceInfo.osName === "ios";
|
||||
currentList.value = rankData.value.rank;
|
||||
});
|
||||
|
||||
const handleSelect = (index) => {
|
||||
selectedIndex.value = index;
|
||||
if (index === 0) {
|
||||
currentList.value = rankData.value.rank;
|
||||
} else if (index === 2) {
|
||||
currentList.value = rankData.value.ringRank;
|
||||
} else {
|
||||
currentList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
||||
@@ -52,7 +62,7 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
||||
<text>{{ subTitles[selectedIndex] }}</text>
|
||||
</view>
|
||||
<view
|
||||
v-for="(_, index) in new Array(100).fill(1)"
|
||||
v-for="(item, index) in currentList"
|
||||
:key="index"
|
||||
class="rank-list-item"
|
||||
:style="{
|
||||
@@ -96,15 +106,17 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
||||
mode="widthFix"
|
||||
/>
|
||||
<view v-if="index > 2" class="view-crown">{{ index + 1 }}</view>
|
||||
<Avatar src="../static/avatar.png" />
|
||||
<Avatar :src="item.avatar" />
|
||||
<view class="rank-item-content">
|
||||
<text>打酱油大声路过</text>
|
||||
<text>钻石3级,20场</text>
|
||||
<text>{{ item.name }}</text>
|
||||
<text
|
||||
>{{ getLvlName(item.totalScore) }},{{ item.TotalGames }}场</text
|
||||
>
|
||||
</view>
|
||||
<text class="rank-item-integral"
|
||||
><text
|
||||
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||
>9999</text
|
||||
>{{ item.totalScore }}</text
|
||||
>分</text
|
||||
>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user