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

26 lines
870 B
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-edit.uvue — 编辑资料
## 概要
编辑配送员个人资料(姓名、电话、头像、服务区域、车辆信息等),并将修改提交到后端保存。
## 数据结构
- `ProfileForm`
- `real_name`, `phone`, `avatar_url`, `service_areas[]`, `vehicle`{
`type`, `model`, `plate_no`
}
## 关键方法
- `chooseAvatar()``uni.chooseImage` 获取本地图片并调用 `uploadAvatar()` 上传。
- `uploadAvatar(file)`:上传到文件存储并返回 URL更新 `form.avatar_url`
- `saveProfile()`:表单校验后调用后端 API 更新 `ml_delivery_drivers``users` 表。
## 接口示例
```
await api.put('/driver/profile', { ...form })
```
## 注意事项
- 上传图片应限制大小并在客户端压缩以减少带宽。
- 服务区域通常是数组或 GeoJSON保存时与后端约定格式以支持范围匹配。