合并 main 分支并融合订单列表最小化与 SQL 治理

- Auth/权限中间件取 main 演进版(错误细分、token 来源),保留 dev 的用户 cookie 与登出撤销语义
- 后台订单列表:融合 main 的首页免 COUNT 优化与关键词索引路由,保留 dev 的最小化 AdminOrderListItemDTO(结账明细仍由详情接口返回,同步调整对应集成测试)
- 保留 dev 的 token_version 冻结/解冻递增与 main 的状态变化判断及通知
- 前端:保留 dev 登出接口与 main 的 fetchMe silent 参数、SSE 登录跳转;后台订单表按 dev 最小化 DTO 移除号主到手列
This commit is contained in:
yml2213
2026-09-05 11:43:13 +08:00
294 changed files with 30171 additions and 13439 deletions
+2 -2
View File
@@ -88,8 +88,8 @@ export async function logoutUser() {
})
}
export async function fetchMe() {
const { data } = await apiClient.get<ApiResponse<AuthUser>>('/me')
export async function fetchMe(options?: { silent?: boolean }) {
const { data } = await apiClient.get<ApiResponse<AuthUser>>('/me', options)
return data.data
}
@@ -0,0 +1,117 @@
import { onBeforeUnmount, onMounted, watch } from 'vue'
import { fetchMe } from '@/features/auth/api/auth'
import { getAccessToken, type AuthScope } from '@/shared/utils/authStorage'
import { useSessionStore } from '@/stores/session'
const scope: AuthScope = 'user'
const reconnectDelay = 3000
const verificationInterval = 5000
// 保持一个轻量级会话通道,使后台冻结能在没有页面请求时立即让用户退出。
export function useSessionMonitor() {
const session = useSessionStore()
let source: EventSource | null = null
let reconnectTimer: number | null = null
let verificationTimer: number | null = null
let checking = false
let stopped = false
function closeSource() {
source?.close()
source = null
}
function scheduleReconnect() {
if (stopped || reconnectTimer !== null || !session.isLoggedIn) return
reconnectTimer = window.setTimeout(() => {
reconnectTimer = null
connect()
}, reconnectDelay)
}
async function verifySession() {
if (stopped || checking || !session.isLoggedIn) return
checking = true
try {
await fetchMe({ silent: true })
} catch {
// 认证失败由 axios 拦截器清理令牌并跳转;网络错误等待下一次校验。
} finally {
checking = false
}
}
function connect() {
if (stopped || source || !session.isLoggedIn) return
const token = getAccessToken(scope)
if (!token) return
source = new EventSource(`/api/auth/events?token=${encodeURIComponent(token)}`, {
withCredentials: true,
})
source.addEventListener('connected', () => undefined)
source.onerror = () => {
closeSource()
void verifySession()
scheduleReconnect()
}
}
function stop() {
closeSource()
if (reconnectTimer !== null) {
window.clearTimeout(reconnectTimer)
reconnectTimer = null
}
if (verificationTimer !== null) {
window.clearInterval(verificationTimer)
verificationTimer = null
}
}
function start() {
stop()
if (!session.isLoggedIn) return
connect()
void verifySession()
verificationTimer = window.setInterval(verifySession, verificationInterval)
}
function handleAuthStorageChanged(event: Event) {
const detail = (event as CustomEvent<{ scope?: AuthScope }>).detail
if (detail?.scope !== scope || stopped) return
if (session.isLoggedIn) {
start()
} else {
stop()
}
}
function handleVisibilityChange() {
if (document.visibilityState === 'visible') void verifySession()
}
onMounted(() => {
stopped = false
start()
window.addEventListener('auth-storage-changed', handleAuthStorageChanged)
document.addEventListener('visibilitychange', handleVisibilityChange)
})
onBeforeUnmount(() => {
stopped = true
stop()
window.removeEventListener('auth-storage-changed', handleAuthStorageChanged)
document.removeEventListener('visibilitychange', handleVisibilityChange)
})
watch(
() => session.isLoggedIn,
loggedIn => {
if (stopped) return
if (loggedIn) start()
else stop()
}
)
}
@@ -0,0 +1,665 @@
.mobile-profile-shell {
min-height: 100dvh;
background: #f6f8fa;
color: #1a202c;
padding: 0 0 calc(64px + env(safe-area-inset-bottom));
}
/* ========== Hero Header ========== */
.profile-hero {
background: #ffffff;
padding: 20px 16px 20px;
border-bottom: 1px solid rgba(243, 244, 246, 0.8);
}
.hero-top-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.app-title {
font-size: 16px;
font-weight: 700;
color: #111827;
letter-spacing: 0.5px;
}
.hero-setting-btn {
display: grid;
width: 34px;
height: 34px;
place-items: center;
border: none;
background: #f3f4f6;
border-radius: 999px;
cursor: pointer;
transition: background 0.2s;
}
.hero-setting-btn:active {
background: #e5e7eb;
}
.profile-hero-content {
display: flex;
align-items: center;
gap: 16px;
}
.avatar-circle {
display: grid;
width: 60px;
height: 60px;
place-items: center;
border-radius: 999px;
overflow: hidden;
background: #eaf2ff;
color: #1477ff;
font-size: 24px;
font-weight: 900;
border: 1px solid #e5e7eb;
}
.avatar-circle img {
width: 100%;
height: 100%;
object-fit: cover;
}
.hero-user {
flex: 1;
min-width: 0;
}
.name-row {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.user-nickname {
margin: 0;
font-size: 18px;
font-weight: 800;
color: #111827;
}
.verified-tag,
.unverified-tag {
font-size: 10px !important;
height: 18px;
padding: 0 6px;
font-weight: 700;
border: none;
}
.user-meta {
margin: 4px 0 0;
color: #6b7280;
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;
padding: 16px;
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);
border: 1px solid rgba(243, 244, 246, 0.9);
}
.balance-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.balance-info {
display: flex;
flex-direction: column;
gap: 4px;
}
.balance-label {
color: #9ca3af;
font-size: 11px;
font-weight: 600;
}
.balance-value {
font-size: 26px;
font-weight: 800;
font-family: Inter, system-ui, sans-serif;
color: #111827;
}
.withdraw-btn {
background: transparent;
border: 1px solid #1477ff;
color: #1477ff;
font-weight: 700;
font-size: 12px;
height: 28px;
padding: 0 16px;
border-radius: 999px;
cursor: pointer;
transition:
background 0.15s,
color 0.15s;
}
.withdraw-btn:active {
background: #1477ff;
color: #ffffff;
}
.balance-footer {
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #f3f4f6;
}
.detail-btn {
background: transparent;
border: none;
color: #1477ff;
font-weight: 700;
font-size: 11px;
display: flex;
align-items: center;
gap: 4px;
cursor: pointer;
padding: 0;
}
/* ========== Menu Cards ========== */
.menu-card {
margin: 0 16px 14px;
background: #ffffff;
border-radius: 16px;
padding: 16px;
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.02),
0 1px 4px rgba(0, 0, 0, 0.02);
border: 1px solid rgba(243, 244, 246, 0.9);
}
.menu-card.cell-card {
padding: 0;
overflow: hidden;
}
.menu-card .card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 14px;
}
.menu-card .card-header h3 {
margin: 0;
font-size: 14px;
font-weight: 800;
color: #111827;
}
.see-all {
font-size: 11px;
color: #6b7280;
display: flex;
align-items: center;
gap: 2px;
cursor: pointer;
}
/* Grid Menu Layout */
.grid-menu {
display: flex;
justify-content: space-between;
align-items: center;
}
.grid-menu.col-4 .grid-item {
flex: 0 0 25%;
}
.grid-menu.col-5 .grid-item {
flex: 0 0 20%;
}
.grid-menu.col-3 .grid-item {
flex: 0 0 33.33%;
}
.grid-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
cursor: pointer;
}
.grid-item:active .icon-wrap {
transform: scale(0.92);
}
.icon-wrap {
display: grid;
width: 44px;
height: 44px;
place-items: center;
border-radius: 12px;
transition: transform 0.15s ease;
}
/* Vibrant pastel colors for menu icon wraps */
.icon-wrap.warning {
color: #f59e0b;
background: rgba(245, 158, 11, 0.08);
}
.icon-wrap.info {
color: #2563eb;
background: rgba(37, 99, 235, 0.08);
}
.icon-wrap.primary {
color: #1477ff;
background: rgba(20, 119, 255, 0.08);
}
.icon-wrap.success {
color: #10b981;
background: rgba(16, 185, 129, 0.08);
}
.icon-wrap.orange {
color: #ff5f00;
background: rgba(255, 95, 0, 0.08);
}
.icon-wrap.purple {
color: #8b5cf6;
background: rgba(139, 92, 246, 0.08);
}
.icon-wrap.teal {
color: #0d9488;
background: rgba(13, 148, 136, 0.08);
}
.grid-item span {
font-size: 11px;
color: #374151;
font-weight: 600;
}
/* Vant Cell Adjustments */
:deep(.van-cell-group) {
background: transparent;
}
:deep(.van-cell) {
padding: 14px 16px;
font-size: 14px;
}
.verified-color {
color: #10b981;
font-weight: 600;
}
.unverified-color {
color: #9ca3af;
}
.unread-cell-value {
color: #ef4444;
font-weight: 700;
}
/* 收支明细 Popup */
.ledgers-popup {
display: flex;
flex-direction: column;
}
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
border-bottom: 1px solid #f3f4f6;
flex-shrink: 0;
}
.popup-header h3 {
margin: 0;
font-size: 16px;
font-weight: 800;
}
.popup-close {
border: none;
background: transparent;
font-size: 16px;
color: #9ca3af;
cursor: pointer;
}
.popup-body {
flex: 1;
overflow-y: auto;
padding: 0 16px;
}
.ledger-list {
display: flex;
flex-direction: column;
}
.ledger-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 0;
border-bottom: 1px solid #f3f4f6;
}
.ledger-item:last-child {
border-bottom: none;
}
.ledger-left {
display: flex;
flex-direction: column;
gap: 4px;
}
.ledger-remark {
font-size: 14px;
color: #1f2937;
font-weight: 600;
}
.ledger-time {
font-size: 11px;
color: #9ca3af;
}
.ledger-right {
font-size: 15px;
font-weight: 800;
}
.in-color {
color: #10b981;
}
.out-color {
color: #ef4444;
}
/* 租后须知 Popup */
.notice-popup {
display: flex;
flex-direction: column;
}
.notice-content {
padding: 16px 0;
color: #374151;
font-size: 14px;
line-height: 1.8;
white-space: pre-wrap;
word-wrap: break-word;
}
.center-loading {
display: flex;
align-items: center;
justify-content: center;
padding: 40px 0;
}
/* ========== 设置面板 ========== */
.settings-panel {
display: flex;
flex-direction: column;
height: 100%;
background: #f5f6f8;
}
.settings-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px;
background: #fff;
border-bottom: 1px solid #eee;
}
.settings-header h2 {
margin: 0;
font-size: 17px;
font-weight: 700;
}
.settings-close {
display: grid;
width: 32px;
height: 32px;
place-items: center;
border: none;
background: none;
color: #999;
cursor: pointer;
}
.settings-group {
margin-top: 12px;
}
.settings-group-title {
margin: 0 0 4px 16px;
font-size: 13px;
font-weight: 600;
color: #999;
}
.settings-group :deep(.van-cell) {
font-size: 15px;
}
.settings-logout {
margin: auto 16px 24px;
padding-top: 20px;
}
/* ========== 资料修改 ========== */
.profile-editor {
padding: 16px 16px max(18px, env(safe-area-inset-bottom));
background: #fff;
}
.profile-editor-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.profile-editor-header h2 {
margin: 0;
color: #17233d;
font-size: 18px;
font-weight: 800;
}
.profile-editor-header button {
display: grid;
width: 34px;
height: 34px;
place-items: center;
border: none;
border-radius: 12px;
background: #f4f6f8;
color: #64748b;
}
.profile-preview {
display: flex;
align-items: center;
gap: 12px;
margin: 18px 0;
padding: 14px;
border-radius: 14px;
background: #f7faff;
}
.profile-preview-avatar {
display: grid;
width: 52px;
height: 52px;
flex: 0 0 auto;
place-items: center;
overflow: hidden;
border-radius: 16px;
background: #1477ff;
color: #fff;
font-size: 22px;
font-weight: 900;
}
.profile-preview-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.profile-preview-avatar.clickable {
cursor: pointer;
position: relative;
}
.avatar-upload-overlay {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
opacity: 0;
transition: opacity 0.2s ease;
}
.profile-preview-avatar.clickable:hover .avatar-upload-overlay,
.profile-preview-avatar.clickable:active .avatar-upload-overlay {
opacity: 1;
}
.avatar-loading {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.8);
}
.preview-info {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.preview-info strong {
display: block;
max-width: 230px;
overflow: hidden;
color: #17233d;
font-size: 16px;
text-overflow: ellipsis;
white-space: nowrap;
}
.preview-info p {
margin: 0;
color: #7b8798;
font-size: 12px;
}
.upload-btn {
margin-top: 4px;
font-weight: 600;
}
.editor-field {
display: block;
margin-bottom: 12px;
}
.password-hint {
margin: 8px 0 14px;
color: #8b9cb5;
font-size: 12px;
line-height: 1.5;
}
.editor-field span {
display: block;
margin-bottom: 6px;
color: #697386;
font-size: 13px;
font-weight: 700;
}
.editor-field input {
box-sizing: border-box;
width: 100%;
height: 46px;
border: 1px solid #e1e7ef;
border-radius: 12px;
background: #fff;
color: #17233d;
font-size: 14px;
outline: none;
padding: 0 12px;
}
.editor-field input:focus {
border-color: #1477ff;
box-shadow: 0 0 0 3px rgba(20, 119, 255, 0.1);
}
.profile-save-btn {
height: 44px;
margin-top: 6px;
background: #1477ff;
border-color: transparent;
font-weight: 800;
}
/* ========== 响应式适配 ========== */
@media (min-width: 520px) {
.mobile-profile-shell {
max-width: 430px;
margin: 0 auto;
box-shadow: 0 0 0 1px rgba(23, 35, 61, 0.08);
}
}
@@ -691,670 +691,4 @@ function resolveAvatarURL(url: string | undefined | null) {
</main>
</template>
<style scoped>
.mobile-profile-shell {
min-height: 100dvh;
background: #f6f8fa;
color: #1a202c;
padding: 0 0 calc(64px + env(safe-area-inset-bottom));
}
/* ========== Hero Header ========== */
.profile-hero {
background: #ffffff;
padding: 20px 16px 20px;
border-bottom: 1px solid rgba(243, 244, 246, 0.8);
}
.hero-top-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.app-title {
font-size: 16px;
font-weight: 700;
color: #111827;
letter-spacing: 0.5px;
}
.hero-setting-btn {
display: grid;
width: 34px;
height: 34px;
place-items: center;
border: none;
background: #f3f4f6;
border-radius: 999px;
cursor: pointer;
transition: background 0.2s;
}
.hero-setting-btn:active {
background: #e5e7eb;
}
.profile-hero-content {
display: flex;
align-items: center;
gap: 16px;
}
.avatar-circle {
display: grid;
width: 60px;
height: 60px;
place-items: center;
border-radius: 999px;
overflow: hidden;
background: #eaf2ff;
color: #1477ff;
font-size: 24px;
font-weight: 900;
border: 1px solid #e5e7eb;
}
.avatar-circle img {
width: 100%;
height: 100%;
object-fit: cover;
}
.hero-user {
flex: 1;
min-width: 0;
}
.name-row {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.user-nickname {
margin: 0;
font-size: 18px;
font-weight: 800;
color: #111827;
}
.verified-tag,
.unverified-tag {
font-size: 10px !important;
height: 18px;
padding: 0 6px;
font-weight: 700;
border: none;
}
.user-meta {
margin: 4px 0 0;
color: #6b7280;
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;
padding: 16px;
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);
border: 1px solid rgba(243, 244, 246, 0.9);
}
.balance-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.balance-info {
display: flex;
flex-direction: column;
gap: 4px;
}
.balance-label {
color: #9ca3af;
font-size: 11px;
font-weight: 600;
}
.balance-value {
font-size: 26px;
font-weight: 800;
font-family: Inter, system-ui, sans-serif;
color: #111827;
}
.withdraw-btn {
background: transparent;
border: 1px solid #1477ff;
color: #1477ff;
font-weight: 700;
font-size: 12px;
height: 28px;
padding: 0 16px;
border-radius: 999px;
cursor: pointer;
transition:
background 0.15s,
color 0.15s;
}
.withdraw-btn:active {
background: #1477ff;
color: #ffffff;
}
.balance-footer {
margin-top: 12px;
padding-top: 10px;
border-top: 1px solid #f3f4f6;
}
.detail-btn {
background: transparent;
border: none;
color: #1477ff;
font-weight: 700;
font-size: 11px;
display: flex;
align-items: center;
gap: 4px;
cursor: pointer;
padding: 0;
}
/* ========== Menu Cards ========== */
.menu-card {
margin: 0 16px 14px;
background: #ffffff;
border-radius: 16px;
padding: 16px;
box-shadow:
0 4px 16px rgba(0, 0, 0, 0.02),
0 1px 4px rgba(0, 0, 0, 0.02);
border: 1px solid rgba(243, 244, 246, 0.9);
}
.menu-card.cell-card {
padding: 0;
overflow: hidden;
}
.menu-card .card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 14px;
}
.menu-card .card-header h3 {
margin: 0;
font-size: 14px;
font-weight: 800;
color: #111827;
}
.see-all {
font-size: 11px;
color: #6b7280;
display: flex;
align-items: center;
gap: 2px;
cursor: pointer;
}
/* Grid Menu Layout */
.grid-menu {
display: flex;
justify-content: space-between;
align-items: center;
}
.grid-menu.col-4 .grid-item {
flex: 0 0 25%;
}
.grid-menu.col-5 .grid-item {
flex: 0 0 20%;
}
.grid-menu.col-3 .grid-item {
flex: 0 0 33.33%;
}
.grid-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
cursor: pointer;
}
.grid-item:active .icon-wrap {
transform: scale(0.92);
}
.icon-wrap {
display: grid;
width: 44px;
height: 44px;
place-items: center;
border-radius: 12px;
transition: transform 0.15s ease;
}
/* Vibrant pastel colors for menu icon wraps */
.icon-wrap.warning {
color: #f59e0b;
background: rgba(245, 158, 11, 0.08);
}
.icon-wrap.info {
color: #2563eb;
background: rgba(37, 99, 235, 0.08);
}
.icon-wrap.primary {
color: #1477ff;
background: rgba(20, 119, 255, 0.08);
}
.icon-wrap.success {
color: #10b981;
background: rgba(16, 185, 129, 0.08);
}
.icon-wrap.orange {
color: #ff5f00;
background: rgba(255, 95, 0, 0.08);
}
.icon-wrap.purple {
color: #8b5cf6;
background: rgba(139, 92, 246, 0.08);
}
.icon-wrap.teal {
color: #0d9488;
background: rgba(13, 148, 136, 0.08);
}
.grid-item span {
font-size: 11px;
color: #374151;
font-weight: 600;
}
/* Vant Cell Adjustments */
:deep(.van-cell-group) {
background: transparent;
}
:deep(.van-cell) {
padding: 14px 16px;
font-size: 14px;
}
.verified-color {
color: #10b981;
font-weight: 600;
}
.unverified-color {
color: #9ca3af;
}
.unread-cell-value {
color: #ef4444;
font-weight: 700;
}
/* 收支明细 Popup */
.ledgers-popup {
display: flex;
flex-direction: column;
}
.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px;
border-bottom: 1px solid #f3f4f6;
flex-shrink: 0;
}
.popup-header h3 {
margin: 0;
font-size: 16px;
font-weight: 800;
}
.popup-close {
border: none;
background: transparent;
font-size: 16px;
color: #9ca3af;
cursor: pointer;
}
.popup-body {
flex: 1;
overflow-y: auto;
padding: 0 16px;
}
.ledger-list {
display: flex;
flex-direction: column;
}
.ledger-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 0;
border-bottom: 1px solid #f3f4f6;
}
.ledger-item:last-child {
border-bottom: none;
}
.ledger-left {
display: flex;
flex-direction: column;
gap: 4px;
}
.ledger-remark {
font-size: 14px;
color: #1f2937;
font-weight: 600;
}
.ledger-time {
font-size: 11px;
color: #9ca3af;
}
.ledger-right {
font-size: 15px;
font-weight: 800;
}
.in-color {
color: #10b981;
}
.out-color {
color: #ef4444;
}
/* 租后须知 Popup */
.notice-popup {
display: flex;
flex-direction: column;
}
.notice-content {
padding: 16px 0;
color: #374151;
font-size: 14px;
line-height: 1.8;
white-space: pre-wrap;
word-wrap: break-word;
}
.center-loading {
display: flex;
align-items: center;
justify-content: center;
padding: 40px 0;
}
/* ========== 设置面板 ========== */
.settings-panel {
display: flex;
flex-direction: column;
height: 100%;
background: #f5f6f8;
}
.settings-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px;
background: #fff;
border-bottom: 1px solid #eee;
}
.settings-header h2 {
margin: 0;
font-size: 17px;
font-weight: 700;
}
.settings-close {
display: grid;
width: 32px;
height: 32px;
place-items: center;
border: none;
background: none;
color: #999;
cursor: pointer;
}
.settings-group {
margin-top: 12px;
}
.settings-group-title {
margin: 0 0 4px 16px;
font-size: 13px;
font-weight: 600;
color: #999;
}
.settings-group :deep(.van-cell) {
font-size: 15px;
}
.settings-logout {
margin: auto 16px 24px;
padding-top: 20px;
}
/* ========== 资料修改 ========== */
.profile-editor {
padding: 16px 16px max(18px, env(safe-area-inset-bottom));
background: #fff;
}
.profile-editor-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.profile-editor-header h2 {
margin: 0;
color: #17233d;
font-size: 18px;
font-weight: 800;
}
.profile-editor-header button {
display: grid;
width: 34px;
height: 34px;
place-items: center;
border: none;
border-radius: 12px;
background: #f4f6f8;
color: #64748b;
}
.profile-preview {
display: flex;
align-items: center;
gap: 12px;
margin: 18px 0;
padding: 14px;
border-radius: 14px;
background: #f7faff;
}
.profile-preview-avatar {
display: grid;
width: 52px;
height: 52px;
flex: 0 0 auto;
place-items: center;
overflow: hidden;
border-radius: 16px;
background: #1477ff;
color: #fff;
font-size: 22px;
font-weight: 900;
}
.profile-preview-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.profile-preview-avatar.clickable {
cursor: pointer;
position: relative;
}
.avatar-upload-overlay {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
opacity: 0;
transition: opacity 0.2s ease;
}
.profile-preview-avatar.clickable:hover .avatar-upload-overlay,
.profile-preview-avatar.clickable:active .avatar-upload-overlay {
opacity: 1;
}
.avatar-loading {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.8);
}
.preview-info {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.preview-info strong {
display: block;
max-width: 230px;
overflow: hidden;
color: #17233d;
font-size: 16px;
text-overflow: ellipsis;
white-space: nowrap;
}
.preview-info p {
margin: 0;
color: #7b8798;
font-size: 12px;
}
.upload-btn {
margin-top: 4px;
font-weight: 600;
}
.editor-field {
display: block;
margin-bottom: 12px;
}
.password-hint {
margin: 8px 0 14px;
color: #8b9cb5;
font-size: 12px;
line-height: 1.5;
}
.editor-field span {
display: block;
margin-bottom: 6px;
color: #697386;
font-size: 13px;
font-weight: 700;
}
.editor-field input {
box-sizing: border-box;
width: 100%;
height: 46px;
border: 1px solid #e1e7ef;
border-radius: 12px;
background: #fff;
color: #17233d;
font-size: 14px;
outline: none;
padding: 0 12px;
}
.editor-field input:focus {
border-color: #1477ff;
box-shadow: 0 0 0 3px rgba(20, 119, 255, 0.1);
}
.profile-save-btn {
height: 44px;
margin-top: 6px;
background: #1477ff;
border-color: transparent;
font-weight: 800;
}
/* ========== 响应式适配 ========== */
@media (min-width: 520px) {
.mobile-profile-shell {
max-width: 430px;
margin: 0 auto;
box-shadow: 0 0 0 1px rgba(23, 35, 61, 0.08);
}
}
</style>
<style scoped src="./MobileProfileView.css"></style>