{ "phase": { "id": "phase-3", "name": "页面改造 — 3 个页面 + pages.json", "description": "改造 almanac-search/ziwei/fortune 三个页面,替换硬编码中文为 $t()/t() 调用,添加 onShow 动态导航栏标题", "dependencies": ["phase-1", "phase-2"], "tasks": [ { "id": "3.1", "name": "改造黄历搜索页 almanac-search/index.vue", "status": "pending", "description": "替换模板和 script 中的硬编码中文,添加 onShow 导航栏标题", "files": { "modify": ["src/pages/almanac-search/index.vue"] }, "steps": [ { "id": "3.1.1", "action": "write_implementation", "description": "添加 i18n 导入:import { useI18n } from 'vue-i18n' + const { t } = useI18n()" }, { "id": "3.1.2", "action": "write_implementation", "description": "替换模板硬编码中文:黄历搜索→$t('almanac.pageTitle')、搜索中...→$t('almanac.searching')、重试→$t('common.retry')" }, { "id": "3.1.3", "action": "write_implementation", "description": "替换 script 硬编码中文:error.value = t('almanac.keywordHint')、t('almanac.noResult')、t('search.addConditionHint')、t('almanac.searchFailed')" }, { "id": "3.1.4", "action": "write_implementation", "description": "添加 onShow:import { onShow } from '@dcloudio/uni-app' + onShow(() => { uni.setNavigationBarTitle({ title: t('almanac.pageTitle') }) })" }, { "id": "3.1.5", "action": "verify", "description": "验证构建", "runCommand": "cd everything-is-suitable-uniapp && npx vite build --mode development 2>&1 | tail -5", "expectedResult": "构建成功" }, { "id": "3.1.6", "action": "commit", "message": "feat(i18n): 改造黄历搜索页,替换硬编码中文为 $t() 调用" } ] }, { "id": "3.2", "name": "改造紫微斗数页 ziwei/index.vue", "status": "pending", "description": "替换模板和 script 中的硬编码中文,添加 onShow 导航栏标题", "files": { "modify": ["src/pages/ziwei/index.vue"] }, "replacements": [ { "from": "出生信息", "to": "$t('ziwei.birthInfo')" }, { "from": "出生日期", "to": "$t('ziwei.birthDate')" }, { "from": "请选择", "to": "$t('ziwei.pleaseSelect')" }, { "from": "出生时辰", "to": "$t('ziwei.birthHour')" }, { "from": "性别", "to": "$t('ziwei.gender')" }, { "from": "男", "to": "$t('common.male')" }, { "from": "女", "to": "$t('common.female')" }, { "from": "排盘中...", "to": "$t('ziwei.generating')" }, { "from": "排盘", "to": "$t('ziwei.generate')" }, { "from": "紫微斗数盘", "to": "$t('ziwei.chartTitle')" }, { "from": "三方四正分析", "to": "$t('ziwei.sanFangAnalysis')" }, { "from": "三方得分", "to": "$t('ziwei.sanFangScore')" }, { "from": "四正得分", "to": "$t('ziwei.siZhengScore')" }, { "from": "综合评价", "to": "$t('ziwei.overallEval')" }, { "from": "盘面概述", "to": "$t('ziwei.summary')" }, { "from": "分", "to": "$t('ziwei.scoreUnit')" } ], "steps": [ { "id": "3.2.1", "action": "write_implementation", "description": "添加 i18n 导入" }, { "id": "3.2.2", "action": "write_implementation", "description": "替换模板硬编码中文(16 处)" }, { "id": "3.2.3", "action": "write_implementation", "description": "添加 onShow 动态导航栏标题" }, { "id": "3.2.4", "action": "verify", "description": "验证构建", "runCommand": "cd everything-is-suitable-uniapp && npx vite build --mode development 2>&1 | tail -5", "expectedResult": "构建成功" }, { "id": "3.2.5", "action": "commit", "message": "feat(i18n): 改造紫微斗数页,替换硬编码中文为 $t() 调用" } ] }, { "id": "3.3", "name": "改造运势分析页 fortune/index.vue", "status": "pending", "description": "替换模板和 script 中的硬编码中文,添加 onShow 导航栏标题", "files": { "modify": ["src/pages/fortune/index.vue"] }, "replacements": [ { "from": "日运", "to": "$t('fortune.daily')" }, { "from": "月运", "to": "$t('fortune.monthly')" }, { "from": "选择日期", "to": "$t('fortune.selectDate')" }, { "from": "选择月份", "to": "$t('fortune.selectMonth')" }, { "from": "综合运势:", "to": "$t('fortune.overallFortune'):" }, { "from": "事业:", "to": "$t('fortune.career'):" }, { "from": "财运:", "to": "$t('fortune.wealth'):" }, { "from": "感情:", "to": "$t('fortune.relationship'):" }, { "from": "健康:", "to": "$t('fortune.health'):" }, { "from": "幸运色:", "to": "$t('fortune.luckyColor'):" }, { "from": "幸运数字:", "to": "$t('fortune.luckyNumber'):" }, { "from": "幸运方位:", "to": "$t('fortune.luckyDirection'):" }, { "from": "请先在紫微斗数页面完成排盘", "to": "$t('fortune.noChart')" } ], "steps": [ { "id": "3.3.1", "action": "write_implementation", "description": "添加 i18n 导入" }, { "id": "3.3.2", "action": "write_implementation", "description": "替换模板硬编码中文(13 处)" }, { "id": "3.3.3", "action": "write_implementation", "description": "添加 onShow 动态导航栏标题" }, { "id": "3.3.4", "action": "verify", "description": "验证构建", "runCommand": "cd everything-is-suitable-uniapp && npx vite build --mode development 2>&1 | tail -5", "expectedResult": "构建成功" }, { "id": "3.3.5", "action": "commit", "message": "feat(i18n): 改造运势分析页,替换硬编码中文为 $t() 调用" } ] }, { "id": "3.4", "name": "pages.json 保持中文初始值", "status": "pending", "description": "pages.json 中的 navigationBarTitleText 保持现有中文值作为首次渲染前的兜底,运行时由各页面 onShow 生命周期动态覆盖。无需改动此文件", "files": {}, "steps": [ { "id": "3.4.1", "action": "verify", "description": "确认 pages.json 无需修改,中文初始值作为兜底" } ] } ] } }