'use client'; import { useEffect, useRef, useState } from 'react'; import { motion, useMotionValue, useTransform } from 'framer-motion'; import { ScrollReveal, StaggerReveal } from '@/components/ui/scroll-reveal'; import { Badge } from '@/components/ui/badge'; import { ArrowRight, Quote, CheckCircle2, Zap, Award, } from 'lucide-react'; import { cn } from '@/lib/utils'; import { SectionLabel, EASE_OUT } from '@/components/ui/page-decoration'; function MagneticButton({ children, href, variant = 'primary', className }: { children: React.ReactNode; href: string; variant?: 'primary' | 'secondary'; className?: string }) { const ref = useRef(null); const [position, setPosition] = useState({ x: 0, y: 0 }); const handleMouseMove = (e: React.MouseEvent) => { if (!ref.current) return; const rect = ref.current.getBoundingClientRect(); const x = (e.clientX - rect.left - rect.width / 2) * 0.15; const y = (e.clientY - rect.top - rect.height / 2) * 0.15; setPosition({ x, y }); }; const handleMouseLeave = () => { setPosition({ x: 0, y: 0 }); }; return ( {variant === 'primary' && (
)} {children} ); } function HeroSection({ heroData, stats }: { heroData?: Record | null; stats?: Record[] }) { const containerRef = useRef(null); const scrollProgress = useMotionValue(0); useEffect(() => { const element = containerRef.current; if (!element) return; const updateProgress = () => { const rect = element.getBoundingClientRect(); const raw = rect.height > 0 ? -rect.top / rect.height : 0; scrollProgress.set(Math.max(0, Math.min(1, raw))); }; updateProgress(); window.addEventListener('scroll', updateProgress, { passive: true }); window.addEventListener('resize', updateProgress); return () => { window.removeEventListener('scroll', updateProgress); window.removeEventListener('resize', updateProgress); }; }, [scrollProgress]); const y = useTransform(scrollProgress, [0, 1], [0, 160]); const opacity = useTransform(scrollProgress, [0, 0.7], [1, 0.15]); // 兼容新旧数据字段 const eyebrow = heroData?.eyebrow || ''; const heading = heroData?.heading || heroData?.headingBottom || ''; const subheading = heroData?.subheading || heroData?.description || ''; const ctaLabel = heroData?.ctaLabel || '预约咨询'; const ctaHref = heroData?.ctaHref || '/contact'; const secondaryCtaLabel = heroData?.secondaryCtaLabel || ''; const secondaryCtaHref = heroData?.secondaryCtaHref || '#'; const hasValidStats = stats?.length && stats[0]?.value; const displayStats = hasValidStats ? stats!.slice(0, 4) : []; if (!heroData) { return (

首页 Hero 内容未配置

); } return (
{/* 眉标 Badge */} {eyebrow && ( {eyebrow} )} {/* 主标题 — Bain 风格:大号加粗 + 品牌红关键词 */} {heading} {/* 数据指标条 — Bain 风格:答案优先,数据先行 */} {displayStats.length > 0 && ( {displayStats.map((stat, i) => (
{stat.value} {stat.label}
))}
)} {/* 副标题 */} {subheading && ( {subheading} )} {/* CTA 按钮组 */} {ctaLabel} {secondaryCtaLabel && ( {secondaryCtaLabel} )}
); } function ServicesSection({ services }: { services?: Record[] }) { const hasValidData = services?.length && services[0]?.highlights; const SERVICES = hasValidData ? services : []; if (SERVICES.length === 0) { return (

暂无服务数据

); } return (
); } function TrustSection() { const items = [ { title: '私有化部署', desc: '核心数据不出境,满足金融、医疗、政务合规要求' }, { title: '资深团队', desc: '平均 10 年以上企业级系统交付经验' }, { title: '全栈自研', desc: '从底层架构到前端交互,核心技术自主可控' }, { title: '长期陪跑', desc: '上线不是终点,持续迭代陪伴业务成长' }, ]; return (
值得信赖

12年深耕,500+项目验证的交付能力

{items.map((item, i) => (
{String(i + 1).padStart(2, '0')}

{item.title}

{item.desc}

))}
); } function CasesSection({ cases }: { cases?: Record[] }) { const hasValidData = cases?.length && cases[0]?.metrics; const CASES = hasValidData ? cases : []; if (CASES.length === 0) { return (

暂无案例数据

); } return (
客户案例

每一个项目,
都以业务改善为衡量标准

查看全部案例
{CASES.map((caseItem, i) => (
{caseItem.industry}
{caseItem.metrics.map((metric: Record, j: number) => (
{metric.value}
{metric.label}
))}

{caseItem.title}

挑战

{caseItem.challenge}

{(caseItem as any).insight && (
关键洞察

{(caseItem as any).insight}

)}
解决方案

{caseItem.solution}

业务成果

{caseItem.result}

{caseItem.testimonial?.quote && (

“{caseItem.testimonial.quote}”

— {caseItem.testimonial.author} {caseItem.testimonial.role && `,${caseItem.testimonial.role}`} {caseItem.testimonial.company && ` · ${caseItem.testimonial.company}`}

)}
))}
); } function CTASection({ heroData }: { heroData?: Record | null }) { const ctaTitleLine1 = heroData?.ctaTitleLine1 || ''; const ctaTitleLine2 = heroData?.ctaTitleLine2 || ''; const ctaLabel = heroData?.ctaLabel || ''; const ctaHref = heroData?.ctaHref || '#'; return (

{ctaTitleLine1 && <>{ctaTitleLine1}
} {ctaTitleLine2 || '真正转化为业务增长'}

{ctaLabel || '预约咨询'}
); } export default function HomeContentV13({ services, cases, stats, heroData }: { services?: Record[]; cases?: Record[]; stats?: Record[]; heroData?: Record | null; }) { return (
); }