实现租客成长等级并优化展示
This commit is contained in:
@@ -70,6 +70,19 @@ const realnameBadge = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const growthBadgeTone = computed(() => {
|
||||
switch (session.renterGrowthLevel) {
|
||||
case 'peak':
|
||||
return 'peak'
|
||||
case 'diamond':
|
||||
return 'diamond'
|
||||
case 'platinum':
|
||||
return 'platinum'
|
||||
default:
|
||||
return 'normal'
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => [route.path, route.query.keyword],
|
||||
() => {
|
||||
@@ -198,6 +211,9 @@ async function handleSupportClick() {
|
||||
<span v-else class="pc-avatar-text">{{ session.avatarText }}</span>
|
||||
</span>
|
||||
<span class="pc-user-name">{{ session.displayName }}</span>
|
||||
<span class="pc-growth-badge" :class="`is-${growthBadgeTone}`">
|
||||
{{ session.renterGrowthLevelName }}
|
||||
</span>
|
||||
<span class="pc-realname-badge" :class="`is-${realnameBadge.tone}`">
|
||||
{{ realnameBadge.text }}
|
||||
</span>
|
||||
@@ -209,6 +225,17 @@ async function handleSupportClick() {
|
||||
<Transition name="dropdown">
|
||||
<div v-if="showUserDropdown" class="pc-user-dropdown-container">
|
||||
<div class="pc-user-dropdown">
|
||||
<div class="dropdown-growth-panel">
|
||||
<div>
|
||||
<span>租客成长等级</span>
|
||||
<strong>{{ session.renterGrowthLevelName }}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span>当前积分</span>
|
||||
<strong>{{ session.renterGrowthPoints }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dropdown-basic-grid">
|
||||
<RouterLink
|
||||
class="dropdown-basic-item"
|
||||
@@ -664,6 +691,40 @@ async function handleSupportClick() {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.pc-growth-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 42px;
|
||||
height: 22px;
|
||||
padding: 0 8px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 900;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.pc-growth-badge.is-normal {
|
||||
background: #eef2ff;
|
||||
color: #4f46e5;
|
||||
}
|
||||
|
||||
.pc-growth-badge.is-platinum {
|
||||
background: #eff6ff;
|
||||
color: #2563eb;
|
||||
}
|
||||
|
||||
.pc-growth-badge.is-diamond {
|
||||
background: #ecfeff;
|
||||
color: #0891b2;
|
||||
}
|
||||
|
||||
.pc-growth-badge.is-peak {
|
||||
background: #fff7ed;
|
||||
color: #ea580c;
|
||||
}
|
||||
|
||||
.pc-realname-badge.is-verified,
|
||||
.dropdown-status.is-verified {
|
||||
background: #ecfdf3;
|
||||
@@ -733,6 +794,40 @@ async function handleSupportClick() {
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.dropdown-growth-panel {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.dropdown-growth-panel > div {
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
min-width: 0;
|
||||
min-height: 62px;
|
||||
padding: 11px 12px;
|
||||
border-radius: 12px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.dropdown-growth-panel span {
|
||||
color: #8b9cb5;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.dropdown-growth-panel strong {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
color: #7c3aed;
|
||||
font-size: 18px;
|
||||
font-weight: 900;
|
||||
line-height: 1.2;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dropdown-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -989,6 +1084,10 @@ async function handleSupportClick() {
|
||||
}
|
||||
|
||||
@media (max-width: 1280px) {
|
||||
.pc-growth-badge {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pc-realname-badge {
|
||||
display: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user