diff --git a/website/src/components/organisms/index.jsx b/website/src/components/organisms/index.jsx index a1ae50b..bd2f0cb 100644 --- a/website/src/components/organisms/index.jsx +++ b/website/src/components/organisms/index.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { Logo } from '../atoms'; import { NAV, PINE_NAV } from '../../data/site'; -import { logout, getUser, isAuthed } from '../../services/auth'; +import { logout, getUser, isAuthed, refreshMe } from '../../services/auth'; /* 用户下拉菜单项:个人中心 / 我的报名 / 我的任务 / 我的园区 / 认证中心 */ const USER_MENU = [ @@ -19,7 +19,11 @@ export function Header({ active }) { const menuRef = React.useRef(null); const pine = !!active && active.startsWith('pine'); const nav = pine ? PINE_NAV : NAV; - const user = pine ? null : getUser(); // 公开端显示登录昵称 + const [user, setUser] = React.useState(pine ? null : getUser()); // 公开端显示登录昵称 + React.useEffect(() => { + if (pine || !isAuthed()) return; + refreshMe().then((u) => { if (u) setUser(u); }); // 同步其他端口改过的头像/昵称 + }, [pine]); React.useEffect(() => { const onKey = (e) => { if (e.key === 'Escape') { setOpen(false); setMenuOpen(false); } }; @@ -129,9 +133,9 @@ export function SiteFooter() { diff --git a/website/src/platform/PineEvents.jsx b/website/src/platform/PineEvents.jsx index 081b6fa..a327e8a 100644 --- a/website/src/platform/PineEvents.jsx +++ b/website/src/platform/PineEvents.jsx @@ -28,7 +28,7 @@ export default function PineEvents() { if (!file) return; setUploading(true); try { - const r = await uploadImage(file); + const r = await uploadImage(file, 'event'); if (r && r.url) { set('image')(r.url); flash('封面已上传'); } } catch (ex) { flash(ex.message || '上传失败'); } finally { setUploading(false); } diff --git a/website/src/styles/auth.css b/website/src/styles/auth.css index 01661c5..8d3999f 100644 --- a/website/src/styles/auth.css +++ b/website/src/styles/auth.css @@ -9,7 +9,8 @@ } .auth-card { width: 100%; max-width: 380px; - background: var(--panel); border: 1px solid var(--line); border-radius: 20px; + background: var(--glass-bg); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); + border: 1px solid var(--glass-ring); border-radius: 20px; padding: 34px 30px 28px; text-align: center; box-shadow: var(--shadow-sm-border); } @@ -19,6 +20,7 @@ display: grid; place-items: center; font-size: 24px; box-shadow: var(--shadow-sm-border); } +.auth-logo img { display: block; } .auth-card h1 { font-size: 20px; font-weight: 700; color: var(--heading); } .auth-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 22px; } .auth-card .field { text-align: left; margin-bottom: 14px; } diff --git a/website/src/styles/booking.css b/website/src/styles/booking.css index f1b2682..c690bc9 100644 --- a/website/src/styles/booking.css +++ b/website/src/styles/booking.css @@ -4,7 +4,7 @@ ============================================================ */ .bk-layout { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; } .bk-info { position: sticky; top: 20px; } -.bk-info-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; } +.bk-info-card { background: var(--glass-bg); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border: 1px solid var(--glass-ring); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; } .bk-info-title { font-size: 15px; font-weight: 600; color: var(--heading); margin-bottom: 6px; } .bk-info-title i { margin-right: 8px; color: var(--muted); } .bk-info-card p { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; } diff --git a/website/src/styles/user-center.css b/website/src/styles/user-center.css index a767a24..1a61717 100644 --- a/website/src/styles/user-center.css +++ b/website/src/styles/user-center.css @@ -108,3 +108,6 @@ .user-menu { display: none; } /* 移动端走 menu-sheet */ .uc-avatar-actions { align-items: flex-start; width: 100%; } } + +/* ---------- 绑定行小按钮(解绑/绑定):紧凑尺寸,不随 .btn 基础放大 ---------- */ +.uc-glass .btn-sm { padding: 4px 12px; font-size: 12px; line-height: 1.6; } diff --git a/website/src/user/Profile.jsx b/website/src/user/Profile.jsx index a5d203f..922b312 100644 --- a/website/src/user/Profile.jsx +++ b/website/src/user/Profile.jsx @@ -50,6 +50,7 @@ export default function Profile() { const [svc, setSvc] = React.useState({ bk: null, tk: null, park: '', cert: '' }); React.useEffect(() => { if (!authed) return; + refreshBind(); // 挂载即拉取真实绑定状态(手机号/小程序/微信),不只绑定时才刷新 Promise.all([ myBookings().then((l) => setSvc((s) => ({ ...s, bk: Array.isArray(l) ? l.length : 0 }))).catch(() => {}), myTasks().then((r) => setSvc((s) => ({ ...s, tk: r.ok ? (r.items || []).length : 0 }))).catch(() => {}),