Files
akmon/student_detail_fields_reference.md
2026-01-20 08:04:15 +08:00

72 lines
2.6 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.
# 学生详情页面字段参考
## 数据库字段对应关系 (ak_users表)
### 基本信息字段
- `id` (uuid) - 用户唯一标识符
- `username` (varchar) - 用户名/姓名,显示为学生姓名
- `email` (varchar) - 邮箱地址,必填字段
- `phone` (text) - 电话号码,在界面中用作学号显示
- `avatar_url` (text) - 头像URL地址
- `gender` (varchar) - 性别 (male/female/other)
- `birthday` (date) - 生日
- `height_cm` (integer) - 身高(厘米)
- `weight_kg` (integer) - 体重(公斤)
- `bio` (text) - 个人简介
- `created_at` (timestamp) - 注册时间
- `updated_at` (timestamp) - 更新时间
### 关联字段
- `school_id` (uuid) - 学校ID外键关联ak_schools表
- `grade_id` (uuid) - 年级ID外键关联ak_grades表
- `class_id` (uuid) - 班级ID外键关联ak_classes表
- `role` (varchar) - 用户角色,学生为'student'
### 健康数据字段(当前为模拟数据)
- `latest_temperature` - 最新体温
- `temperature_time` - 体温测量时间
- `latest_heart_rate` - 最新心率
- `heart_rate_time` - 心率测量时间
- `latest_oxygen_level` - 最新血氧
- `oxygen_level_time` - 血氧测量时间
- `latest_steps` - 最新步数
- `steps_time` - 步数统计时间
## 页面显示逻辑
### 学生基本信息卡片
- 显示头像(有则显示图片,无则显示首字母)
- 学生姓名 (username)
- 学号 (phone字段)
- 邮箱 (email)
- 性别 (gender转换为中文显示)
- 生日 (birthday格式化显示)
- 身高体重 (height_cm, weight_kg)
- 个人简介 (bio如果有的话)
- 注册时间 (created_at)
### 健康数据卡片
- 体温监测卡片 - 显示最新体温和状态
- 心率监测卡片 - 显示最新心率和状态
- 血氧监测卡片 - 显示最新血氧和状态
- 步数统计卡片 - 显示今日步数
### 健康状态判断标准
- **体温**: 36.0-37.5°C为正常超出范围为异常
- **心率**: 60-100 bpm为正常超出范围为异常
- **血氧**: ≥95%为正常,<95%为异常
## 查询逻辑
- 根据student_id查询ak_users表获取学生基本信息
- 过滤条件: role='student' 确保只查询学生用户
- 健康数据目前使用模拟数据,如需接入真实数据需完善健康数据表和视图
## 错误处理
- 学生不存在时显示"未找到该学生信息"
- 网络错误时显示"网络错误,请稍后重试"并提供重试按钮
- 字段为空时显示"未设置"或相应的默认值
## 导航功能
- 查看健康历史数据 - 跳转到 `/pages/sport/teacher/student-health-history?id=${studentId}`
- 查看训练记录 - 跳转到 `/pages/sport/teacher/student-training-records?id=${studentId}`