Commit Graph

15 Commits

Author SHA1 Message Date
liucheng e682f07892 fix(leaderboard): 修复加载期空白页,加 loading 图标
- leaderboard.json 未注册 ui-skeleton,骨架屏不渲染致 loading 期空白
- 注册 ui-skeleton,骨架屏恢复 shimmer
- 骨架屏上方加主题色旋转加载图标 + "加载中…"

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-25 14:21:04 +08:00
liucheng e712741425 feat(share): 启用全站系统分享 + 完善分享文案配置
- 各 Page 补齐 onShareAppMessage/onShareTimeline,修复右上角转发/朋友圈按钮灰色
- ui-btn 透传 open-type,完成弹窗接入分享按钮
- config.share 集中维护文案,动态标题用 titleTemplate 占位符
- leaderboard 的 myEntry.rank 缺失时回退静态标题,避免出现"排第 undefined"
- 完成弹窗分享按钮高度对齐 88rpx,与同排按钮等高

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-25 11:03:02 +08:00
lc 6176f2c341 feat(ui): 记录页月份联动与多项 UI 美化/修复
- records: 底部列表与月份选择器联动,新增 [本月|最近] 分段控件;标题/空态随模式切换
- leaderboard: 领奖台布局(冠军居中+皇冠)、次数标注于底座且三档水平对齐;头像 cloud:// 批量预解析提速(云函数需重新部署)
- index/timer: 主色底图标改白色变体修复隐形;目标数字按微信字体缩放补偿真机遮挡
- settings: 配色方案横滑渐变色卡;头像上传前压缩至 200px
- theme: 新增 teal 主题;暗黑背景统一对齐
- 圆形头像双保险(image 自身 border-radius)修复月/年榜方图

注: cloudfunctions/leaderboard 改动须在开发者工具重新部署才生效。
2026-07-22 09:36:22 +08:00
lc ac0db6118d feat(ui): 全项目暗黑模式适配 — 加 theme 变量 + 替换全部硬编码颜色
新增主题变量 (light + dark 两套):
- --success-rgb / --danger / --danger-rgb (utils/theme.js)

全部硬编码 #XXX / rgba 颜色统一改主题变量:
- progress-ring 加 trackColor prop,默认 #EEEEEE
  (canvas 不能直接读 CSS var,需要 caller 传字面颜色)
- ui-modal sheet 背景 #FFFFFF → var(--card-bg), 加底部 padding 避开 Dock TabBar
- ui-modal handle #DDD → var(--bg-soft)
- ui-btn --danger 文字 #E53935 → var(--danger), 边框 rgba(229,57,53,...) → rgba(var(--danger-rgb),...)
- calendar-heatmap 三个 #999/#333 文字色 → var(--text-secondary)/var(--text)
- index picker: preset/custom input 背景 #F5F5F5 → var(--bg-soft), label #666 → var(--text-secondary)
- index done-badge 绿色 → var(--success-rgb), pending-text #CCC → var(--text-secondary)
- records empty/hint #CCC/#E0E0E0 → var(--text-secondary), danger 红 → var(--danger)
- settings plan-editor-sheet 背景 #FFFFFF → var(--card-bg), avatar 背景, handle, editor-input, preview 全部跟进
- leaderboard 金/铜背景 #FFF7E6/#FFF1E6 → rgba 半透明 (dark mode 下不刺眼)

