feat: 新增用车需求服务及线索管理全功能

- 新增后台用车服务配置模块,支持维护服务简介、优势与使用流程
- 新增需求线索管理页面,支持筛选、查看与更新用车线索状态
- 新增小程序用车需求页面,优化登录路径与回跳逻辑
- 优化车型卡片跳转与用车需求提交功能
- 新增服务端API与数据处理逻辑,完善权限校验
- 更新全站配置与API文档,新增相关测试用例
This commit is contained in:
duanshuwen
2026-08-22 21:48:08 +08:00
parent b7a81964c9
commit d42f69bd47
36 changed files with 1290 additions and 33 deletions

View File

@@ -30,7 +30,7 @@
## 站点配置
`GET /api/public/site-config` 返回以下稳定数组字段:
`GET /api/public/site-config` 返回以下稳定字段:
```ts
type SiteConfig = {
@@ -40,11 +40,51 @@ type SiteConfig = {
demandHero: DemandHero[];
demandFeatureCards: DemandFeatureCard[];
demandForm: DemandForm[];
vehicleService: VehicleService | null;
};
type VehicleService = {
id: string;
introTitle: string;
intro: string;
serviceSections: Array<{ title: string; description: string }>;
advantages: string[];
processSteps: Array<{ title: string; description: string }>;
};
```
Public 响应只返回启用内容,其余模块按 `isActive` 过滤。
`vehicleService` 是用车需求页的启用单例配置;未配置或停用时返回 `null`,MiniAPP 使用本地安全文案兜底,不代表实时库存、价格或订单承诺。
### 用车需求提交
`POST /api/public/leads` 的通用线索仍允许游客提交;`leadType=vehicle` 必须携带客户 JWT。服务端从 JWT 写入 `customerId`,客户端不得传入该字段。
```json
{
"leadType": "vehicle",
"contactName": "联系人",
"phone": "13800000000",
"sourcePage": "home-vehicle",
"vehicleDemand": {
"serviceType": "charter",
"charterDuration": "fullDay",
"travelDate": "2026-08-25",
"pickupTime": "09:00",
"pickupLocation": "贵阳北站",
"dropoffLocation": "黄果树景区",
"peopleCount": 5,
"luggageCount": 3,
"vehicleOptionId": "vehicle-option-uuid",
"vehicleOptionTitle": "多人商务车",
"specialRequirements": "需要儿童座椅"
}
}
```
服务端从 `vehicleDemand` 归一化 `destination`、`travelDate` 和 `peopleCount` 摘要字段。未登录、参数不完整或服务异常分别返回 `401`、`422`、`500`,失败时 `data` 为 `null`。
## 玩法展示
### `GET /api/public/wanfa/categories`