feat: 补全剩余 6 个 StreamField Block 前端渲染 (ProductCard/Pricing/Timeline/Team/TechStack/Video)

- types/wagtail.ts 新增对应 6 个 Block 值类型接口及 StreamFieldBlock 联合类型分支
- 新建 6 个渲染组件:ProductCardGrid/Pricing/Timeline/Team/TechStack/Video,风格与既有 Block 一致
- BlockRenderer.tsx 映射表接入新组件,key 与后端 COMMON_BLOCKS 保持一致
- lint/build 均验证通过
This commit is contained in:
2026-08-07 15:59:08 +08:00
parent 2457d5ec69
commit 4bbd6947da
8 changed files with 314 additions and 1 deletions
+70
View File
@@ -103,6 +103,70 @@ export interface FormBlockValue {
form: FormDefinitionValue | null;
}
export interface ProductCardItemValue {
title: string;
description?: string;
image?: { url: string; title: string } | null;
link?: string;
}
export interface ProductCardBlockValue {
heading?: string;
items: ProductCardItemValue[];
}
export interface PricingPlanValue {
name: string;
price: string;
features: string[];
highlighted?: boolean;
button?: CTAButtonValue | null;
}
export interface PricingBlockValue {
heading?: string;
plans: PricingPlanValue[];
}
export interface TimelineItemValue {
year: string;
event: string;
}
export interface TimelineBlockValue {
heading?: string;
items: TimelineItemValue[];
}
export interface TeamMemberBlockValue {
id: number;
name: string;
role: string;
bio: string;
photo: { url: string; title: string } | null;
}
export interface TeamBlockValue {
heading?: string;
members: TeamMemberBlockValue[];
}
export interface TechStackItemValue {
icon?: string;
label: string;
}
export interface TechStackBlockValue {
heading?: string;
items: TechStackItemValue[];
}
export interface VideoBlockValue {
heading?: string;
video_url: string;
poster?: { url: string; title: string } | null;
}
export type StreamFieldBlock =
| { id: string; type: "hero"; value: HeroBlockValue }
| { id: string; type: "stats"; value: StatsBlockValue }
@@ -112,6 +176,12 @@ export type StreamFieldBlock =
| { id: string; type: "logo_cloud"; value: LogoCloudBlockValue }
| { id: string; type: "case_study"; value: CaseStudyBlockValue }
| { id: string; type: "form"; value: FormBlockValue }
| { id: string; type: "product_card"; value: ProductCardBlockValue }
| { id: string; type: "pricing"; value: PricingBlockValue }
| { id: string; type: "timeline"; value: TimelineBlockValue }
| { id: string; type: "team"; value: TeamBlockValue }
| { id: string; type: "tech_stack"; value: TechStackBlockValue }
| { id: string; type: "video"; value: VideoBlockValue }
| { id: string; type: "richtext"; value: string };
export interface HomePageDetail extends WagtailPageSummary {