Tab bar inactive 图标重新根据 dark mode 切换颜色 (#999999 light / #98989F dark)

leaderboard.json 删除 backgroundColor: #F5F5F5 覆盖,让 theme.json 接管

故意保留:
- 各 .wxss 中渐变按钮上的 #FFFFFF 文字色
- 排行榜金/铜文字色 #FA8C16/#D46B08 (视觉符号约定)
- 各页 data 中 orange theme 默认值 (onShow 后被 themeMod 覆盖)
2026-07-08 15:22:09 +08:00
lc c0f7ca612c feat: 切深色模式时高亮/卡片元素加颜色过渡动画
.rank-item / .period-tab / .theme-item / .plan-item 加
transition: background-color 0.3s ease + border-color 0.3s ease。
切深色时不再瞬间切换,有 300ms 流动感。
2026-07-08 14:13:20 +08:00
lc 799d799bb9 fix: 深色模式下高亮/占位元素正确适配
修改:
- theme.js: 新增 --bg-soft 变量(浅色 #F0F0F0, 深色 #2C2C2E)
- settings.wxss: .theme-item.active / .plan-item.active
  改用 rgba(var(--primary-rgb), 0.12) 替代 var(--primary-bg)
- leaderboard.wxss:
  - .period-tabs 背景用 var(--card-bg) 替代 #FFFFFF
  - .rank-num / .rank-avatar 用 var(--bg-soft) 替代硬编码灰
  - .rank-item.is-me / .my-bar 用 rgba() 替代 var(--primary-bg)

根因: --primary-bg 是品牌色极浅版,深色模式下仍是浅色,
不适合做高亮底色。rgba() 在两种模式下都自适应。
2026-07-08 11:52:01 +08:00
lc 5bbd84868a feat: 空状态插画 (CSS 简笔平板支撑小人 + 主题色气泡) 2026-07-08 11:38:41 +08:00
lc f3b825bdf9 feat: 排行榜行依次滑入动画 (前 10 行 60ms 错开) 2026-07-08 11:38:24 +08:00
lc f904870cbc feat: leaderboard 页面接入骨架屏 2026-07-08 11:35:21 +08:00
lc 0bba403b00 feat: 页面级入场动画 (fade + translateY) 应用到 5 个页面 2026-07-08 11:33:29 +08:00
lc 9578273906 fix: 移除榜单失败toast,避免无数据时误导用户以为云端故障
日榜无数据是正常业务场景(用户当天未训练),弹toast会
让用户误解为系统故障。本地fallback已提供足够的降级体验。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-24 12:30:51 +08:00
lc 46738dd7cd fix: 榜单云函数失败时仅无数据才提示toast,避免已有数据时误弹
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-24 12:29:33 +08:00
lc d817d5d012 fix: 13项数据存储与排行榜修复
致命修复:
- leaderboard: 日榜日期比较改用 dateOnly() 替代严格全等
- plan: 计划天数计算日期比较改用 dateOnly()
- cloud: pullAll 添加 orderBy('updatedAt','desc') 确保取最新文档避免数据丢失

严重修复:
- cloud: 新增 cancelPendingPush() 防止清除数据后被延迟推送复活
- settings: _doClearData 补充 user_profile 清除, 先取消推送再清除
- app: 云端同步改为时间戳比对策略, 支持跨设备拉取
- app: _restoreFromCloud 增加空数据保护和 profile 恢复
- storage: 记录ID改用时间戳+自增计数器确保唯一性

中等修复:
- cloud: init/_fetchOpenid 日志升级, 新增 syncStatus getter
- leaderboard云函数: 添加90天活跃过滤减少全表扫描
- storage: validateStreak 增加lastDate无记录时的通用修复
- leaderboard页面: 云函数失败时Toast提示用户而非静默降级

轻微修复:
- timer: onUnload 添加 voice.destroy() 释放音频上下文
- records: onLongPressDelete 委托给 onDeleteRecord 消除重复代码

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-24 12:22:54 +08:00
lc 2e2594d154 feat: 修复清除数据、语音缓存、排行榜限制,新增项目配置文件
- 修复 cloud.clearAll 静默失败导致重启后数据恢复
- 清除数据弹窗改用自定义 ui-modal 替代 wx.showModal
- TTS 语音合成增加 fileID 持久化缓存,重启不再重新合成
- 排行榜限制前15名,maxRank 参数化到 config.js
- 新增 config.js 统一管理版本号/更新日期/开发者/排行榜限制
- progress-ring 消除 getSystemInfoSync 弃用警告
- voice.js 增加 InnerAudioContext 错误监听
- storage/util 完善用户资料、打卡日期精度、记录日志
2026-06-11 11:30:47 +08:00
lc 1d55df72b3 feat: v1.5 — plan editor, voice prompts, UI polish
Major features:
- Training plan editor: edit preset days/duration per plan (in-place
  override via custom_plans storage; preset ids preserved so existing
  records stay valid)
- Voice prompts at 4 fixed points during training (halfway / 30s /
  10s / done) via Tencent Cloud TTS (cloudfunctions/tts + utils/voice.js)
- Free-training button: switched from outline (transparent) to ghost
  variant (theme-tinted) for visual weight

Bug fixes:
- 4 functional pages: SVG data URIs failed to render in WeChat because
  '\#' in colors was parsed as a data-URI fragment delimiter. encode the
  whole SVG via encodeURIComponent in utils/icons.js build().
- Old records (saved before id field was added) could not be deleted
  (data-id was empty, triggered defensive guard). Backfill stable
  legacy-<month>-<index>-<duration> ids in getRecords() and persist.
- settings.js plan-row editor button event was bubbling up to the row's
  bindtap (which also fired onSelectPlan). Wrapped in catch:tap.

UI:
- Settings page: 3 hardcoded plans replaced with dynamic buildPlansList
  that overlays custom_plans on top of presets
- Plan editor: bottom-sheet modal in settings page (regular view, not
  ui-modal — WeChat custom component root element drops position:fixed
  in this runtime)
- Free-training button: rounded pill style, full-width, 24rpx gap from
  primary action; bottom sheet uses max-height: 88vh + internal scroll
- Version bumped to v1.5, last updated 2026-06-10

Removed:
- Daily reminder section (dailyReminder / reminderTime) — replaced by
  the 4 voice prompts which cover the same user need without requiring
  long-term scheduling that WeChat mini-programs can't actually do

Misc:
- utils/plan.js refactored to formula-driven: presets declare
  totalDays/startTarget/increment/cycleDays, days[] is generated. Same
  formula applies to custom plans.
- Timer _remind() guards each prompt on minimum duration so short
  free-mode sessions don't fire 'last30' at the start
- Cloud storage cloud_plans field added to data push payload; restored
  on first install via _restoreFromCloud
- .gitignore added for local AI tool caches (.reasonix/, reasonix.toml,
  .codegraph/daemon.pid)
2026-06-10 17:23:13 +08:00