feat: add products/cases pages and lead-capture form block

- types: Product/CaseStudy page types, CaseStudyBlockValue, FormBlockValue
- services: product.service.ts, case.service.ts
- app/products, app/cases: list + detail pages
- blocks: CaseStudyCard, LeadForm (submits to /api/v1/custom/leads/)
- Header nav: add 产品/案例 links
This commit is contained in:
2026-08-06 16:04:43 +08:00
parent 7e30631c68
commit b5fe5e13ab
11 changed files with 391 additions and 1 deletions
+49
View File
@@ -75,6 +75,34 @@ export interface LogoCloudBlockValue {
logos: { url: string; title: string }[];
}
export interface CaseStudyBlockValue {
case_page: WagtailPageSummary | null;
summary?: string;
}
/** 与后端 apps/forms/models.py FIELD_TYPE_CHOICES 保持一致 */
export type FormFieldType = "text" | "textarea" | "email" | "tel" | "select";
export interface FormFieldDef {
label: string;
field_key: string;
field_type: FormFieldType;
required: boolean;
choices: string[];
}
export interface FormDefinitionValue {
id: number;
name: string;
submit_button_text: string;
success_message: string;
fields: FormFieldDef[];
}
export interface FormBlockValue {
form: FormDefinitionValue | null;
}
export type StreamFieldBlock =
| { id: string; type: "hero"; value: HeroBlockValue }
| { id: string; type: "stats"; value: StatsBlockValue }
@@ -82,6 +110,8 @@ export type StreamFieldBlock =
| { id: string; type: "faq"; value: FAQBlockValue }
| { id: string; type: "cta"; value: CTABlockValue }
| { id: string; type: "logo_cloud"; value: LogoCloudBlockValue }
| { id: string; type: "case_study"; value: CaseStudyBlockValue }
| { id: string; type: "form"; value: FormBlockValue }
| { id: string; type: "richtext"; value: string };
export interface HomePageDetail extends WagtailPageSummary {
@@ -98,3 +128,22 @@ export interface BlogPageSummary extends WagtailPageSummary {
export interface BlogPageDetail extends BlogPageSummary {
body: StreamFieldBlock[];
}
export interface ProductPageSummary extends WagtailPageSummary {
summary?: string;
}
export interface ProductPageDetail extends ProductPageSummary {
body: StreamFieldBlock[];
}
export interface CaseStudyPageSummary extends WagtailPageSummary {
client_name: string;
industry?: string;
published_at?: string;
summary?: string;
}
export interface CaseStudyPageDetail extends CaseStudyPageSummary {
body: StreamFieldBlock[];
}