重回比赛逻辑优化

This commit is contained in:
kron
2025-07-18 11:21:19 +08:00
parent db4ec13bac
commit ccfd09bb01
4 changed files with 92 additions and 85 deletions

View File

@@ -39,11 +39,11 @@ const toRankListPage = () => {
watch(
() => [config.value, user.value],
([n_config, n_user]) => {
const rankInfos = n_config.randInfos || [];
if (n_user.id && rankInfos.length) {
rankInfos.some((r, index) => {
if (r.upgrade_scores && r.upgrade_scores > n_user.scores) {
nextLvlPoints.value = r.upgrade_scores;
const list = n_config.levelInfo || [];
if (n_user.id && list.length) {
list.some((r, index) => {
if (r.exp_required && r.exp_required > n_user.lvlPoints) {
nextLvlPoints.value = r.exp_required;
return true;
}
return false;
@@ -75,17 +75,17 @@ watch(
/>
</view>
<view class="user-stats">
<text class="level-tag level-tag-first">{{ user.lvlName }}</text>
<text class="level-tag level-tag-second">L{{ user.lvl }}</text>
<!-- <text class="level-tag level-tag-first">{{ user.lvlName }}</text> -->
<text class="level-tag level-tag-second">LV{{ user.lvl }}</text>
<view class="rank-tag">
<view
class="rank-tag-progress"
:style="{
width: `${(Math.max(user.scores, 0) / nextLvlPoints) * 100}%`,
width: `${(user.lvlPoints / nextLvlPoints) * 100}%`,
}"
/>
<text class="rank-tag-text">
{{ Math.max(user.scores, 0) }}/{{ nextLvlPoints }}
{{ user.lvlPoints }}{{ nextLvlPoints ? `/${nextLvlPoints}` : "" }}
</text>
</view>
</view>
@@ -175,7 +175,7 @@ watch(
}
.level-tag-second {
width: 25px;
width: 60rpx;
background: #09c504;
}
@@ -188,7 +188,7 @@ watch(
.rank-tag {
position: relative;
background-color: #00000038;
width: 100rpx;
width: 150rpx;
overflow: hidden;
}
@@ -233,6 +233,7 @@ watch(
align-items: center;
}
.signin > image {
border-radius: 50%;
width: 40px;
height: 40px;
}