diff --git a/app/components/news/body/Culturebg.tsx b/app/components/news/body/Culturebg.tsx index 25a08c5..f87bb55 100644 --- a/app/components/news/body/Culturebg.tsx +++ b/app/components/news/body/Culturebg.tsx @@ -1,7 +1,7 @@ import React from 'react'; export default function CultureBgPage() { - // 定义logo数据 + // 定义logo数据数组,包含16个logo信息 const logos = [ { id: 1, src: '/public/logo/1.png', alt: 'Logo 1' }, { id: 2, src: '/public/logo/1.png', alt: 'Logo 2' }, @@ -22,28 +22,36 @@ export default function CultureBgPage() { ]; return ( + // 主容器:固定高度700px,宽度1550px,水平居中,相对定位
+ {/* 背景图片容器:高度200px,全宽,背景图片覆盖整个容器 */}
+ {/* 内容区域容器:高度500px,全宽,绝对定位距离顶部30px,使用flex布局居中内容,设置内边距 */}
+ {/* 内部容器:全宽全高,使用flex布局居中内容,下边距10px */}
- {/* 两行八列:flex + wrap */} + {/* Logo网格容器:使用flex布局并允许换行,内容居中,设置水平和垂直间距 */} + {/* 注释说明:通过flex-wrap实现每行8个logo后自动换行形成两行布局 */}
+ {/* 遍历logo数组,渲染每个logo图片 */} {logos.map((logo) => ( {logo.alt} ))}
diff --git a/app/components/news/body/Integrated.tsx b/app/components/news/body/Integrated.tsx index 96817c3..1d292ca 100644 --- a/app/components/news/body/Integrated.tsx +++ b/app/components/news/body/Integrated.tsx @@ -14,12 +14,14 @@ import { FaPenRuler, } from 'react-icons/fa6'; +// 定义服务项的类型接口 type ServiceItem = { - icon: IconType; - label: string; - href: string; + icon: IconType; // 图标组件 + label: string; // 显示标签 + href: string; // 链接地址 }; +// 服务项数据数组 const services: ServiceItem[] = [ { icon: FaUserGraduate, label: '警队自考', href: '/study' }, { icon: FaUserShield, label: '警队教育', href: '/scholarship' }, @@ -35,31 +37,46 @@ const services: ServiceItem[] = [ { icon: FaPenRuler, label: '学习平台', href: '/study' }, ]; +// 将一维服务数组转换为三维数组,分为3列,每列4个服务项 +// 结构: [[列1的4项], [列2的4项], [列3的4项]] const columns = Array.from({ length: 3 }, (_, colIndex) => services.slice(colIndex * 4, colIndex * 4 + 4) ); export default function Integrated() { return ( + // 主容器:固定宽度1514px,高度573px,水平居中
+ {/* 内容容器:全宽,高度488px */}
+ {/* 标题栏:全宽,高度82px,使用flex布局垂直居中内容 */}
+ {/* 装饰性蓝色竖条 */}
+ {/* 标题文字:深蓝色,加粗,4xl字号 */}

综合服务

+ {/* 服务项容器:使用flex布局排列三列,列间距45px,设置内边距 */}
+ {/* 遍历三列数据 */} {columns.map((group, colIdx) => ( + // 每列容器:flex-1平均分配宽度,使用2列网格布局,设置网格间距