等级显示优化
This commit is contained in:
@@ -11,7 +11,6 @@ const props = defineProps({
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const lvlName = ref("");
|
||||
const nextLvlPoints = ref("");
|
||||
const containerWidth = computed(() => (props.showRank ? "72vw" : "100vw"));
|
||||
const toUserPage = () => {
|
||||
@@ -29,12 +28,8 @@ const toUserPage = () => {
|
||||
onMounted(() => {
|
||||
const rankInfos = config.value.randInfos || [];
|
||||
rankInfos.some((r, index) => {
|
||||
lvlName.value = rankInfos[index].name;
|
||||
if (r.upgrade_scores > user.value.scores) {
|
||||
nextLvlPoints.value = r.upgrade_scores;
|
||||
if (rankInfos[index - 1]) {
|
||||
lvlName.value = rankInfos[index - 1].name;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -55,7 +50,7 @@ onMounted(() => {
|
||||
/>
|
||||
</view>
|
||||
<view class="user-stats">
|
||||
<text class="level-tag level-tag-first">{{ lvlName }}</text>
|
||||
<text class="level-tag level-tag-first">{{ user.lvlName }}</text>
|
||||
<text class="level-tag level-tag-second">L{{ user.lvl }}</text>
|
||||
<view class="rank-tag">
|
||||
<view class="rank-tag-progress" :style="{ width: '40%' }" />
|
||||
|
||||
Reference in New Issue
Block a user