Files
medical-mall/pages/mall/delivery/doc/old/profile.md
2026-02-06 15:10:18 +08:00

27 lines
1.1 KiB
Markdown
Raw 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.
# profile.uvue — 个人中心
## 概要
配送员个人中心,展示司机基本信息、当前工作状态、统计摘要(今日订单/收入)、常用入口(车辆管理/收入/设置/帮助)以及最近任务预览。
## 数据结构
- `DriverInfo`
- `id`, `user_id`, `real_name`, `avatar_url`, `work_status`, `rating`, `vehicle`(简要信息)
## 关键方法
- `loadDriverInfo()`:从 `ml_delivery_drivers``users` 表加载司机信息并设置 `driverInfo`
- `toggleWorkStatus()`:切换上线/下线并触发 `loadAvailableOrders()`(上线时)。
- `relocate()`:请求定位权限并更新司机服务位置(可调用后端保存)。
## 交互示例
```
async toggleWorkStatus() {
await supa.from('ml_delivery_drivers').update({ work_status: newStatus }).eq('id', driverInfo.id)
this.driverInfo.work_status = newStatus
}
```
## 注意事项
- 工作状态变更应通知后端并尽量在服务端发出状态变更事件WebSocket/推送)。
- 个人信息编辑应跳转到 `profile-edit`,并在保存后同步更新本页缓存。