From 29d2cd3fafa0d2e50ca79370c7c8450122781c3c Mon Sep 17 00:00:00 2001 From: Blizzard Date: Thu, 30 Jul 2026 09:55:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor(fe):=20=E8=AE=B0=E5=BD=95=E4=BB=8E=20t?= =?UTF-8?q?ab=20=E9=99=8D=E7=BA=A7=E6=88=90=E9=A1=B5=E9=9D=A2=EF=BC=8CtabB?= =?UTF-8?q?ar=20=E5=87=8F=E5=88=B0=204=20=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## tabBar 首页 / 报告 / 社区 / 我的。记录不再是 tab。 因为高亮是 tabBar 组件按当前路由自己算的(Phase A 那次改的),删一个 tab 只需要动 LIST 一处,四个页面一行都没改。 ## 快速记录独立成页 —— 但没有新建页面 弹层里塞 24 项确实挤(用户原话「很丑」)。撤掉上一版加的 quickRecord 分支。 **pages/record/record 本身就是那个页面**:它顶部已经是 24 项 4 组宫格, 下面接着健康洞察、体重趋势、健康时间轴。再单独建一个只放宫格的页面,等于同一个 宫格维护两份,而且那页除了宫格什么都没有,进去点一下就得退出来。 所以把它从 tab 降级成二级页:nav 标题从「快速记录」改成「记录」+ 返回键, 移除 tabBar 同步。首页右下角悬浮键直接跳它,落地就是宫格。 pet-switch 保留 —— 时间轴/趋势/洞察都是按宠物看的,而且计划页作为二级页 也是这么处理的,一致。 ## 入口 首页悬浮键 → 记录页(全部 24 项) 首页「快速记录」卡 → 8 个高频项直接开表单,「更多」→ 记录页 文章页 / 设置页 → 记录页 三处 switchTab 改成 navigateTo(记录页已经不是 tab,switchTab 会静默失败)。 Co-Authored-By: Claude Opus 5 --- pets-fe/app.json | 4 ---- pets-fe/components/bottom-sheet/bottom-sheet.js | 2 -- .../components/bottom-sheet/bottom-sheet.wxml | 17 ----------------- pets-fe/custom-tab-bar/index.js | 1 - pets-fe/pages/article/article.js | 2 +- pets-fe/pages/home/home.js | 7 ++++--- pets-fe/pages/record/record.js | 2 -- pets-fe/pages/record/record.wxml | 2 +- pets-fe/pages/settings/settings.js | 2 +- 9 files changed, 7 insertions(+), 32 deletions(-) diff --git a/pets-fe/app.json b/pets-fe/app.json index 0c7ae95..3f04630 100644 --- a/pets-fe/app.json +++ b/pets-fe/app.json @@ -29,10 +29,6 @@ "pagePath": "pages/home/home", "text": "首页" }, - { - "pagePath": "pages/record/record", - "text": "记录" - }, { "pagePath": "pages/report/report", "text": "报告" diff --git a/pets-fe/components/bottom-sheet/bottom-sheet.js b/pets-fe/components/bottom-sheet/bottom-sheet.js index 04738ff..9465b1d 100644 --- a/pets-fe/components/bottom-sheet/bottom-sheet.js +++ b/pets-fe/components/bottom-sheet/bottom-sheet.js @@ -126,7 +126,6 @@ Component({ optSel: {}, dateVals: { vaccine: '', deworm: '' }, // 通用简易记录(洗护/清洁那 15 种共用) - typeGroups: [], isSimple: false, simpleLabel: '', simpleDate: '', @@ -226,7 +225,6 @@ Component({ } // 是否走通用简易表单。缓存热的时候是同步的;万一没热就按「不是」处理, // 那 9 种的分支写死在 wxml 里不依赖这份缓存,不会因此打不开 - if (type === 'quickRecord') patch.typeGroups = recordTypes.groups() || []; const simple = recordTypes.isSimple(type); patch.isSimple = simple; if (simple) { diff --git a/pets-fe/components/bottom-sheet/bottom-sheet.wxml b/pets-fe/components/bottom-sheet/bottom-sheet.wxml index 3034d95..beb167a 100644 --- a/pets-fe/components/bottom-sheet/bottom-sheet.wxml +++ b/pets-fe/components/bottom-sheet/bottom-sheet.wxml @@ -253,23 +253,6 @@ module.exports.sel = function (map, key, index, def) { - - - 记一笔 - 选一件刚做完的事,几秒记完。 - - {{item.label}}{{item.items.length}} - - - {{t.label}} - - - - 还没有配置可记事项 - - 提醒中心 diff --git a/pets-fe/custom-tab-bar/index.js b/pets-fe/custom-tab-bar/index.js index 0a44bfd..eb0883b 100644 --- a/pets-fe/custom-tab-bar/index.js +++ b/pets-fe/custom-tab-bar/index.js @@ -1,6 +1,5 @@ const LIST = [ { pagePath: '/pages/home/home', text: '首页', icon: 'home' }, - { pagePath: '/pages/record/record', text: '记录', icon: 'record' }, { pagePath: '/pages/report/report', text: '报告', icon: 'report' }, { pagePath: '/pages/community/community', text: '社区', icon: 'community' }, { pagePath: '/pages/mine/mine', text: '我的', icon: 'user' }, diff --git a/pets-fe/pages/article/article.js b/pets-fe/pages/article/article.js index 8896cb3..8fcc26e 100644 --- a/pets-fe/pages/article/article.js +++ b/pets-fe/pages/article/article.js @@ -19,7 +19,7 @@ Page({ }, // 从文章跳到对应的记录入口 goRecord() { - wx.switchTab({ url: '/pages/record/record' }); + wx.navigateTo({ url: '/pages/record/record' }); }, onShareAppMessage() { const a = this.data.article; diff --git a/pets-fe/pages/home/home.js b/pets-fe/pages/home/home.js index 8a15ae3..fa07592 100644 --- a/pets-fe/pages/home/home.js +++ b/pets-fe/pages/home/home.js @@ -298,9 +298,10 @@ Page({ onEditPet() { this.openSheetType('editPet'); }, - // 右下角悬浮键:打开 24 项记录选择器(原来是跳 AI 聊天页) + // 右下角悬浮键:进记录页。原来做成弹层里的选择器,弹层装 24 项太挤了; + // 记录页顶部本来就是那个宫格,再单独建一个只放宫格的页面等于维护两份 onQuickRecord() { - this.openSheetType('quickRecord'); + wx.navigateTo({ url: '/pages/record/record' }); }, goSettings() { wx.navigateTo({ url: '/pages/settings/settings' }); @@ -315,7 +316,7 @@ Page({ else this.goLearn(); }, goRecord() { - wx.switchTab({ url: '/pages/record/record' }); + wx.navigateTo({ url: '/pages/record/record' }); }, onShareAppMessage() { return { title: '肉垫计划 · 每天照顾好毛孩子', path: '/pages/home/home' }; diff --git a/pets-fe/pages/record/record.js b/pets-fe/pages/record/record.js index 9919a0c..7e843b3 100644 --- a/pets-fe/pages/record/record.js +++ b/pets-fe/pages/record/record.js @@ -1,7 +1,6 @@ const store = require('../../utils/store.js'); const api = require('../../utils/api.js'); const { toastErr } = require('../../utils/ui.js'); -const { syncTabBar } = require('../../utils/tabbar.js'); const recordTypes = require('../../utils/recordTypes.js'); function pad(n) { @@ -123,7 +122,6 @@ Page({ if (this._unsub) this._unsub(); }, onShow() { - syncTabBar(this); this.loadTypes(); store .ready() diff --git a/pets-fe/pages/record/record.wxml b/pets-fe/pages/record/record.wxml index 9a69837..88efe54 100644 --- a/pets-fe/pages/record/record.wxml +++ b/pets-fe/pages/record/record.wxml @@ -1,4 +1,4 @@ - + diff --git a/pets-fe/pages/settings/settings.js b/pets-fe/pages/settings/settings.js index e477c81..1fe4ca9 100644 --- a/pets-fe/pages/settings/settings.js +++ b/pets-fe/pages/settings/settings.js @@ -47,7 +47,7 @@ Page({ wx.navigateTo({ url: `/pages/relations/relations?id=${uid}&kind=${e.currentTarget.dataset.kind}` }); }, goRecord() { - wx.switchTab({ url: '/pages/record/record' }); + wx.navigateTo({ url: '/pages/record/record' }); }, onPickAvatar() { upload