'use client'; /** * CaseStudiesSection — L3 信任层「客户案例」共享区块(B-2 合并自 3 份本地实现) * * 合并来源与差异消解(2026-09-02,修订方案 B' 第二步): * - solution-detail-content-v3 / product-detail-content-v3 的本地实现原本 ~95% 相同, * 仅 section 底色(bg-white vs bg-bg-primary)与 h2 文案不同 → 统一为 token 底色 * (bg-bg-primary:浅色与 bg-white 视觉零差异,深色模式正确反色), * h2 文案改由 heading prop 传入(solution 传「同行业落地案例」,product 用默认「客户案例」)。 * - service-detail-content-v4 的本地实现是异类(motion.a 链接 /cases/、无 SectionLabel、 * 动效 0.8s 违规)→ 统一到本组件:卡片不带链接(/cases/ 依赖尚不存在的案例数据, * 链向 404 违反零编造);如需锚点(service hero 的 #cases CTA)用 id prop。 * * 布局要点:grid 类必须挂在 StaggerReveal 自身——它会给每个子项包一层 motion.div, * 放外层 div 时包装层成为 grid 唯一子项,卡片会堆成单列(commit 3091035 踩坑记录)。 * * 数据闸门:caseStudies 为空时 return null(L3EmptyFallback 接管兜底渲染)。 * DEC-N4 同闸(2026-10-19):非空条目还须过 lib/constants/case-publish-gate * (授权 + basis=verified + 禁词),与首页 ResultsSlot 同一判据实现。 */ import { ScrollReveal, StaggerReveal } from '@/components/ui/scroll-reveal'; import { SectionLabel } from '@/components/ui/page-decoration'; import { gateCaseItems } from '@/lib/constants/case-publish-gate'; import type { MetricBasis } from '@/lib/constants/metrics-basis'; /** 三处数据源(cases.ts / services.ts / products.ts)的结构公共子集 */ export interface CaseStudyItem { client: string; industry: string; challenge: string; solution?: string; result: string; /** * DEC-N4 同闸(2026-10-19):卡片型案例必须声明「客户授权对外展示」+ * 「成果口径 verified」才会渲染,判据复用 lib/constants/case-publish-gate * (与首页成果槽同一实现,非第二套真源)。两字段可选 ⇒ 既有未补口径的 * 条目一律被闸住,这正是 fail-closed 的应有行为。 */ authorized?: boolean; basis?: MetricBasis; } interface CaseStudiesSectionProps { caseStudies?: readonly CaseStudyItem[]; /** h2 标题文案(solution 页传「同行业落地案例」,其余用默认) */ heading?: string; /** 锚点 id(service 页 hero 的 #cases CTA 依赖) */ id?: string; } export function CaseStudiesSection({ caseStudies, heading = '客户案例', id, }: CaseStudiesSectionProps) { /** * 数据闸门分两层(DEC-N4 同闸改造): * 1. 原契约:入参为空 ⇒ return null,由 L3EmptyFallback 兜底; * 2. 新契约:非空条目先过 case-publish-gate,未授权 / 缺 verified 口径 / * 命中虚构佐证禁词的条目**不渲染**,降级原因逐条 console.error 喊出来 * (静默吞掉等于掩饰,同 ResultsSlot 的纪律)。全部被闸住 ⇒ 整段 null。 */ const { publishable, blocked } = gateCaseItems(caseStudies ?? []); for (const { item, blockers } of blocked) { console.error( `[CaseStudiesSection] 案例「${item.client}」未通过反伪造门槛,已隐藏:${blockers.join(';')}`, ); } if (publishable.length === 0) return null; return (
客户案例

{heading}

{/* grid 直接挂 StaggerReveal(见文件头注释),gap-px 露出容器底色形成发丝分隔线 */} {publishable.map((study) => (
{/* 客户名首字占位图形(无真实配图时):aria-hidden 不豁免 1.4.3,用大字档令牌 text-text-hint */}
{study.industry}

{study.client}

{study.challenge}

{study.result}
核心成果
))}
); }