elderly-health-platform/elderly-health-app/README.md
2026-10-16 20:17:14 +08:00

63 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# elderly-health-app(老年健康档案 · 移动端)
基于 **uni-app + Vue 3 + Vite** 的移动端工程,Phase 1 负责「老年人信息采集」。
## 技术栈
| 项 | 说明 |
| --- | --- |
| 框架 | uni-app `3.0.0-5020620260917001`(官方模板 `dcloudio/uni-preset-vue#vite`) |
| UI 框架 | Vue 3 + uni-app 内置组件 |
| 构建 | Vite 5.2.8 |
| 运行形态 | Phase 1 只启用 H5;Android / 小程序后续阶段再补平台依赖 |
## 启动
```powershell
pnpm install
pnpm dev:h5 # http://localhost:48082
```
后端地址在 `src/config/index.js` 中配置,默认 `http://localhost:48080`,
所有请求走 `/app-api`(不使用 `/admin-api`)。
## 目录结构
```
elderly-health-app
├── src
│ ├── api # 接口封装:auth / elderly / dict
│ ├── config # 后端地址、租户编号
│ ├── pages
│ │ ├── login # 登录
│ │ ├── home # 首页
│ │ ├── profile # edit 信息采集 / detail 我的档案
│ │ └── health # index 健康数据 / add 新增测量 / history 历史记录 /
│ │ # detail 记录详情 / trend 健康趋势
│ ├── store # 登录态存储
│ ├── utils # request 请求封装、日期格式化
│ ├── App.vue
│ ├── main.js
│ ├── manifest.json
│ └── pages.json
├── index.html
├── package.json
└── vite.config.js
```
## 说明
- 登录复用芋道「会员(member)」体系:`POST /app-api/member/auth/login`
- 老人档案接口:`GET/POST/PUT /app-api/elderly/profile`,身份取自登录态,不接收老人编号参数
- 下拉选项复用芋道「字典管理」:`GET /app-api/system/dict-data/type?type=elderly_xxx`
- 省 / 市 / 区当前为文本输入:uni-app 的 `mode="region"` 在 H5 端没有内置行政区划数据,
芋道的 `system_area` 表在本阶段也未初始化,因此先用文本录入,后续阶段再替换为地区选择器
## 健康数据(Phase 2)
- 接口前缀:`/app-api/elderly/health-record`
- 前端只提交原始测量值(身高、体重、血压、心率、腰围、小腿围);
`bmi`、`bmiLevel`、`bpLevel` 一律由后端计算后写入
- 测量时间按芋道统一约定使用**毫秒时间戳**(`LocalDateTime` ↔ epoch millis)
- 趋势图为项目自绘的柱状图组件,未引入第三方图表库,支持体重 / BMI / 血压三个维度