重构底部导航图标:照参考图重做形状与配色

- 5 个 Tab 图标形状改为参考图语言:房子(首页)/爱心(找对象)/对话气泡(消息)/日历加号(活动)/人物(我的)
- 配色改为参考图方案:默认态藏青蓝 #47528C、选中态玫红 #F4005A(与导航栏品牌色同系)
- 同步重生成 1x/2x/3x 共 30 张透明 RGBA PNG(Edge CDP 栅格化)
- app.json tabBar.color/selectedColor 对齐新配色
- 守卫 tabbar-icons.mjs 增加两态颜色与 app.json 一致性断言
- 静态预览复刻 tabBar 配色同步更新;DESIGN.md 同步
This commit is contained in:
WorkBuddy
2026-09-23 16:30:32 +08:00
parent 45e84722e1
commit 1ad9793ea2
45 changed files with 66 additions and 59 deletions
+12 -7
View File
@@ -5,11 +5,11 @@ import { join } from 'node:path'
const repoRoot = process.cwd()
const root = join(repoRoot, 'miniapp', 'assets', 'tabbar')
const icons = {
home: '爱心小屋',
discover: '双人缘分',
message: '爱心对话',
activity: '公益日历',
mine: '个人守护',
home: '房子',
discover: '爱心',
message: '对话气泡',
activity: '日历',
mine: '人物',
}
// ── 1. SVG 源文件:主题化标题 + 两态配色 ──────────────────────────────
@@ -18,8 +18,8 @@ for (const [name, title] of Object.entries(icons)) {
const active = readFileSync(join(root, 'svg', `${name}-active.svg`), 'utf8')
assert.match(normal, new RegExp(`<title>${title}</title>`), `${name} 缺少主题化标题`)
assert.match(normal, /#999999/i, `${name} 默认态颜色错误`)
assert.match(active, /#E96B6B/i, `${name} 选中态颜色错误`)
assert.match(normal, /#47528C/i, `${name} 默认态颜色错误`)
assert.match(active, /#F4005A/i, `${name} 选中态颜色错误`)
// ── 2. PNG 规格:正方形、1x/2x/3x、透明 RGBA ────────────────────────
for (const suffix of ['', '_2x', '_3x']) {
@@ -41,6 +41,11 @@ const appJson = JSON.parse(readFileSync(appJsonPath, 'utf8'))
const tabList = appJson.tabBar?.list ?? []
assert.equal(tabList.length, 5, 'tabBar.list 必须为 5 项(微信支持 2~5)')
// 文字与图标同色:color 必须等于 SVG 默认态色,selectedColor 必须等于选中态色,
// 否则会出现「图标是藏青蓝/玫红、文字却是别的颜色」的割裂。
assert.equal(appJson.tabBar?.color, '#47528C', 'tabBar.color 必须与图标默认态同色(#47528C)')
assert.equal(appJson.tabBar?.selectedColor, '#F4005A', 'tabBar.selectedColor 必须与图标选中态同色(#F4005A)')
for (const item of tabList) {
assert.ok(appJson.pages.includes(item.pagePath), `tabBar pagePath 未在 pages 中注册: ${item.pagePath}`)
for (const key of ['iconPath', 'selectedIconPath']) {