fix(studio): Phase0 卖相批——退出登录入口/品牌渐变/Inter字体/字号token/创作页诚实空态

- 退出登录入口(Project.vue):接既有 userStore.logout()(不重实现),isRealLogin() 门控仅登录态显示,二次确认→replace('/feed');闭合 §7「退出登录无入口」孤儿红线
- 主按钮品牌渐变(AppButton.vue):.app-btn--primary 纯色青→135° cyan→green 渐变+weight 820+深色字#061014,对齐 demo
- 品牌字体(reset.css + public/fonts):self-host Inter 拉丁子集 400/600/700 woff2,@font-face font-display:swap,'Inter' 前置字体栈(中文兜底 PingFang SC/微软雅黑)
- 字号阶梯(tokens.css):新增 --fs-h1/h2/body/caption,additive
- 创作页诚实空态(Create.vue):W-CLEAN 后模板列表返空属迁移非故障,区分"✨升级中"与"⚠加载失败"不再误报,空态给"去游戏流"出口

真机走查实证(staging :4173 CDP 截图双证):退出登录可见可登出/主按钮青绿渐变/Inter真渲/创作页诚实文案 全生效
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
zizi 2026-06-16 06:43:12 +00:00
parent 188511d2ce
commit 42342e8c53
8 changed files with 109 additions and 10 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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 {

View File

@ -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;

View File

@ -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 底部安全区 */

View File

@ -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)
<span class="tpl-loading-text">模板加载中…</span>
</div>
<!-- 加载失败 / 空 -->
<!-- 真加载失败(网络/服务异常):可重试 -->
<EmptyState
v-else-if="tplError || createStore.templates.length === 0"
v-else-if="tplError"
icon="⚠"
title="模板加载失败"
description="网络异常或服务未就绪,请重试"
action-text="重新加载"
@action="loadTemplates"
/>
<!-- 空(非故障):W-CLEAN 后玩法模板体系升级中,新版一句话创作接 W-G1 待上线;
诚实区分「升级中」与「加载失败」,不误报故障,给一个去游戏流的出口 -->
<EmptyState
v-else-if="createStore.templates.length === 0"
icon="✨"
title="玩法模板体系升级中"
description="新版「一句话创作」即将上线,先去游戏流逛逛吧"
action-text="去游戏流"
@action="goFeed"
/>
<!-- 模板横向卡片列表(3-5 个) -->
<div v-else class="tpl-list">

View File

@ -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<number | undefined>(undefined)
@ -77,10 +110,14 @@ onMounted(() => {
<template>
<div class="proj-list">
<!-- 顶部标题栏 + 新建入口 -->
<!-- 顶部标题栏 + 新建入口(+ 退出登录,仅真实登录态显示,闭合 §7「退出登录无入口」孤儿) -->
<header class="proj-list__head">
<h1 class="proj-list__title">我的项目</h1>
<AppButton type="ghost" size="small" @click="goCreate">+ 新建</AppButton>
<div class="proj-list__actions">
<!-- 退出登录:仅真实登录用户可见(匿名/批跑 env-token 态不渲染);点击直连既有 logout() -->
<AppButton v-if="showLogout" type="ghost" size="small" @click="onLogout">退出登录</AppButton>
<AppButton type="ghost" size="small" @click="goCreate">+ 新建</AppButton>
</div>
</header>
<!-- 状态筛选页签(横向滚动,覆盖 7 态 + 全部) -->
@ -170,10 +207,17 @@ onMounted(() => {
padding: 16px 16px 8px;
}
.proj-list__title {
font-size: 20px;
/* 示范引用字号阶梯 token(页面标题,对齐 --fs-h2 19px);其余组件可后续渐进迁移 */
font-size: var(--fs-h2);
font-weight: 700;
margin: 0;
}
/* 顶部操作区:退出登录 + 新建并排(gap 防贴死) */
.proj-list__actions {
display: flex;
align-items: center;
gap: 8px;
}
/* 状态筛选页签:横向可滚动 */
.proj-list__filters {