feat: 新增客片案例与团队共创模块,重构玩法与配置
- 新增客片案例全流程功能,包含前台页面、管理端配置、后端API、数据库迁移与文档 - 新增团队共创详情页面与对应接口 - 重构玩法模块:将静态playData替换为动态API获取,拆分类型定义到playTypes.ts - 优化vite构建配置与环境变量处理,调整详情页操作栏文案 - 更新全量相关文档与配图,新增客片案例、团队共创API文档 - 新增测试用例,完善数据归一化逻辑 - 调整路由配置与环境变量示例文件
This commit is contained in:
1 parent
cda8069630
commit
7ba92f3c5d
76 files changed
+7970
-137
No files matched your search
@@ -25,3 +25,103 @@ def lead_dict(lead) -> dict:
|
||||
lead,
|
||||
{"assignedUser": {"id": lead.assignedUser.id, "name": lead.assignedUser.name} if lead.assignedUser else None},
|
||||
)
|
||||
|
||||
|
||||
def public_wanfa_route_dict(route) -> dict:
|
||||
return {
|
||||
"id": route.id,
|
||||
"title": route.title,
|
||||
"subtitle": route.subtitle,
|
||||
"image": route.image,
|
||||
"routeCount": route.routeCount,
|
||||
"demandKeyword": route.demandKeyword,
|
||||
}
|
||||
|
||||
|
||||
def public_wanfa_category_dict(category) -> dict:
|
||||
return {
|
||||
"id": category.id,
|
||||
"label": category.label,
|
||||
"routes": [public_wanfa_route_dict(route) for route in category.routes],
|
||||
}
|
||||
|
||||
|
||||
def public_home_wanfa_recommendation_dict(item) -> dict:
|
||||
return {
|
||||
"id": item.id,
|
||||
"categoryId": item.category.id,
|
||||
"label": item.category.label,
|
||||
"routes": [public_wanfa_route_dict(route) for route in item.category.routes],
|
||||
}
|
||||
|
||||
|
||||
def concierge_advisor_dict(advisor) -> dict:
|
||||
return model_dict(advisor)
|
||||
|
||||
|
||||
def public_concierge_advisor_dict(advisor) -> dict:
|
||||
return {
|
||||
"avatar": advisor.avatar,
|
||||
"name": advisor.name,
|
||||
"role": advisor.role,
|
||||
"details": advisor.details or [],
|
||||
"qrImage": advisor.qrImage,
|
||||
}
|
||||
|
||||
|
||||
def public_home_experience_dict(item) -> dict:
|
||||
return {
|
||||
"id": item.id,
|
||||
"badge": item.badge,
|
||||
"category": item.category,
|
||||
"title": item.title,
|
||||
"englishTitle": item.englishTitle,
|
||||
"image": item.image,
|
||||
"demandKeyword": item.demandKeyword,
|
||||
}
|
||||
|
||||
|
||||
def public_home_team_building_dict(item) -> dict:
|
||||
return {
|
||||
"id": item.id,
|
||||
"tag": item.tag,
|
||||
"title": item.title,
|
||||
"description": item.description,
|
||||
"image": item.image,
|
||||
"demandKeyword": item.demandKeyword,
|
||||
}
|
||||
|
||||
|
||||
def public_home_team_building_detail_dict(item) -> dict:
|
||||
paragraphs = [
|
||||
paragraph.strip()
|
||||
for paragraph in (getattr(item, "detailParagraphs", None) or [])
|
||||
if isinstance(paragraph, str) and paragraph.strip()
|
||||
]
|
||||
if not paragraphs:
|
||||
paragraphs = [item.description]
|
||||
return {
|
||||
**public_home_team_building_dict(item),
|
||||
"detailSubtitle": (getattr(item, "detailSubtitle", None) or item.description).strip(),
|
||||
"detailParagraphs": paragraphs,
|
||||
}
|
||||
|
||||
|
||||
def public_home_wild_archive_dict(item) -> dict:
|
||||
return {
|
||||
"id": item.id,
|
||||
"title": item.title,
|
||||
"image": item.image,
|
||||
"demandKeyword": item.demandKeyword,
|
||||
"photoCount": len(item.images or [item.image]),
|
||||
}
|
||||
|
||||
|
||||
def public_home_wild_archive_detail_dict(item) -> dict:
|
||||
images = [image for image in (item.images or []) if isinstance(image, str) and image.strip()]
|
||||
if not images:
|
||||
images = [item.image]
|
||||
return {
|
||||
**public_home_wild_archive_dict(item),
|
||||
"images": images,
|
||||
}
|
||||
Reference in new issue
Block a user