# 即时配送小程序 - API 接口文档

**约定**：管理端 `POST /admin/ot/...`，小程序 `GET|POST /app/ot/...`，鉴权：`appJwt`（C端/配送员）、`adminJwt`（后台）。

**通用响应**：`{ "code": 1000, "message": "success", "data": {} }`
**错误码**：`1001` 参数错误、`4010` 未登录、`4030` 无权限、`4090` 状态冲突

---

## 1. 用户端 - 订单

### 1.1 发单

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /app/ot/order/quote | 费用试算 |
| POST | /app/ot/order/create | 创建订单 |
| POST | /app/ot/order/pay | 支付订单 |
| POST | /app/ot/order/cancel | 取消订单 |

### 1.2 订单查询

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/order/page | 订单列表 |
| GET | /app/ot/order/detail | 订单详情 |
| GET | /app/ot/order/trace | 订单轨迹 |

### 1.3 订单操作

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /app/ot/order/confirm | 确认完成 |
| POST | /app/ot/order/rate | 评价订单 |
| POST | /app/ot/order/remind | 催单 |

---

## 2. 用户端 - 地址

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/address/page | 地址列表 |
| POST | /app/ot/address/add | 添加地址 |
| POST | /app/ot/address/update | 更新地址 |
| POST | /app/ot/address/delete | 删除地址 |
| POST | /app/ot/address/setDefault | 设置默认 |

---

## 3. 用户端 - 会员与积分

### 3.1 会员

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/member/info | 会员信息 |
| GET | /app/ot/member/level | 等级权益 |
| GET | /app/ot/member/growth | 成长值明细 |

### 3.2 积分

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/point/balance | 积分余额 |
| GET | /app/ot/point/log | 积分明细 |
| POST | /app/ot/point/sign | 每日签到 |
| POST | /app/ot/point/deduct | 积分抵扣 |

---

## 4. 用户端 - 红包与优惠券

### 4.1 红包

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/redpacket/my | 我的红包列表 |
| GET | /app/ot/redpacket/available | 可用红包列表 |
| POST | /app/ot/redpacket/exchange | 兑换码兑换 |
| POST | /app/ot/redpacket/use | 使用红包(下单时) |

### 4.2 优惠券

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/coupon/my | 我的优惠券列表 |
| GET | /app/ot/coupon/available | 可用优惠券列表 |
| POST | /app/ot/coupon/claim | 领取优惠券 |
| POST | /app/ot/coupon/exchange | 积分兑换优惠券 |

---

## 5. 用户端 - 钱包

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/wallet/info | 钱包信息 |
| POST | /app/ot/wallet/recharge | 余额充值 |
| GET | /app/ot/wallet/log | 流水记录 |

---

## 6. 用户端 - 积分商城

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/mall/goods | 商品列表 |
| GET | /app/ot/mall/goods/detail | 商品详情 |
| POST | /app/ot/mall/order/create | 兑换订单 |
| GET | /app/ot/mall/order/page | 兑换记录 |
| GET | /app/ot/mall/order/detail | 订单详情 |

---

## 7. 用户端 - 帮助与客服

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/help/faq | 常见问题 |
| POST | /app/ot/feedback/add | 提交反馈 |
| GET | /app/ot/feedback/page | 反馈记录 |
| POST | /app/ot/complaint/add | 提交投诉 |

---

## 8. 配送员端 - 认证

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /app/ot/courier/register | 骑手注册 |
| POST | /app/ot/courier/verify | 提交认证资料 |
| GET | /app/ot/courier/status | 认证状态 |

---

## 9. 配送员端 - 订单

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/courier/order/hall | 订单大厅(待抢) |
| POST | /app/ot/courier/order/grab | 抢单 |
| GET | /app/ot/courier/order/page | 我的订单 |
| GET | /app/ot/courier/order/detail | 订单详情 |

---

## 10. 配送员端 - 任务执行

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /app/ot/courier/order/accept | 确认接单 |
| POST | /app/ot/courier/order/pick | 确认取件 |
| POST | /app/ot/courier/order/deliver | 确认送达 |
| POST | /app/ot/courier/order/cancel | 取消订单 |

---

## 11. 配送员端 - 位置

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /app/ot/courier/location/update | 上报位置 |
| POST | /app/ot/courier/location/setting | 位置设置 |
| GET | /app/ot/courier/location/current | 当前状态 |

---

## 12. 配送员端 - 钱包

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/courier/wallet/info | 钱包信息 |
| POST | /app/ot/courier/withdraw/apply | 申请提现 |
| GET | /app/ot/courier/withdraw/page | 提现记录 |

---

## 13. 配送员端 - 统计

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /app/ot/courier/stat/today | 今日统计 |
| GET | /app/ot/courier/stat/week | 本周统计 |
| GET | /app/ot/courier/stat/month | 本月统计 |

---

## 14. 管理端 - 订单管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/order/page | 订单列表 |
| POST | /admin/ot/order/detail | 订单详情 |
| POST | /admin/ot/order/export | 订单导出 |
| POST | /admin/ot/order/cancel | 取消订单 |
| POST | /admin/ot/order/assign | 重新指派 |

---

## 15. 管理端 - 调度中心

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /admin/ot/dispatch/pending | 待调度订单 |
| GET | /admin/ot/dispatch/assigned | 已调度订单 |
| POST | /admin/ot/dispatch/assign | 派单 |
| POST | /admin/ot/dispatch/revoke | 撤回派单 |

---

## 16. 管理端 - 配送员管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/courier/page | 骑手列表 |
| POST | /admin/ot/courier/detail | 骑手详情 |
| POST | /admin/ot/courier/verify | 审核认证 |
| POST | /admin/ot/courier/status | 修改状态 |
| POST | /admin/ot/courier/stat | 骑手统计 |

