细节完善
This commit is contained in:
@@ -10,31 +10,28 @@ const { getLvlName } = store;
|
||||
const isIos = ref(true);
|
||||
const selectedIndex = ref(0);
|
||||
const currentList = ref([]);
|
||||
const myData = ref(null);
|
||||
const myData = ref({});
|
||||
const addBg = ref("");
|
||||
|
||||
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
|
||||
);
|
||||
myData.value = rankData.value.myRankPos;
|
||||
});
|
||||
|
||||
const handleSelect = (index) => {
|
||||
selectedIndex.value = index;
|
||||
myData.value = null;
|
||||
if (index === 0) {
|
||||
myData.value = rankData.value.myRankPos;
|
||||
currentList.value = rankData.value.rank;
|
||||
} else if (index === 2) {
|
||||
currentList.value = rankData.value.ringRank;
|
||||
myData.value = rankData.value.myRingRankPos;
|
||||
} else {
|
||||
myData.value = {};
|
||||
currentList.value = [];
|
||||
}
|
||||
myData.value = rankData.value.rank.find(
|
||||
(item) => item.userId === user.value.id
|
||||
);
|
||||
};
|
||||
|
||||
const onScrollView = (e) => {
|
||||
@@ -133,7 +130,7 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
||||
<view v-if="index > 2" class="view-crown">{{ index + 1 }}</view>
|
||||
<Avatar :src="item.avatar" />
|
||||
<view class="rank-item-content">
|
||||
<text>{{ item.name }}</text>
|
||||
<text class="truncate">{{ item.name }}</text>
|
||||
<text
|
||||
>{{ getLvlName(item.totalScore) }},{{ item.TotalGames }}场</text
|
||||
>
|
||||
@@ -153,24 +150,24 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
||||
<text>筹备中...</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-rank-data" v-if="myData">
|
||||
<view class="my-rank-data" v-if="myData.userId">
|
||||
<image src="../static/modal-content-bg.png" mode="widthFix" />
|
||||
<text>{{ myData.rank }}</text>
|
||||
<Avatar :src="user.avatar" />
|
||||
<view class="rank-item-content">
|
||||
<text class="truncate">{{ user.nickName }}</text>
|
||||
<text>{{ user.lvlName }},{{ myData.TotalGames }}场</text>
|
||||
<text>{{ user.lvlName }},{{ rankData.TotalGames }}场</text>
|
||||
</view>
|
||||
<text class="rank-item-integral" v-if="selectedIndex === 2"
|
||||
><text
|
||||
<text class="rank-item-integral" v-if="selectedIndex === 2">
|
||||
<text
|
||||
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||
>{{ myData.TenRings }}</text
|
||||
>{{ rankData.myRankPos.TenRings }}</text
|
||||
>次</text
|
||||
>
|
||||
<text class="rank-item-integral" v-else
|
||||
><text
|
||||
<text class="rank-item-integral" v-else>
|
||||
<text
|
||||
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||
>{{ myData.totalScore }}</text
|
||||
>{{ rankData.myRingRankPos.totalScore }}</text
|
||||
>分</text
|
||||
>
|
||||
</view>
|
||||
@@ -319,11 +316,13 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
||||
border-radius: 20px;
|
||||
margin: 10px;
|
||||
font-size: 14px;
|
||||
min-width: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
.my-rank-data > text:last-child {
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
width: 56px;
|
||||
width: 65px;
|
||||
text-align: right;
|
||||
}
|
||||
.my-rank-data > .rank-item-content > text:first-child {
|
||||
|
||||
Reference in New Issue
Block a user