- {/* 两行八列:flex + wrap */}
+ {/* Logo网格容器:使用flex布局并允许换行,内容居中,设置水平和垂直间距 */}
+ {/* 注释说明:通过flex-wrap实现每行8个logo后自动换行形成两行布局 */}
+ {/* 遍历logo数组,渲染每个logo图片 */}
{logos.map((logo) => (

))}
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列网格布局,设置网格间距
);
}