feat(V0.2): OTA 版本与判新口径 + Tab 结构调整

1) 版本对齐分支
- package.json / tauri.conf.json / Cargo.toml / Cargo.lock: 0.1.0 -> 0.2.0, OTA 包版本变为 0.2.0-ota
- 新增 scripts/ci/check-version.mjs: 分支 dev-x.y 与 package.json 版本不一致时 CI 直接失败
- docker-build.yml / ota-build.yml: min_binary_version 与前端版本解耦, 固定 0.1.0
  (现有 APK 原生层仍是 0.1.0, 抬高会导致旧 APK 收不到更新)

2) 我的页 OTA「开发版本」开关 (默认关, 持久化 localStorage.iboard_ota_dev_mode)
- 关: 按版本号逐字段比较 (src/utils/version.js), 服务端 version 更高才算新
- 开: 按 build sequence 判新 (hotswap checkUpdate), 每次构建都能推到设备
- Web 端: 开发口径退化为版本不同即算新; 生产口径严格比较大小

3) 打卡 Tab 移到最左并默认选中, 移除特效开关
- BottomNav: 打卡/宏观/监控/我; 删除 home 图标
- App: / 与 404 均重定向到 /checkin
- RingProgress/Celebrate: 删除 effectsEnabled/setEffectsEnabled, 特效恒开
- HabitView: 去掉头部「特效开/关」按钮

4) 取消首页 Tab, 报警/新闻并入宏观
- 新增 pages/macro/AlertsView.jsx、NewsView.jsx; 删除 HomePage.jsx
- MacroPage: 6 个子 Tab (油价/经济数据/策略研究/经济文章/报警/新闻), 报警角标保留
- 新闻详情 /news/:id -> /macro/news/:id (宏观 Tab 保持高亮)

5) 文档: 需求文档补 F-OT 需求点与已决策项; 设计文档新增 §10 变更记录与判新设计;
   界面设计.html 11 屏 (Tab 4 项/去掉特效开关/宏观合并/我的 OTA 开关 关+开 两态)
This commit is contained in:
cheney
2026-10-22 17:17:29 +08:00
parent e1e0880ce6
commit 4a04720a5e
25 changed files with 884 additions and 401 deletions
+6 -7
View File
@@ -4,24 +4,23 @@ import TabIcon from './TabIcon.jsx'
// 底部 Tab 配置: key 既是路由前缀, 又是 icon 名
// 使用 antd-mobile TabBar: 自带 safe-area 处理, 仿原生 iOS/Android 风格
// V0.2: 打卡置最左并为默认 Tab; 原「首页」的报警/新闻并入「宏观」, 不再有首页 Tab
const TABS = [
{ key: '/', name: 'home', label: '首页' },
{ key: '/checkin', name: 'checkin', label: '打卡' },
{ key: '/macro', name: 'macro', label: '宏观' },
{ key: '/monitor', name: 'monitor', label: '监控' },
{ key: '/checkin', name: 'checkin', label: '打卡' },
{ key: '/me', name: 'me', label: '我' },
]
// 根据当前路径计算激活的 tab key (精确匹配 '/' , 其他前缀匹配)
// 根据当前路径计算激活的 tab key (精确匹配 + 前缀匹配)
function activeKeyFromPath(pathname) {
for (const t of TABS) {
if (t.key === '/') {
if (pathname === '/') return t.key
} else if (pathname === t.key || pathname.startsWith(t.key + '/')) {
if (pathname === t.key || pathname.startsWith(t.key + '/')) {
return t.key
}
}
return '/'
// 未知路径兜底到第一个 Tab (打卡)
return TABS[0].key
}
// 移动端底部 Tab 导航: antd-mobile TabBar, 内置安全区
+1 -20
View File
@@ -69,7 +69,7 @@ export default function RingProgress({
// 完成特效 (F-CK-07, U-02/U-03/U-07)
// props: fire 计数器(每次 +1 触发一次), color 主色
// 尊重"特效开关": localStorage iboard_celebrate === '0' 时不播放
// V0.2 设计变更: 去掉特效开关, 达标特效**恒开** (没有任何关闭入口)
export function Celebrate({ fire = 0, color = '#1677ff' }) {
const [burst, setBurst] = useState(0)
const [visible, setVisible] = useState(false)
@@ -80,7 +80,6 @@ export function Celebrate({ fire = 0, color = '#1677ff' }) {
if (fire === prev.current) return
prev.current = fire
if (fire <= 0) return
if (!effectsEnabled()) return
setBurst((n) => n + 1)
setVisible(true)
haptic()
@@ -113,24 +112,6 @@ export function Celebrate({ fire = 0, color = '#1677ff' }) {
)
}
// 特效全局开关 (默认开)
export function effectsEnabled() {
try {
if (localStorage.getItem('iboard_celebrate') === '0') return false
} catch { /* ignore */ }
// 系统"减弱动效"偏好时降级
if (typeof window !== 'undefined' && window.matchMedia) {
try {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false
} catch { /* ignore */ }
}
return true
}
export function setEffectsEnabled(v) {
try { localStorage.setItem('iboard_celebrate', v ? '1' : '0') } catch { /* ignore */ }
}
// 轻量触感反馈 (Web Vibration API; Tauri Android WebView 支持)
export function haptic(ms = 18) {
try {
+1 -7
View File
@@ -2,13 +2,7 @@
// props: name 字符串, active 布尔
// 返回对应的 24x24 SVG 节点
const ICONS = {
home: (active) => (
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={active ? 2.2 : 1.8} strokeLinecap="round" strokeLinejoin="round">
<path d="M3 11l9-7 9 7" />
<path d="M5 10v10h14V10" />
{active ? <path d="M10 20v-5h4v5" fill="currentColor" stroke="none" /> : null}
</svg>
),
// V0.2: 打卡移到最左, 原「首页」已并入宏观, home 图标不再使用
macro: (active) => (
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={active ? 2.2 : 1.8} strokeLinecap="round" strokeLinejoin="round">
<rect x="3" y="3" width="7" height="9" rx="1" fill={active ? 'currentColor' : 'none'} fillOpacity={active ? 0.15 : 0} />