refactor(grammar): OPEN-05a 批1+2 清零棘轮存量(54→15),上限同批下调

- 删 3 个零渲染点组件 service-value / solution-value / micro-interactions
  及其 3 个测试文件与 barrel 导出(dead-modules 被 barrel 再导出遮住,见 OPEN-16)
- 批1:section-header 等价类 / service-card 去 hover 抬升与装饰阴影 /
  standalone 详情 8 处圆角 + 2 处红面改中性底
- 批2:/about/brand font-black 11 → font-bold、rounded-full 5、hover:shadow 2
- MARKETING_HIT_CEILINGS R13 19→3 / R14 7→5 / R15 7→1 / R16 8→5 / R17 13→1;分母 80→77
- 基线 /about/brand 5 张(预测 5、实写 5);回滚重建实测 1 passed 证明失败全由本批引起
- 全量只读复跑 225 passed / 0 failed / EXIT=0(21.9 分钟)
- 门禁:type-check 0 · lint 0 error/88 warning · coverage 159 套件 1883 例 EXIT=0
This commit is contained in:
zhangxiang committed 2026-11-26 21:02:34 +08:00
1 parent d9d3b82f22
commit f41c57d638
21 files changed
+95 -961

No files matched your search

@@ -78,8 +78,8 @@ export default function BrandContent() {
transition={{ duration: 0.28, delay: 0.1, ease: EASE_OUT }}
className="mb-8 sm:mb-10"
>
<span className="inline-flex items-center gap-2 px-3 py-1.5 bg-brand/[0.08] border border-brand/20 rounded-full">
<span className="w-1.5 h-1.5 rounded-full bg-brand" />
<span className="inline-flex items-center gap-2 px-3 py-1.5 bg-brand/[0.08] border border-brand/20">
<span className="w-1.5 h-1.5 bg-brand" />
<span className="text-[13px] font-semibold text-brand-ink tracking-[0.08em] uppercase">
品牌故事
</span>
@@ -118,7 +118,7 @@ export default function BrandContent() {
className="logo-on-dark block h-[1.2em] w-auto"
/>
<br />
<span className="text-brand-ink font-black">以技术驱动业务增长</span>
<span className="text-brand-ink font-bold">以技术驱动业务增长</span>
</motion.h1>
{/* 数据条 */}
@@ -130,7 +130,7 @@ export default function BrandContent() {
>
{brandStats.map((stat, i) => (
<div key={i} className="flex items-baseline gap-2">
<span className="text-3xl sm:text-4xl md:text-5xl font-black text-brand-ink tabular-nums leading-none">
<span className="text-3xl sm:text-4xl md:text-5xl font-bold text-brand-ink tabular-nums leading-none">
{stat.value}
</span>
<span className="text-sm text-text-muted whitespace-nowrap">
@@ -166,7 +166,7 @@ export default function BrandContent() {
品牌定位
</span>
</div>
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-black text-ink tracking-tight leading-[1.05]">
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-ink tracking-tight leading-[1.05]">
做企业数字化转型的
<span className="text-brand-ink">长期同行者</span>
</h2>
@@ -180,7 +180,7 @@ export default function BrandContent() {
<div className="grid sm:grid-cols-2 lg:grid-cols-4 gap-6">
{brandValues.map((item, i) => (
<ScrollReveal key={item.title} delay={i * 0.1}>
<div className="group relative bg-bg-primary border border-border-primary p-8 h-full transition-all duration-normal hover:border-brand/20 hover:shadow-md">
<div className="group relative bg-bg-primary border border-border-primary p-8 h-full transition-all duration-normal hover:border-brand/20">
<div className="absolute top-0 left-0 right-0 h-0.5 bg-brand scale-x-0 group-hover:scale-x-100 transition-transform duration-150 origin-left" />
<div className="w-12 h-12 flex items-center justify-center bg-brand/[0.06] text-brand-ink mb-6 transition-colors duration-normal group-hover:bg-brand group-hover:text-white">
<item.icon className="w-5 h-5" />
@@ -208,10 +208,10 @@ export default function BrandContent() {
</div>
<div>
<span className="text-[11px] tracking-[0.2em] uppercase text-text-muted font-medium">Mission</span>
<h3 className="text-2xl font-black text-ink tracking-tight">品牌使命</h3>
<h3 className="text-2xl font-bold text-ink tracking-tight">品牌使命</h3>
</div>
</div>
<p className="text-2xl sm:text-3xl font-black text-ink leading-tight tracking-tight">
<p className="text-2xl sm:text-3xl font-bold text-ink leading-tight tracking-tight">
让每一家企业
<br />
都拥有<span className="text-brand-ink">数据驱动</span>的
@@ -235,10 +235,10 @@ export default function BrandContent() {
</div>
<div>
<span className="text-[11px] tracking-[0.2em] uppercase text-dark-text-muted font-medium">Vision</span>
<h3 className="text-2xl font-black text-dark-text-primary tracking-tight">品牌愿景</h3>
<h3 className="text-2xl font-bold text-dark-text-primary tracking-tight">品牌愿景</h3>
</div>
</div>
<p className="text-2xl sm:text-3xl font-black text-dark-text-primary leading-tight tracking-tight">
<p className="text-2xl sm:text-3xl font-bold text-dark-text-primary leading-tight tracking-tight">
成为中国企业
<br />
<span className="text-brand-ink">数字化转型</span>的
@@ -265,7 +265,7 @@ export default function BrandContent() {
发展历程
</span>
</div>
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-black text-ink tracking-tight leading-[1.05]">
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-ink tracking-tight leading-[1.05]">
新起点上,每一步都
<span className="text-brand-ink">脚踏实地</span>
</h2>
@@ -284,7 +284,7 @@ export default function BrandContent() {
<div className="md:w-1/2 flex md:justify-end items-center">
<div className={`${i % 2 === 0 ? 'md:text-right md:pr-12' : 'md:text-left md:pl-12'} flex-1`}>
<div className="flex items-center gap-4 md:justify-end mb-3">
<span className="text-3xl sm:text-4xl font-black text-brand-ink tracking-tight">
<span className="text-3xl sm:text-4xl font-bold text-brand-ink tracking-tight">
{item.year}
</span>
{/* text-muted 在 bg-tertiary(#FBF9F5) 上仅 4.34:1;换 text-secondary → 9.45:1 */}
@@ -299,12 +299,12 @@ export default function BrandContent() {
{/* 时间线节点 */}
<div className="hidden md:flex absolute left-1/2 top-0 -translate-x-1/2 flex-col items-center">
<div className="w-3 h-3 rounded-full bg-brand border-2 border-white shadow-sm" />
<div className="w-3 h-3 bg-brand border-2 border-white" />
</div>
{/* 移动端节点 */}
<div className="md:hidden flex items-center gap-4">
<div className="w-3 h-3 rounded-full bg-brand shrink-0" />
<div className="w-3 h-3 bg-brand shrink-0" />
<div className="w-8 h-px bg-brand/30" />
</div>
@@ -328,7 +328,7 @@ export default function BrandContent() {
品牌实力
</span>
</div>
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-black text-ink tracking-tight leading-[1.05]">
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-ink tracking-tight leading-[1.05]">
用实力赢得
<span className="text-brand-ink">每一份信任</span>
</h2>
@@ -342,7 +342,7 @@ export default function BrandContent() {
{ icon: Globe, title: '多行业场景', desc: '方法论适配制造、零售、医疗、金融、教育、物流等多行业场景' },
].map((item, i) => (
<ScrollReveal key={item.title} delay={i * 0.1}>
<div className="group relative bg-bg-secondary border border-border-primary p-8 h-full transition-all duration-normal hover:border-brand/20 hover:bg-bg-primary hover:shadow-sm">
<div className="group relative bg-bg-secondary border border-border-primary p-8 h-full transition-all duration-normal hover:border-brand/20 hover:bg-bg-primary">
<div className="w-12 h-12 flex items-center justify-center bg-brand/[0.06] text-brand-ink mb-6 transition-colors duration-normal group-hover:bg-brand group-hover:text-white">
<item.icon className="w-5 h-5" />
</div>
@@ -359,12 +359,12 @@ export default function BrandContent() {
<section className="relative py-24 sm:py-32 md:py-44 overflow-hidden bg-dark-bg">
<div className="absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-dark-border to-transparent" />
<div className="absolute inset-0 pointer-events-none overflow-hidden">
<div className="absolute top-1/3 right-1/4 w-[500px] h-[500px] bg-brand/[0.04] rounded-full blur-[140px]" />
<div className="absolute top-1/3 right-1/4 w-[500px] h-[500px] bg-brand/[0.04] blur-[140px]" />
</div>
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative z-10">
<ScrollReveal className="max-w-3xl">
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-6xl xl:text-7xl font-black text-dark-text-primary tracking-tighter leading-[0.9] mb-8 sm:mb-10">
<h2 className="font-sans text-2xl sm:text-3xl md:text-4xl lg:text-6xl xl:text-7xl font-bold text-dark-text-primary tracking-tighter leading-[0.9] mb-8 sm:mb-10">
成为下一个
<br />
<span className="text-brand-ink">数据驱动型企业</span>
@@ -80,7 +80,7 @@ export function StandaloneProductClient({ item }: StandaloneProductClientProps)
className="max-w-3xl mx-auto text-center"
>
<div className="mb-6 flex justify-center">
<div className="flex h-20 w-20 items-center justify-center rounded-2xl bg-bg-secondary text-text-muted">
<div className="flex h-20 w-20 items-center justify-center bg-bg-secondary text-text-muted">
<Lock className="h-10 w-10" />
</div>
</div>
@@ -99,9 +99,9 @@ export function StandaloneProductClient({ item }: StandaloneProductClientProps)
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.28, delay: index * 0.06 }}
className="rounded-lg border border-border-primary bg-bg-secondary p-4"
className="border border-border-primary bg-bg-secondary p-4"
>
<div className="mb-2 flex h-8 w-8 items-center justify-center rounded-lg bg-bg-primary text-text-muted">
<div className="mb-2 flex h-8 w-8 items-center justify-center bg-bg-primary text-text-muted">
<Icon className="h-4 w-4" />
</div>
<h3 className="mb-1 text-sm font-semibold text-ink">
@@ -173,7 +173,7 @@ export function StandaloneProductClient({ item }: StandaloneProductClientProps)
className="mb-10"
>
<div className="flex items-center gap-3 mb-4">
<div className="flex h-10 w-10 items-center justify-center rounded-xl bg-brand-soft text-brand-ink">
<div className="flex h-10 w-10 items-center justify-center bg-bg-secondary text-brand-ink">
<Gauge className="h-5 w-5" />
</div>
<h2 className="text-2xl font-bold text-ink">技术参数</h2>
@@ -191,7 +191,7 @@ export function StandaloneProductClient({ item }: StandaloneProductClientProps)
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.28, delay: index * 0.05 }}
className="rounded-lg border border-border-primary bg-bg-primary p-5"
className="border border-border-primary bg-bg-primary p-5"
>
<div className="mb-2 text-sm text-text-muted">{param.name}</div>
<div className="mb-2 text-2xl font-bold text-brand-ink">{param.value}</div>
@@ -216,7 +216,7 @@ export function StandaloneProductClient({ item }: StandaloneProductClientProps)
className="mb-10"
>
<div className="flex items-center gap-3 mb-4">
<div className="flex h-10 w-10 items-center justify-center rounded-xl bg-brand-soft text-brand-ink">
<div className="flex h-10 w-10 items-center justify-center bg-bg-secondary text-brand-ink">
<FileCheck className="h-5 w-5" />
</div>
<h2 className="text-2xl font-bold text-ink">合规认证</h2>
@@ -234,10 +234,10 @@ export function StandaloneProductClient({ item }: StandaloneProductClientProps)
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.28, delay: index * 0.05 }}
className="flex flex-col sm:flex-row sm:items-center justify-between gap-4 rounded-lg border border-border-primary bg-bg-secondary p-5"
className="flex flex-col sm:flex-row sm:items-center justify-between gap-4 border border-border-primary bg-bg-secondary p-5"
>
<div className="flex items-start gap-4">
<div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-primary text-brand-ink">
<div className="flex h-10 w-10 shrink-0 items-center justify-center bg-bg-primary text-brand-ink">
<FileCheck className="h-5 w-5" />
</div>
<div>
-18
View File
@@ -109,24 +109,6 @@ jest.mock('@/hooks/use-reduced-motion', () => ({
useReducedMotion: jest.fn(() => false),
}));
jest.mock('./micro-interactions', () => ({
TiltCard: ({ children, className }: any) => (
<div data-testid="tilt-card" className={className}>{children}</div>
),
PressableButton: ({ children, className, variant, onClick }: any) => (
<button
data-testid="pressable-button"
data-variant={variant}
className={className}
onClick={onClick}
>
{children}
</button>
),
HoverLink: ({ children, href, className }: any) => (
<a data-testid="hover-link" href={href} className={className}>{children}</a>
),
}));
jest.mock('./detail-case-study', () => ({
CaseStudyCard: ({ study, index }: any) => (
-4
View File
@@ -17,13 +17,9 @@ export { CertificationList } from './detail-certification';
export { CaseStudiesSection } from './detail-case-studies-section';
export { CertificationsSection } from './detail-certifications-section';
export { SolutionValueSection } from './solution-value';
export { ServiceValueSection } from './service-value';
export { ProductCard } from './product-card';
export { SolutionCard } from './solution-service-card';
export { TiltCard, PressableButton, HoverLink } from './micro-interactions';
// 注:brand-elements.tsx(BrandSeal/CalligraphyText/SectionHeader)与
// detail-cross-recommend.tsx(CrossRecommendGrid)此前 0 消费者,已于 2026-08-31 删除。
@@ -1,30 +0,0 @@
import { describe, it, expect } from '@jest/globals';
import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import { PressableButton } from './micro-interactions';
// S-5 回归:带 href 的 PressableButton 必须渲染单个 <a>(可导航),而不是把 <button> 嵌进 <a>
// —— 旧实现 `<a><motion.button/></a>` 是无效交互嵌套,SR 会同时播报「链接 + 按钮」。
// 旧码下 `container.querySelector('button')` 不为 null ⇒ 本用例判红(真判别)。
describe('PressableButton (S-5)', () => {
it('renders a single anchor (no nested button) when href is provided', () => {
const { container } = render(
<PressableButton href="/products/erp" variant="primary">
了解更多
</PressableButton>
);
const anchor = container.querySelector('a[href="/products/erp"]');
expect(anchor).not.toBeNull();
expect(container.querySelector('button')).toBeNull();
});
it('renders a button (not an anchor) when no href is provided', () => {
const { container } = render(
<PressableButton variant="secondary" onClick={() => {}}>
点击
</PressableButton>
);
expect(container.querySelector('button')).not.toBeNull();
expect(container.querySelector('a')).toBeNull();
});
});
@@ -1,193 +0,0 @@
'use client';
import { motion, useMotionValue, useTransform, useSpring } from 'framer-motion';
import { useRef, ReactNode, useState, useCallback } from 'react';
import { ArrowUpRight } from 'lucide-react';
interface TiltCardProps {
children: ReactNode;
className?: string;
tiltAmount?: number;
glareEnable?: boolean;
glareMaxOpacity?: number;
scaleOnHover?: number;
}
export function TiltCard({
children,
className = '',
tiltAmount = 6,
glareEnable = true,
glareMaxOpacity = 0.06,
scaleOnHover = 1.01,
}: TiltCardProps) {
const ref = useRef<HTMLDivElement>(null);
const x = useMotionValue(0.5);
const y = useMotionValue(0.5);
const [isHovered, setIsHovered] = useState(false);
const rotateX = useSpring(useTransform(y, [0, 1], [tiltAmount, -tiltAmount]), {
stiffness: 280,
damping: 24,
mass: 0.8,
});
const rotateY = useSpring(useTransform(x, [0, 1], [-tiltAmount, tiltAmount]), {
stiffness: 280,
damping: 24,
mass: 0.8,
});
const scale = useSpring(isHovered ? scaleOnHover : 1, {
stiffness: 300,
damping: 28,
mass: 0.6,
});
const handleMouseMove = useCallback((e: React.MouseEvent<HTMLDivElement>) => {
if (!ref.current) return;
const rect = ref.current.getBoundingClientRect();
x.set((e.clientX - rect.left) / rect.width);
y.set((e.clientY - rect.top) / rect.height);
}, [x, y]);
const handleMouseEnter = useCallback(() => {
setIsHovered(true);
}, []);
const handleMouseLeave = useCallback(() => {
setIsHovered(false);
x.set(0.5);
y.set(0.5);
}, [x, y]);
const glareX = useTransform(x, [0, 1], ['0%', '100%']);
const glareY = useTransform(y, [0, 1], ['0%', '100%']);
const glareOpacity = useTransform(
y,
[0, 0.5, 1],
[glareMaxOpacity * 0.3, glareMaxOpacity, glareMaxOpacity * 0.2]
);
return (
<motion.div
ref={ref}
onMouseMove={handleMouseMove}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
style={{
rotateX,
rotateY,
scale,
transformStyle: 'preserve-3d',
perspective: 1400,
}}
className={`relative will-change-transform ${className}`}
>
{children}
{glareEnable && (
<motion.div
className="pointer-events-none absolute inset-0 rounded-[inherit] overflow-hidden"
style={{
opacity: glareOpacity,
backgroundImage: `linear-gradient(
135deg,
rgba(255,255,255,0.6) 0%,
rgba(255,255,255,0.2) 40%,
transparent 60%
)`,
backgroundPositionX: glareX,
backgroundPositionY: glareY,
backgroundSize: '250% 250%',
mixBlendMode: 'overlay',
}}
/>
)}
</motion.div>
);
}
interface PressableButtonProps {
children: ReactNode;
className?: string;
onClick?: () => void;
variant?: 'primary' | 'secondary' | 'ghost';
href?: string;
}
export function PressableButton({
children,
className = '',
onClick,
variant = 'primary',
href,
}: PressableButtonProps) {
const baseStyles = {
primary:
// hover 阴影走中性档:彩色阴影(--shadow-brand-hover)已随对标语法收口退役
'bg-brand text-white shadow-sm hover:shadow-md',
secondary:
'bg-bg-elevated text-ink border border-border-primary hover:border-brand/30 hover:shadow-md',
ghost:
'bg-transparent text-brand-ink hover:bg-brand/5',
};
const sharedCls = `inline-flex items-center gap-2 px-6 py-3 font-semibold rounded-md transition-all duration-fast ease-standard ${baseStyles[variant]} ${className}`;
const pressMotion = {
whileHover: { y: -1 },
whileTap: { scale: 0.97, y: 0 },
transition: { type: 'spring' as const, stiffness: 400, damping: 25 },
};
// 有 href 时渲染单个 <a>(motion.a),而不是把 <button> 嵌进 <a>——后者是无效交互嵌套,
// 屏幕阅读器会同时播报「链接 + 按钮」两个控件,Enter/Space 激活语义含糊(S-5)。
if (href) {
return (
<motion.a href={href} onClick={onClick} className={sharedCls} {...pressMotion}>
{children}
</motion.a>
);
}
return (
<motion.button onClick={onClick} className={sharedCls} {...pressMotion}>
{children}
</motion.button>
);
}
interface HoverLinkProps {
children: ReactNode;
href: string;
className?: string;
showArrow?: boolean;
color?: 'default' | 'brand';
}
export function HoverLink({
children,
href,
className = '',
showArrow = false,
color = 'default',
}: HoverLinkProps) {
return (
<a
href={href}
className={`group inline-flex items-center gap-1.5 font-medium transition-colors duration-fast ease-standard ${
color === 'brand' ? 'text-brand-ink' : 'text-text-secondary hover:text-brand-ink'
} ${className}`}
>
<span className="relative inline-block">
<span className="relative z-10">{children}</span>
<span
className="absolute bottom-0 left-0 w-full h-px origin-left scale-x-0 transition-transform duration-normal ease-standard group-hover:scale-x-100"
style={{
background: `linear-gradient(90deg, currentColor 0%, currentColor 100%)`,
}}
/>
</span>
{showArrow && (
<ArrowUpRight className="w-4 h-4 transition-all duration-fast ease-standard group-hover:translate-x-0.5 group-hover:-translate-y-0.5" />
)}
</a>
);
}
@@ -1,134 +0,0 @@
// @ts-nocheck
import { describe, it, expect, jest } from '@jest/globals';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
// ─── Mocks ───────────────────────────────────────────────────────────────
jest.mock('framer-motion', () => ({
motion: {
div: ({ children, initial, animate, variants, whileInView, viewport, transition, className, ...props }: any) => (
<div
data-testid="motion-div"
data-initial={JSON.stringify(initial)}
data-animate={JSON.stringify(animate)}
data-variants={JSON.stringify(variants)}
data-while-inview={JSON.stringify(whileInView)}
data-viewport={JSON.stringify(viewport)}
data-transition={JSON.stringify(transition)}
className={className}
{...props}
>
{children}
</div>
),
},
useInView: jest.fn(() => true),
AnimatePresence: ({ children }: any) => <>{children}</>,
}));
jest.mock('lucide-react', () => {
const icons: Record<string, any> = {};
const names = ['CheckCircle2', 'Zap', 'Clock', 'Users', 'Award', 'TrendingUp'];
for (const name of names) {
const Icon = (props: any) => (
<svg
data-testid={`icon-${name.toLowerCase().replace(/\s+/g, '-')}`}
className={props?.className}
/>
);
Icon.displayName = name;
icons[name] = Icon;
}
return icons;
});
// ─── Mock Data ────────────────────────────────────────────────────────────
const mockService = {
id: 'consulting',
title: '战略咨询',
description: '企业数字化转型战略规划服务',
icon: 'lightbulb',
overview: '从战略到执行,全方位助力企业数字化转型',
features: [
'需求调研:深入了解企业现状与痛点',
'方案设计:制定个性化数字化转型方案',
'实施指导:全程跟踪指导确保落地',
],
benefits: [
'提升运营效率 30%',
'降低运营成本 20%',
'增强市场竞争力',
],
process: [
'诊断评估:现状分析与问题诊断',
'战略规划:制定转型路线图',
'落地实施:敏捷迭代推进',
],
heroThemeId: 'consulting',
caseStudies: [],
dataProofs: [],
};
// ─── Tests ───────────────────────────────────────────────────────────────
describe('ServiceValueSection', () => {
it('should render service title in heading', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('为什么选择我们的战略咨询?')).toBeInTheDocument();
});
it('should render overview text', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('从战略到执行,全方位助力企业数字化转型')).toBeInTheDocument();
});
it('should render "服务能力" label', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('服务能力')).toBeInTheDocument();
});
it('should render "核心能力" label', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('核心能力')).toBeInTheDocument();
});
it('should render feature items', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('深入了解企业现状与痛点')).toBeInTheDocument();
expect(screen.getByText('制定个性化数字化转型方案')).toBeInTheDocument();
});
it('should render "服务优势" label', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('服务优势')).toBeInTheDocument();
});
it('should render benefit items', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('提升运营效率 30%')).toBeInTheDocument();
expect(screen.getByText('降低运营成本 20%')).toBeInTheDocument();
});
it('should render "服务流程" label', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('服务流程')).toBeInTheDocument();
});
it('should render process steps', async () => {
const { ServiceValueSection } = await import('./service-value');
render(<ServiceValueSection service={mockService} />);
expect(screen.getByText('诊断评估')).toBeInTheDocument();
expect(screen.getByText('战略规划')).toBeInTheDocument();
expect(screen.getByText('落地实施')).toBeInTheDocument();
});
});
-165
View File
@@ -1,165 +0,0 @@
'use client';
import { motion } from 'framer-motion';
import {
CheckCircle2,
Zap,
Clock,
Users,
Award,
TrendingUp,
type LucideIcon,
} from 'lucide-react';
import type { Service } from '@/lib/constants/services';
interface ServiceValueSectionProps {
service: Service;
}
export function ServiceValueSection({ service }: ServiceValueSectionProps) {
const icons: LucideIcon[] = [Zap, Clock, Users, Award, TrendingUp];
return (
<section className="relative bg-bg-primary py-20 sm:py-28 md:py-36 overflow-hidden">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative">
<motion.div
initial={{ opacity: 0, y: 32 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: '-120px' }}
transition={{ duration: 0.28, ease: [0.22, 1, 0.36, 1] }}
className="mb-16 sm:mb-20"
>
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-px bg-brand" />
<span className="text-[13px] tracking-[0.12em] font-semibold text-brand-ink">
服务能力
</span>
</div>
<h2 className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-black text-ink tracking-tight leading-[0.95] max-w-3xl">
为什么选择我们的{service.title}?
</h2>
<p className="text-lg text-text-secondary max-w-2xl mt-6 leading-relaxed">
{service.overview}
</p>
</motion.div>
{/* 核心能力 */}
<div className="mb-16">
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-px bg-brand" />
<span className="text-[13px] tracking-[0.12em] font-semibold text-brand-ink">
核心能力
</span>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5">
{service.features.map((feature, index) => {
const Icon = icons[index % icons.length]!;
return (
<motion.div
key={feature}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{
delay: index * 0.06,
duration: 0.28,
ease: [0.22, 1, 0.36, 1],
}}
className="bain-card p-6"
>
<div className="flex items-center gap-4">
<div className={`shrink-0 w-11 h-11 flex items-center justify-center ${
index === 0
? 'bg-brand text-white'
: 'bg-bg-secondary text-text-secondary'
}`}>
<Icon className="w-5 h-5" />
</div>
<p className="text-sm font-medium text-text-secondary leading-relaxed">
{feature.split(':')[1] || feature}
</p>
</div>
</motion.div>
);
})}
</div>
</div>
{/* 服务优势 + 服务流程:不对称布局 */}
<div className="asymmetric-wide-narrow">
{/* 服务优势 */}
<div>
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-px bg-brand" />
<span className="text-[13px] tracking-[0.12em] font-semibold text-brand-ink">
服务优势
</span>
</div>
<div className="space-y-4">
{service.benefits.map((benefit, index) => (
<motion.div
key={index}
initial={{ opacity: 0, x: -20 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
delay: index * 0.06,
duration: 0.28,
ease: [0.22, 1, 0.36, 1],
}}
className="bain-card p-5 flex items-start gap-3"
>
<CheckCircle2 className="w-5 h-5 text-brand-ink mt-0.5 shrink-0" />
<p className="text-sm font-medium text-text-secondary leading-relaxed">{benefit}</p>
</motion.div>
))}
</div>
</div>
{/* 服务流程 */}
{service.process && service.process.length > 0 && (
<div>
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-px bg-brand" />
<span className="text-[13px] tracking-[0.12em] font-semibold text-brand-ink">
服务流程
</span>
</div>
<div className="space-y-4">
{service.process.map((step, index) => (
<motion.div
key={step}
initial={{ opacity: 0, x: 20 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{
delay: index * 0.06,
duration: 0.28,
ease: [0.22, 1, 0.36, 1],
}}
className="bain-card p-5"
>
<div className="flex items-start gap-3">
<div className="w-6 h-6 rounded-full bg-brand text-white flex items-center justify-center shrink-0 mt-0.5">
<span className="text-xs font-bold">{index + 1}</span>
</div>
<div>
<h4 className="font-bold text-ink text-sm mb-1">
{step.split(':')[0]}
</h4>
<p className="text-xs text-text-secondary leading-relaxed">
{step.split(':')[1] || step}
</p>
</div>
</div>
</motion.div>
))}
</div>
</div>
)}
</div>
</div>
</section>
);
}
@@ -1,154 +0,0 @@
// @ts-nocheck
import { describe, it, expect, jest } from '@jest/globals';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
// ─── Mocks ───────────────────────────────────────────────────────────────
jest.mock('framer-motion', () => ({
motion: {
div: ({ children, initial, animate, variants, whileInView, viewport, transition, className, ...props }: any) => (
<div
data-testid="motion-div"
data-initial={JSON.stringify(initial)}
data-animate={JSON.stringify(animate)}
data-variants={JSON.stringify(variants)}
data-while-inview={JSON.stringify(whileInView)}
data-viewport={JSON.stringify(viewport)}
data-transition={JSON.stringify(transition)}
className={className}
{...props}
>
{children}
</div>
),
li: ({ children, className, ...props }: any) => (
<li data-testid="motion-li" className={className} {...props}>{children}</li>
),
},
useInView: jest.fn(() => true),
AnimatePresence: ({ children }: any) => <>{children}</>,
}));
jest.mock('lucide-react', () => {
const icons: Record<string, any> = {};
const names = ['CheckCircle2', 'Lightbulb', 'Target', 'TrendingUp'];
for (const name of names) {
const Icon = (props: any) => (
<svg
data-testid={`icon-${name.toLowerCase().replace(/\s+/g, '-')}`}
className={props?.className}
/>
);
Icon.displayName = name;
icons[name] = Icon;
}
return icons;
});
// ─── Mock Data ────────────────────────────────────────────────────────────
const mockSolution = {
id: 'manufacturing',
industry: '制造业',
title: '智能制造解决方案',
subtitle: '助力制造业数字化转型',
description: '面向制造业的一站式数字化转型方案,涵盖生产、质量、设备全流程',
challenges: [
'生产流程不透明,无法实时掌握车间状态',
'设备利用率低,缺乏预防性维护机制',
'质量管控依赖人工,缺陷率居高不下',
],
solutions: [
'部署MES系统,实现生产过程透明化',
'接入IoT设备传感器,构建设备健康管理平台',
'引入AI质检系统,提升缺陷检测准确率',
],
relatedProducts: ['erp', 'crm'],
valueProposition: {
headline: '让制造更智能,让管理更高效',
points: [
{ icon: 'trending-up', title: '效率提升', description: '生产效率提升30%,订单交付周期缩短50%' },
{ icon: 'shield', title: '质量保障', description: '产品合格率提升至99%,缺陷率降低80%' },
{ icon: 'zap', title: '成本优化', description: '运营成本降低25%,设备维护成本降低40%' },
],
},
suiteCombination: {
primaryProducts: ['ERP系统', 'MES系统', 'WMS系统'],
complementaryServices: ['数据采集与集成', '设备物联网接入', 'AI质检系统部署'],
rationale: 'ERP+MES+IoT实现从订单到交付的全流程数字化,打通信息孤岛,构建智能制造底座',
},
};
// ─── Tests ───────────────────────────────────────────────────────────────
describe('SolutionValueSection', () => {
it('should render industry name in heading', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('制造业')).toBeInTheDocument();
expect(screen.getByText(/为.*量身定制/)).toBeInTheDocument();
});
it('should render "行业方案" label', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('行业方案')).toBeInTheDocument();
});
it('should render description', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('面向制造业的一站式数字化转型方案,涵盖生产、质量、设备全流程')).toBeInTheDocument();
});
it('should render "行业痛点挑战" section', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('行业痛点挑战')).toBeInTheDocument();
expect(screen.getByText('生产流程不透明,无法实时掌握车间状态')).toBeInTheDocument();
expect(screen.getByText('设备利用率低,缺乏预防性维护机制')).toBeInTheDocument();
});
it('should render "睿新致远解决方案" section', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('睿新致远解决方案')).toBeInTheDocument();
expect(screen.getByText('部署MES系统,实现生产过程透明化')).toBeInTheDocument();
});
it('should render value proposition section', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('价值主张')).toBeInTheDocument();
expect(screen.getByText('让制造更智能,让管理更高效')).toBeInTheDocument();
});
it('should render value proposition points', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('效率提升')).toBeInTheDocument();
expect(screen.getByText('质量保障')).toBeInTheDocument();
expect(screen.getByText('成本优化')).toBeInTheDocument();
});
it('should render "产品组合" section', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('产品组合')).toBeInTheDocument();
expect(screen.getByText('推荐搭配方案')).toBeInTheDocument();
});
it('should render suite combination products', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText('ERP系统')).toBeInTheDocument();
expect(screen.getByText('MES系统')).toBeInTheDocument();
});
it('should render combination rationale', async () => {
const { SolutionValueSection } = await import('./solution-value');
render(<SolutionValueSection solution={mockSolution} />);
expect(screen.getByText(/ERP\+MES\+IoT实现从订单到交付的全流程数字化/)).toBeInTheDocument();
});
});
-232
View File
@@ -1,232 +0,0 @@
'use client';
import { motion } from 'framer-motion';
import {
CheckCircle2,
Lightbulb,
Target,
TrendingUp,
} from 'lucide-react';
import type { Solution } from '@/lib/constants/solutions';
interface SolutionValueSectionProps {
solution: Solution;
}
export function SolutionValueSection({ solution }: SolutionValueSectionProps) {
return (
<section className="relative bg-bg-primary py-20 sm:py-28 md:py-36 overflow-hidden">
<div className="max-w-container mx-auto px-4 sm:px-6 lg:px-10 relative">
<motion.div
initial={{ opacity: 0, y: 32 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: '-120px' }}
transition={{ duration: 0.28, ease: [0.22, 1, 0.36, 1] }}
className="mb-16 sm:mb-20"
>
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-px bg-brand" />
<span className="text-[13px] tracking-[0.12em] font-semibold text-brand-ink">
行业方案
</span>
</div>
<h2 className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-ink tracking-tight leading-[0.95] max-w-3xl">
为<span className="text-brand-ink">{solution.industry}</span>量身定制
</h2>
<p className="text-lg text-text-secondary max-w-2xl mt-6 leading-relaxed">
{solution.description}
</p>
</motion.div>
{/* 痛点 + 方案:不对称布局 */}
<div className="asymmetric-wide-narrow mb-16">
{/* 行业痛点 */}
<motion.div
initial={{ opacity: 0, x: -30 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true, margin: '-80px' }}
transition={{ duration: 0.28, ease: [0.22, 1, 0.36, 1] }}
>
<div className="bain-card p-8">
<h3 className="text-xl font-bold text-ink mb-6 flex items-center gap-3">
<span className="w-10 h-10 flex items-center justify-center bg-brand text-white">
<Target className="w-5 h-5" />
</span>
行业痛点挑战
</h3>
<ul className="space-y-4">
{solution.challenges.map((challenge, index) => (
<motion.li
key={index}
initial={{ opacity: 0, y: 15 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{
delay: index * 0.06,
duration: 0.28,
ease: [0.22, 1, 0.36, 1],
}}
className="flex items-start gap-3 text-text-secondary"
>
<span className="w-1.5 h-1.5 bg-brand mt-2 shrink-0" />
<span className="text-sm leading-relaxed">{challenge}</span>
</motion.li>
))}
</ul>
</div>
</motion.div>
{/* 解决方案 */}
<motion.div
initial={{ opacity: 0, x: 30 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true, margin: '-80px' }}
transition={{ duration: 0.28, delay: 0.15, ease: [0.22, 1, 0.36, 1] }}
>
<div className="bain-card p-8">
<h3 className="text-xl font-bold text-ink mb-6 flex items-center gap-3">
<span className="w-10 h-10 flex items-center justify-center bg-bg-tertiary border border-border-primary text-text-primary">
<Lightbulb className="w-5 h-5" />
</span>
睿新致远解决方案
</h3>
<ul className="space-y-4">
{solution.solutions.map((solutionItem, index) => (
<motion.li
key={index}
initial={{ opacity: 0, y: 15 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{
delay: 0.25 + index * 0.08,
duration: 0.28,
ease: [0.22, 1, 0.36, 1],
}}
className="flex items-start gap-3 text-text-secondary"
>
<CheckCircle2 className="w-4 h-4 text-text-primary mt-0.5 shrink-0" />
<span className="text-sm leading-relaxed">{solutionItem}</span>
</motion.li>
))}
</ul>
</div>
</motion.div>
</div>
{/* 价值主张 */}
{solution.valueProposition && (
<motion.div
initial={{ opacity: 0, y: 32 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: '-80px' }}
transition={{ duration: 0.28, delay: 0.3 }}
>
<div className="mb-12">
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-px bg-brand" />
<span className="text-[13px] tracking-[0.12em] font-semibold text-brand-ink">
价值主张
</span>
</div>
<h3 className="text-2xl sm:text-3xl md:text-4xl font-bold text-ink tracking-tight leading-[0.95]">
{solution.valueProposition.headline}
</h3>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
{solution.valueProposition.points.map((point, index) => (
<motion.div
key={index}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{
delay: index * 0.06,
duration: 0.28,
ease: [0.22, 1, 0.36, 1],
}}
className="bain-card p-7"
>
<div className="w-12 h-12 flex items-center justify-center bg-bg-tertiary border border-border-primary text-text-primary mb-5">
<TrendingUp className="w-6 h-6" />
</div>
<h4 className="text-lg font-bold text-ink mb-2">{point.title}</h4>
<p className="text-sm text-text-secondary leading-relaxed">{point.description}</p>
</motion.div>
))}
</div>
</motion.div>
)}
{/* 产品组合 */}
{solution.suiteCombination && (
<motion.div
initial={{ opacity: 0, y: 32 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: '-80px' }}
transition={{ duration: 0.28, delay: 0.4 }}
className="mt-20"
>
<div className="mb-12">
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-px bg-brand" />
<span className="text-[13px] tracking-[0.12em] font-semibold text-brand-ink">
产品组合
</span>
</div>
<h3 className="text-2xl sm:text-3xl font-bold text-ink tracking-tight leading-[0.95]">
推荐搭配方案
</h3>
</div>
<div className="bain-card p-8 sm:p-10">
<div className="grid grid-cols-1 lg:grid-cols-2 gap-10">
<div>
<h4 className="text-sm font-bold text-ink mb-5 flex items-center gap-2.5">
<span className="w-8 h-8 flex items-center justify-center bg-brand text-white text-xs font-bold">
核
</span>
核心产品组合
</h4>
<div className="flex flex-wrap gap-3">
{solution.suiteCombination.primaryProducts.map((product) => (
<span
key={product}
className="px-4 py-2 bg-brand-soft/50 text-brand-ink text-sm font-semibold border border-brand/20"
>
{product}
</span>
))}
</div>
</div>
<div>
<h4 className="text-sm font-bold text-ink mb-5 flex items-center gap-2.5">
<span className="w-8 h-8 flex items-center justify-center bg-bg-tertiary border border-border-primary text-text-primary text-xs font-bold">
配
</span>
配套专业服务
</h4>
<div className="flex flex-wrap gap-3">
{solution.suiteCombination.complementaryServices.map((service) => (
<span
key={service}
className="px-4 py-2 bg-blue-50 text-blue-700 text-sm font-semibold border border-blue-200"
>
{service}
</span>
))}
</div>
</div>
</div>
<p className="mt-8 p-5 bg-bg-secondary text-sm text-text-secondary leading-relaxed">
<strong className="text-ink">组合逻辑:</strong>{solution.suiteCombination.rationale}
</p>
</div>
</motion.div>
)}
</div>
</section>
);
}
+1 -1
View File
@@ -41,7 +41,7 @@ export function SectionHeader({
<div className="flex items-center gap-3 mb-4 md:mb-5">
{/* Brand accent bar — grows from bottom on entry */}
<motion.div
className="w-1 rounded-full origin-bottom"
className="w-1 origin-bottom"
style={{
height: '1rem',
backgroundColor: light
+1 -1
View File
@@ -30,7 +30,7 @@ export function ServiceCard({
return (
<motion.div
className={`group relative bg-[var(--color-bg-primary)] border border-[var(--color-border-primary)] rounded-[var(--radius-lg)] overflow-hidden transition-all duration-normal ease-ink hover:-translate-y-1 hover:shadow-[var(--shadow-lg)] hover:border-brand/20 ${className}`}
className={`group relative bg-[var(--color-bg-primary)] border border-[var(--color-border-primary)] rounded-[var(--radius-lg)] overflow-hidden transition-all duration-normal ease-ink hover:border-brand/20 ${className}`}
initial={shouldReduceMotion ? {} : { opacity: 0, y: 24 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: '-40px' }}