实现租客成长等级并优化展示

This commit is contained in:
yml2213
2026-07-26 11:25:25 +08:00
parent 756fa342cb
commit 321f0781cf
27 changed files with 948 additions and 16 deletions
+2
View File
@@ -10,6 +10,8 @@ export interface AuthUser {
realname_status: RealnameStatusValue
risk_status: RiskStatus
credit_score: number
renter_growth_points?: number
renter_growth_level?: string
status: UserStatus
}
@@ -104,11 +104,16 @@ const settingsGroups = [
},
]
onMounted(() => {
onMounted(async () => {
if (!isLoggedIn.value) {
router.replace({ path: '/m/login', query: { redirect: route.fullPath } })
} else {
loadBalance()
try {
await session.loadMe()
} catch {
// 保留本地会话展示,避免个人中心因网络短暂异常整页不可用。
}
void loadBalance()
}
})
@@ -348,6 +353,17 @@ function resolveAvatarURL(url: string | undefined | null) {
</div>
</section>
<section class="growth-card">
<div>
<span>租客成长等级</span>
<strong>{{ session.renterGrowthLevelName }}</strong>
</div>
<div>
<span>当前积分</span>
<strong>{{ session.renterGrowthPoints }}</strong>
</div>
</section>
<!-- 余额卡片 - 银行卡质感暗色卡片 -->
<div class="balance-card">
<div class="balance-row">
@@ -780,6 +796,39 @@ function resolveAvatarURL(url: string | undefined | null) {
font-size: 12px;
}
.growth-card {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin: 12px 16px 0;
}
.growth-card > div {
display: grid;
gap: 4px;
min-width: 0;
padding: 14px;
border: 1px solid rgba(243, 244, 246, 0.9);
border-radius: 16px;
background: #ffffff;
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.02),
0 1px 4px rgba(0, 0, 0, 0.02);
}
.growth-card span {
color: #9ca3af;
font-size: 11px;
font-weight: 700;
}
.growth-card strong {
color: #7c3aed;
font-size: 20px;
line-height: 1.2;
font-weight: 900;
}
/* ========== Balance Card ========== */
.balance-card {
margin: 12px 16px 14px;
@@ -50,8 +50,10 @@ const realnameTone = computed(() => {
})
onMounted(async () => {
if (!session.phone) {
try {
await session.loadMe()
} catch {
// 保留本地会话展示,避免资料页因网络短暂异常整页不可用。
}
resetForm()
})
@@ -258,6 +260,14 @@ async function savePassword() {
<dt>实名状态</dt>
<dd :class="`is-${realnameTone}`">{{ realnameStatusLabel(session.realnameStatus) }}</dd>
</div>
<div>
<dt>租客等级</dt>
<dd class="growth-level">{{ session.renterGrowthLevelName }}</dd>
</div>
<div>
<dt>成长积分</dt>
<dd>{{ session.renterGrowthPoints }}</dd>
</div>
</dl>
<button class="realname-shortcut" type="button" @click="router.push('/realname')">
<span>查看实名认证</span>
@@ -604,6 +614,10 @@ async function savePassword() {
text-align: right;
}
.account-card dd.growth-level {
color: #7c3aed;
}
.realname-shortcut {
display: flex;
align-items: center;