Update API endpoints and enhance UI components. Changed appid in manifest.json, modified profile and log update methods from PUT to POST in profile.js and smoke.js, respectively. Added new statistics retrieval function in smoke.js and improved the smoke record dialog with updated styles and validation logic. Updated configuration for development environment and refined documentation for health recovery and savings calculations.
This commit is contained in:
+9
-8
@@ -32,6 +32,7 @@
|
||||
| 下次建议时间 | 显示建议的下次抽烟时间点 | `GET /next_smoke_time` |
|
||||
| 今日已抽 | X / 目标数,较昨日 ±N | `next_smoke_time.today_count` + `next_smoke_time.reduced_from_yesterday`(可为负) + `next_smoke_time.exceeded_yesterday`(标识“超出昨日”) |
|
||||
| 烟瘾发作已抵抗 | 忍住次数统计 | `next_smoke_time.resisted_count` |
|
||||
| 激励语 | 当天一句话鼓励 | `GET /motivation` |
|
||||
| 记录抽烟按钮 | 快速记录一次抽烟 | `POST /logs` |
|
||||
| 想抽忍住了按钮 | 记录成功抵抗 | `POST /logs/resisted` |
|
||||
|
||||
@@ -46,15 +47,15 @@
|
||||
|
||||
| 功能 | 说明 | 数据来源 |
|
||||
|------|------|----------|
|
||||
| 周/月/年切换 | 切换统计时间范围 | `GET /dashboard?start=&end=` |
|
||||
| 周/月/年切换 | 切换统计时间范围 | `GET /stats?range=week|month|year` |
|
||||
| 每周洞察 | AI 分析本周表现 | `GET /ai/advice` |
|
||||
| 吸烟趋势图 | 柱状图展示每日吸烟量 | `dashboard.weekly` |
|
||||
| 趋势对比 | 较上周减少 X% | 本地计算 |
|
||||
| 日均吸烟量 | 统计周期内日均值 | 本地计算 |
|
||||
| 节省金额 | 基于减少量 × 单价计算 | profile + logs |
|
||||
| 肺部功能恢复 | 根据戒烟天数估算 | 固定公式 |
|
||||
| 连续记录天数 | 用户活跃天数 | logs 统计 |
|
||||
| 已拒绝次数 | 累计忍住次数 | `level=0,num=0` 统计 |
|
||||
| 吸烟趋势图 | 柱状图展示每日吸烟量 | `stats.trend` |
|
||||
| 趋势对比 | 较上周期变化 | `stats.change_percent` |
|
||||
| 日均吸烟量 | 统计周期内日均值 | `stats.daily_average` |
|
||||
| 节省金额 | 后端统一计算 | `stats.money` |
|
||||
| 肺部功能恢复 | 后端统一计算 | `stats.health` |
|
||||
| 连续记录天数 | 用户活跃天数 | `stats.streak_days` |
|
||||
| 已拒绝次数 | 累计忍住次数 | `stats.resisted_total` |
|
||||
|
||||
### 2.3 AI 助手页 (ai_quit_assistant)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user