[阶段10.1] Tab 改为 今日/健康/趋势/运动/设置

按指定结构调整导航:每日归入趋势、睡眠归入健康、同步归入设置,
它们是各自 Tab 的详情视图而非独立目的地。新增「运动」Tab。

运动页(新):
- 近 30 天运动时长/距离/消耗,以及今日强度分钟
- 项目分布:按累计时长排序,横条表示占比。只用一个色相 —— 每个项目
  一种颜色会让人以为分类另有含义
- 强度分钟趋势图,附 WHO 每周 150 分钟的参考
- 记录 / 个人纪录 / 奖励三个分页,运动记录 174 条

fix(nav): 五个 Tab 全部加载了同一个页面
- browserHistory 开在每个 View 上,导致它们都去读浏览器地址栏(当时是
  "/")而不是各自的 url,五个 Tab 渲染出五份「今日」
- 浏览器历史只绑定主 View,其余 Tab 用自己的 url 独立加载

fix(nav): 导航栏右侧对所有页面塞同一组图标
- 睡眠/同步/设置三个图标出现在每个页面上,其中两个在多数页面无意义。
  改为按页面声明:趋势 → 每日,健康 → 睡眠,设置 → 同步

fix(viz): 图表标题在窄栏里竖排
- 标题与「看数据」按钮争抢宽度,短标题被压成竖排字符。
  标题允许收缩省略,按钮不收缩

fix: 未映射的运动类型直接暴露 snake_case
- 补充登山/划船/椭圆机等映射;仍未覆盖的转为空格分词并首字母大写,
  而不是把 Garmin 的原始 key 摆给用户看

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
ericwyuan
2026-08-23 23:52:18 +08:00
parent 7ab150537d
commit fd9b610810
13 changed files with 436 additions and 236 deletions

View File

@@ -18,9 +18,9 @@ Framework7.use(Framework7React);
const TABS = [
{ id: 'today', path: '/', label: '今日', icon: 'square_grid_2x2' },
{ id: 'health', path: '/health/', label: '健康', icon: 'heart' },
{ id: 'daily', path: '/daily/', label: '每日', icon: 'calendar' },
{ id: 'trends', path: '/trends/', label: '趋势', icon: 'chart_bar_alt_fill' },
{ id: 'awards', path: '/achievements/', label: '成就', icon: 'rosette' },
{ id: 'exercise', path: '/exercise/', label: '运动', icon: 'flame' },
{ id: 'settings', path: '/settings/', label: '设置', icon: 'gear_alt' },
];
/**
@@ -66,7 +66,6 @@ function App() {
theme="ios"
darkMode="auto"
routes={routes}
view={{ browserHistory: true, browserHistorySeparator: '' }}
touch={{ tapHold: true }}
>
<Views tabs className="safe-areas">
@@ -94,6 +93,11 @@ function App() {
tab
tabActive={tab.id === 'today'}
url={tab.path}
// Only the main view drives the address bar. With it enabled on
// every tab each one reads the browser URL instead of its own
// `url`, so all five loaded the root page.
browserHistory={tab.id === 'today'}
browserHistorySeparator=""
/>
))}
</Views>