diff --git a/game-studio/public/fonts/inter-latin-400-normal.woff2 b/game-studio/public/fonts/inter-latin-400-normal.woff2 new file mode 100644 index 00000000..f15b025d Binary files /dev/null and b/game-studio/public/fonts/inter-latin-400-normal.woff2 differ diff --git a/game-studio/public/fonts/inter-latin-600-normal.woff2 b/game-studio/public/fonts/inter-latin-600-normal.woff2 new file mode 100644 index 00000000..d1897949 Binary files /dev/null and b/game-studio/public/fonts/inter-latin-600-normal.woff2 differ diff --git a/game-studio/public/fonts/inter-latin-700-normal.woff2 b/game-studio/public/fonts/inter-latin-700-normal.woff2 new file mode 100644 index 00000000..a68fb101 Binary files /dev/null and b/game-studio/public/fonts/inter-latin-700-normal.woff2 differ diff --git a/game-studio/src/components/AppButton.vue b/game-studio/src/components/AppButton.vue index 354971c2..63882c57 100644 --- a/game-studio/src/components/AppButton.vue +++ b/game-studio/src/components/AppButton.vue @@ -101,10 +101,13 @@ function onClick(ev: MouseEvent) { width: 100%; } -/* —— 类型:primary 实心青(深底黑字保证对比)—— */ +/* —— 类型:primary 品牌青绿渐变(对齐 demo:228 最具辨识度的主操作语言)—— + 背景 135° cyan→green 渐变 + 重字重 820 + 深色高对比字(#061014); + 仅 primary 用此渐变与字重,ghost/danger/plain 不受影响。 */ .app-btn--primary { - background: var(--cyan); - color: #04222a; + background: linear-gradient(135deg, var(--cyan), var(--green)); + color: #061014; + font-weight: 820; } /* ghost 透明描边青 */ .app-btn--ghost { diff --git a/game-studio/src/styles/reset.css b/game-studio/src/styles/reset.css index 8f30ee44..d6bcfa4f 100644 --- a/game-studio/src/styles/reset.css +++ b/game-studio/src/styles/reset.css @@ -3,6 +3,32 @@ * 目标:抹平浏览器默认差异、锁定深色底、禁横向滚动、统一盒模型与字体。 */ +/* —— 品牌字体 Inter(self-host 拉丁子集,对齐 demo:35 首选 Inter)—— + 仅拉丁子集(数字/英文/计数/作者名),中文由下方 font-family 兜底 PingFang SC / Microsoft YaHei。 + font-display:swap:字体未就绪先用系统字渲染,加载完替换,避免 FOIT 阻塞首屏文字。 + 字重三档:400 常规 / 600 中粗(次级标题)/ 700 粗(标题)。文件存 public/fonts,相对 base 引用。 */ +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); +} +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 600; + font-display: swap; + src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); +} +@font-face { + font-family: 'Inter'; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); +} + /* 统一盒模型:所有元素含 padding/border 计入宽高,布局更可控 */ *, *::before, @@ -27,8 +53,8 @@ body { /* D4 深色底 + 主文字色(引用 token) */ background: var(--bg); color: var(--ink); - /* 移动端系统字体栈,无需引入外部字体 */ - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, + /* 品牌字体 Inter 前置(拉丁优先),中文兜底 PingFang SC / Microsoft YaHei,其余系统字体兜底 */ + font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; line-height: 1.5; diff --git a/game-studio/src/styles/tokens.css b/game-studio/src/styles/tokens.css index b075a5ef..bcc77279 100644 --- a/game-studio/src/styles/tokens.css +++ b/game-studio/src/styles/tokens.css @@ -23,6 +23,13 @@ --mask: rgba(7, 9, 17, 0.72); /* 遮罩/弹层背景 */ --shadow: 0 8px 24px rgba(0, 0, 0, 0.45); /* 浮层阴影 */ + /* —— 字号阶梯(type scale,对齐 demo:66-69;纯新增 token,组件可渐进改引,不强制全量替换)—— + 统一标题/正文/辅助字号,消除组件散落硬编码,便于后续换肤与一致性维护。 */ + --fs-h1: clamp(24px, 5vw, 32px); /* 一级标题(大屏渐增,移动端封顶 32px) */ + --fs-h2: 19px; /* 二级标题 */ + --fs-body: 14px; /* 正文(与 body 基线 14px 一致) */ + --fs-caption: 12px; /* 辅助说明/计数/时间 */ + /* —— TabBar / 安全区相关 —— */ --tabbar-h: 52px; /* 底部 TabBar 高度 */ --safe-bottom: env(safe-area-inset-bottom, 0px); /* iOS 底部安全区 */ diff --git a/game-studio/src/views/create/Create.vue b/game-studio/src/views/create/Create.vue index eed2a984..fb31869f 100644 --- a/game-studio/src/views/create/Create.vue +++ b/game-studio/src/views/create/Create.vue @@ -78,6 +78,15 @@ function useExample() { if (ex) prompt.value = ex } +/** + * 暂无玩法模板时的有用出口:去游戏流逛逛。 + * 背景:W-CLEAN(2026-06-12)下架旧玩法模板层、模板体系迁移中(新版一句话生成接 W-G1), + * 后端 template/list 暂返空数组(非故障)。此时创作流暂不可完成,给玩家一个不卡死的出口。 + */ +function goFeed() { + router.push('/feed') +} + /** * 提交生成(创作者闭环核心动作)。 * 步骤:建草稿项目 → 拿 projectId 作为 gameId → 投递生成任务 → 跳进度页。 @@ -134,15 +143,25 @@ onMounted(loadTemplates) 模板加载中… - + + +
diff --git a/game-studio/src/views/project/Project.vue b/game-studio/src/views/project/Project.vue index 58e51711..b6b053f3 100644 --- a/game-studio/src/views/project/Project.vue +++ b/game-studio/src/views/project/Project.vue @@ -14,16 +14,49 @@ import { onMounted, ref } from 'vue' import { useRouter } from 'vue-router' import { storeToRefs } from 'pinia' +import { showConfirmDialog } from 'vant' import { useProjectStore } from '../../store/project' +import { useUserStore } from '../../store/user' import { EmptyState, LoadingBar, AppButton } from '../../components' import StatusBadge from './StatusBadge.vue' import { STATUS_FILTERS } from './status' const router = useRouter() const projectStore = useProjectStore() +// 登录态 store:用于「退出登录」入口的显隐判定与登出动作(复用既有 logout(),不重实现) +const userStore = useUserStore() // 列表与加载态走 store 的响应式引用,保持单一数据源 const { myList, loading } = storeToRefs(projectStore) +/** + * 是否真实登录(仅 localStorage 真 token 才算,§9.2)。 + * 用作「退出登录」入口的唯一显隐判据:匿名态/staging env-token 态恒 false,不渲染登出入口(零中断)。 + * 注:用普通常量而非 computed——本页 onMounted 即进入,登录态在本页生命周期内不会变化(登出后立即跳走 /feed)。 + */ +const showLogout = userStore.isRealLogin() + +/** + * 退出登录:二次确认 → 调既有 userStore.logout() 清本地会话(清 5 个 LS 键)→ replace 到游戏流。 + * 用 replace 而非 push:登出后不应能「返回」到受保护的我的项目页(避免回退即触发守卫再跳登录的抖动)。 + */ +async function onLogout() { + try { + await showConfirmDialog({ + title: '退出登录', + message: '退出后需重新登录才能查看你的项目与创作,确定退出吗?', + confirmButtonText: '退出登录', + cancelButtonText: '取消', + }) + } catch { + // 用户点取消:showConfirmDialog 以 reject 表示,吞掉即可,不执行登出 + return + } + // 复用既有登出能力(清登录态 + localStorage 持久化态),严禁在此重复实现清键逻辑 + userStore.logout() + // 登出后回到零门槛的游戏流(玩家区无需登录) + router.replace('/feed') +} + /** 当前选中的状态筛选值(undefined=全部)。默认全部。 */ const activeStatus = ref(undefined) @@ -77,10 +110,14 @@ onMounted(() => {