修改过时文档,优化文档内容

This commit is contained in:
not-like-juvenile
2026-03-17 11:06:26 +08:00
parent dac730474b
commit f33efe6ec8
45 changed files with 162 additions and 236 deletions

View File

@@ -0,0 +1,25 @@
# 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保存时与后端约定格式以支持范围匹配。