---

## 17. 管理端 - 实时监控

| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /admin/ot/monitor/courier/all | 所有骑手位置 |
| GET | /admin/ot/monitor/courier/one | 单个骑手位置 |
| GET | /admin/ot/monitor/courier/trace | 骑手历史轨迹 |
| GET | /admin/ot/monitor/courier/stats | 骑手状态统计 |
| GET | /admin/ot/monitor/order/stats | 订单实时统计 |

---

## 18. 管理端 - 用户管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/user/page | 用户列表 |
| POST | /admin/ot/user/detail | 用户详情 |
| POST | /admin/ot/user/member | 会员信息 |
| POST | /admin/ot/user/point | 积分调整 |

---

## 19. 管理端 - 会员管理

### 19.1 等级管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/level/page | 等级列表 |
| POST | /admin/ot/level/add | 添加等级 |
| POST | /admin/ot/level/update | 编辑等级 |
| POST | /admin/ot/level/delete | 删除等级 |

### 19.2 积分规则

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/point/rule/page | 规则列表 |
| POST | /admin/ot/point/rule/add | 添加规则 |
| POST | /admin/ot/point/rule/update | 编辑规则 |
| POST | /admin/ot/point/log/page | 积分记录 |

---

## 20. 管理端 - 红包管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/redpacket/page | 红包列表 |
| POST | /admin/ot/redpacket/add | 创建红包 |
| POST | /admin/ot/redpacket/update | 编辑红包 |
| POST | /admin/ot/redpacket/delete | 删除红包 |
| POST | /admin/ot/redpacket/grant | 发放红包 |
| POST | /admin/ot/redpacket/batch | 批量发放 |
| POST | /admin/ot/redpacket/code | 生成兑换码 |
| POST | /admin/ot/redpacket/record/page | 发放记录 |

---

## 21. 管理端 - 优惠券管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/coupon/page | 优惠券列表 |
| POST | /admin/ot/coupon/add | 创建优惠券 |
| POST | /admin/ot/coupon/update | 编辑优惠券 |
| POST | /admin/ot/coupon/delete | 删除优惠券 |
| POST | /admin/ot/coupon/grant | 发放优惠券 |
| POST | /admin/ot/coupon/record/page | 发放记录 |

---

## 22. 管理端 - 积分商城

### 22.1 商品管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/mall/goods/page | 商品列表 |
| POST | /admin/ot/mall/goods/add | 添加商品 |
| POST | /admin/ot/mall/goods/update | 编辑商品 |
| POST | /admin/ot/mall/goods/delete | 删除商品 |
| POST | /admin/ot/mall/goods/sort | 商品排序 |

### 22.2 订单管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/mall/order/page | 兑换订单列表 |
| POST | /admin/ot/mall/order/detail | 订单详情 |
| POST | /admin/ot/mall/order/ship | 发货 |
| POST | /admin/ot/mall/order/receive | 确认收货 |

---

## 23. 管理端 - 财务管理

### 23.1 用户钱包

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/wallet/page | 钱包列表 |
| POST | /admin/ot/wallet/log/page | 流水记录 |
| POST | /admin/ot/wallet/adjust | 余额调整 |

### 23.2 充值管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/recharge/page | 充值记录 |
| POST | /admin/ot/recharge/detail | 充值详情 |

### 23.3 提现管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/withdraw/page | 提现申请列表 |
| POST | /admin/ot/withdraw/approve | 审核通过 |
| POST | /admin/ot/withdraw/reject | 审核拒绝 |
| POST | /admin/ot/withdraw/paid | 已打款 |

---

## 24. 管理端 - 客服管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/feedback/page | 反馈列表 |
| POST | /admin/ot/feedback/reply | 回复反馈 |
| POST | /admin/ot/complaint/page | 投诉列表 |
| POST | /admin/ot/complaint/handle | 处理投诉 |

---

## 25. 管理端 - 系统设置

### 25.1 分类管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/category/page | 分类列表 |
| POST | /admin/ot/category/add | 添加分类 |
| POST | /admin/ot/category/update | 编辑分类 |

### 25.2 运费规则

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/fare/rule/page | 规则列表 |
| POST | /admin/ot/fare/rule/add | 添加规则 |
| POST | /admin/ot/fare/rule/update | 编辑规则 |

### 25.3 配送区域

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/region/page | 区域列表 |
| POST | /admin/ot/region/add | 添加区域 |
| POST | /admin/ot/region/update | 编辑区域 |

### 25.4 公告管理

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /admin/ot/announcement/page | 公告列表 |
| POST | /admin/ot/announcement/add | 添加公告 |
| POST | /admin/ot/announcement/update | 编辑公告 |
| POST | /admin/ot/announcement/delete | 删除公告 |

---

## 26. 服务端 - 回调

| 方法 | 路径 | 说明 |
|------|------|------|
| POST | /server/ot/callback/pay | 支付回调 |
| POST | /server/ot/callback/location | 位置推送回调 |

---

## 27. 页面-接口映射

| 页面 | 主接口 |
|------|--------|
| 发单页 | /app/ot/order/create, /app/ot/order/quote |
| 订单列表 | /app/ot/order/page |
| 订单详情 | /app/ot/order/detail, /app/ot/order/trace |
| 会员中心 | /app/ot/member/info, /app/ot/point/balance |
| 积分商城 | /app/ot/mall/goods |
| 我的红包 | /app/ot/redpacket/my |
| 骑手首页 | /app/ot/courier/stat/today |
| 订单大厅 | /app/ot/courier/order/hall |
| 管理后台调度 | /admin/ot/monitor/courier/all |
| 管理后台红包 | /admin/ot/redpacket/page |

---

**文档版本**：v3.0
**创建日期**：2026-04-01
