-
+
{item.label}
diff --git a/src/components/layout/client-layout.tsx b/src/components/layout/client-layout.tsx
index a2895e1..c6cb2c3 100644
--- a/src/components/layout/client-layout.tsx
+++ b/src/components/layout/client-layout.tsx
@@ -10,7 +10,9 @@ interface ClientLayoutProps {
export function ClientLayout({ children }: ClientLayoutProps) {
return (
- {children}
+
+ {children}
+
);
}
diff --git a/src/components/layout/footer.test.tsx b/src/components/layout/footer.test.tsx
index 2a33b00..f69b8ad 100644
--- a/src/components/layout/footer.test.tsx
+++ b/src/components/layout/footer.test.tsx
@@ -32,6 +32,42 @@ jest.mock('lucide-react', () => ({
MapPin: () =>
,
}));
+jest.mock('@/lib/site-config', () => ({
+ useSiteConfig: () => ({
+ name: '四川睿新致远科技有限公司',
+ shortName: '睿新致遠',
+ displayName: '睿新致远',
+ description: '以智慧连接数字趋势,以伙伴身份陪您成长',
+ email: 'contact@novalon.cn',
+ address: '中国四川省成都市龙泉驿区幸福路12号',
+ icp: '蜀ICP备XXXXXXXX号',
+ police: '川公网安备XXXXXXXXXXX号',
+ megaDropdown: {
+ products: [
+ {
+ id: 'group1',
+ title: '企业套装',
+ items: [
+ { id: 'erp', title: 'ERP 管理系统', description: '财务·采购·销售·库存·生产', href: '/products/erp' },
+ { id: 'crm', title: 'CRM 客户管理', description: '线索·商机·合同·服务', href: '/products/crm' },
+ ],
+ },
+ ],
+ solutions: [
+ {
+ id: 'group1',
+ title: '行业解决方案',
+ items: [
+ { id: 'manufacturing', title: '制造业', description: '智能制造·MES·质量管控', href: '/solutions/manufacturing' },
+ { id: 'retail', title: '零售业', description: '全渠道·会员·精准营销', href: '/solutions/retail' },
+ ],
+ },
+ ],
+ },
+ }),
+ SiteConfigProvider: ({ children }: { children: React.ReactNode }) => <>{children}>,
+}));
+
jest.mock('@/lib/constants', () => ({
COMPANY_INFO: {
name: '四川睿新致远科技有限公司',
@@ -44,21 +80,26 @@ jest.mock('@/lib/constants', () => ({
icp: '蜀ICP备XXXXXXXX号',
police: '川公网安备XXXXXXXXXXX号',
},
- NAVIGATION_V2: [
- { id: 'products', label: '产品', href: '/products' },
- { id: 'solutions', label: '解决方案', href: '/solutions' },
- { id: 'services', label: '服务', href: '/services' },
- { id: 'about', label: '关于我们', href: '/about' },
- { id: 'contact', label: '联系我们', href: '/contact' },
- ],
MEGA_DROPDOWN_DATA: {
products: [
- { id: 'erp', title: 'ERP 管理系统', description: '财务·采购·销售·库存·生产', href: '/products/erp' },
- { id: 'crm', title: 'CRM 客户管理', description: '线索·商机·合同·服务', href: '/products/crm' },
+ {
+ id: 'group1',
+ title: '企业套装',
+ items: [
+ { id: 'erp', title: 'ERP 管理系统', description: '财务·采购·销售·库存·生产', href: '/products/erp' },
+ { id: 'crm', title: 'CRM 客户管理', description: '线索·商机·合同·服务', href: '/products/crm' },
+ ],
+ },
],
solutions: [
- { id: 'manufacturing', title: '制造业', description: '智能制造·MES·质量管控', href: '/solutions/manufacturing' },
- { id: 'retail', title: '零售业', description: '全渠道·会员·精准营销', href: '/solutions/retail' },
+ {
+ id: 'group1',
+ title: '行业解决方案',
+ items: [
+ { id: 'manufacturing', title: '制造业', description: '智能制造·MES·质量管控', href: '/solutions/manufacturing' },
+ { id: 'retail', title: '零售业', description: '全渠道·会员·精准营销', href: '/solutions/retail' },
+ ],
+ },
],
},
}));
@@ -87,26 +128,18 @@ describe('Footer', () => {
expect(screen.getByText('以智慧连接数字趋势,以伙伴身份陪您成长')).toBeInTheDocument();
});
- it('should render quick links section', () => {
- render(
);
- expect(screen.getByText('快速导航')).toBeInTheDocument();
- });
-
it('should render products section', () => {
render(
);
- const productHeadings = screen.getAllByText('产品');
- expect(productHeadings.length).toBeGreaterThan(0);
+ expect(screen.getByText('产品')).toBeInTheDocument();
+ });
+
+ it('should render solutions section', () => {
+ render(
);
+ expect(screen.getByText('解决方案')).toBeInTheDocument();
});
it('should render contact information section', () => {
render(
);
- expect(screen.getByText('联系方式')).toBeInTheDocument();
- });
-
- it('should render navigation links', () => {
- render(
);
- expect(screen.getByText('服务')).toBeInTheDocument();
- expect(screen.getByText('关于我们')).toBeInTheDocument();
expect(screen.getByText('联系我们')).toBeInTheDocument();
});
@@ -116,6 +149,12 @@ describe('Footer', () => {
expect(screen.getByText('CRM 客户管理')).toBeInTheDocument();
});
+ it('should render solution links', () => {
+ render(
);
+ expect(screen.getByText('制造业')).toBeInTheDocument();
+ expect(screen.getByText('零售业')).toBeInTheDocument();
+ });
+
it('should render contact details', () => {
render(
);
expect(screen.getByText('contact@novalon.cn')).toBeInTheDocument();
@@ -124,10 +163,10 @@ describe('Footer', () => {
});
describe('Card Layout', () => {
- it('should render three card sections', () => {
+ it('should render four card sections', () => {
render(
);
const cards = screen.getAllByTestId(/card/);
- expect(cards.length).toBeGreaterThanOrEqual(3);
+ expect(cards.length).toBeGreaterThanOrEqual(4);
});
it('should render brand card with logo and description', () => {
@@ -136,17 +175,16 @@ describe('Footer', () => {
expect(screen.getByText('以智慧连接数字趋势,以伙伴身份陪您成长')).toBeInTheDocument();
});
- it('should render navigation card with quick links and products', () => {
+ it('should render products and solutions cards', () => {
render(
);
- expect(screen.getByText('快速导航')).toBeInTheDocument();
- const productHeadings = screen.getAllByText('产品');
- expect(productHeadings.length).toBeGreaterThan(0);
+ expect(screen.getByTestId('card-products')).toBeInTheDocument();
+ expect(screen.getByTestId('card-solutions')).toBeInTheDocument();
});
it('should render contact card with contact info and QR code', () => {
render(
);
- expect(screen.getByText('联系方式')).toBeInTheDocument();
- expect(screen.getByText('企业微信业务咨询')).toBeInTheDocument();
+ expect(screen.getByTestId('card-contact')).toBeInTheDocument();
+ expect(screen.getByText('关注公众号')).toBeInTheDocument();
});
});
@@ -221,16 +259,5 @@ describe('Footer', () => {
render(
);
expect(screen.getByText('关注公众号')).toBeInTheDocument();
});
-
- it('should render Enterprise WeChat QR code image', () => {
- render(
);
- const qrCode = screen.getByAltText('企业微信业务咨询二维码');
- expect(qrCode).toBeInTheDocument();
- });
-
- it('should render Enterprise WeChat QR code description', () => {
- render(
);
- expect(screen.getByText('企业微信业务咨询')).toBeInTheDocument();
- });
});
});
diff --git a/src/components/layout/footer.tsx b/src/components/layout/footer.tsx
index 46c90bc..bd76312 100644
--- a/src/components/layout/footer.tsx
+++ b/src/components/layout/footer.tsx
@@ -1,76 +1,51 @@
+'use client';
+
import { StaticLink } from '@/components/ui/static-link';
import Image from 'next/image';
import { Mail, MapPin } from 'lucide-react';
-import { COMPANY_INFO, NAVIGATION_V2, MEGA_DROPDOWN_DATA } from '@/lib/constants';
+import { useSiteConfig } from '@/lib/site-config';
export function Footer() {
+ const config = useSiteConfig();
+ const productItems = (config.megaDropdown.products ?? [])
+ .flatMap(group => group.items)
+ .filter(item => item.href !== '#');
+
+ const solutionItems = (config.megaDropdown.solutions ?? [])
+ .flatMap(group => group.items);
+
return (
-