修改过时文档,优化文档内容
This commit is contained in:
25
pages/mall/delivery/doc/old(弃用)/profile-edit.md
Normal file
25
pages/mall/delivery/doc/old(弃用)/profile-edit.md
Normal 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,保存时与后端约定格式以支持范围匹配。
|
||||
|
||||
Reference in New Issue
Block a user