feat: 新增用车需求服务及线索管理全功能
- 新增后台用车服务配置模块,支持维护服务简介、优势与使用流程 - 新增需求线索管理页面,支持筛选、查看与更新用车线索状态 - 新增小程序用车需求页面,优化登录路径与回跳逻辑 - 优化车型卡片跳转与用车需求提交功能 - 新增服务端API与数据处理逻辑,完善权限校验 - 更新全站配置与API文档,新增相关测试用例
This commit is contained in:
@@ -49,4 +49,33 @@ describe("WonderQ shared data helpers", () => {
|
||||
expect(getSubmitErrorMessage(new Error("网络异常"))).toBe("网络异常");
|
||||
expect(getSubmitErrorMessage("unknown")).toBe("提交失败,请稍后再试。");
|
||||
});
|
||||
|
||||
it("normalizes the vehicle service module and falls back incomplete sections", () => {
|
||||
const config: PublicSiteConfig = {
|
||||
vehicleService: {
|
||||
id: "vehicle-service-1",
|
||||
introTitle: "旅游专属用车",
|
||||
intro: " 提交需求后由管家跟进。 ",
|
||||
serviceSections: [{ title: " 包车服务 ", description: " 灵活安排 " }],
|
||||
advantages: [" 车型齐全 ", ""],
|
||||
processSteps: [{ title: "提交需求", description: " 填写出行信息 " }],
|
||||
isActive: true,
|
||||
},
|
||||
};
|
||||
|
||||
const data = normalizeSiteConfig(config, fallbackData);
|
||||
|
||||
expect(data.vehicleService).toMatchObject({
|
||||
id: "vehicle-service-1",
|
||||
introTitle: "旅游专属用车",
|
||||
intro: "提交需求后由管家跟进。",
|
||||
advantages: ["车型齐全"],
|
||||
});
|
||||
expect(data.vehicleService.serviceSections).toEqual([
|
||||
{ title: "包车服务", description: "灵活安排" },
|
||||
]);
|
||||
expect(data.vehicleService.processSteps).toEqual([
|
||||
{ title: "提交需求", description: "填写出行信息" },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user