- {/* 左侧图片区 */}
-
-
- {/* 上左:第一张图 */}
-
-
-
-
- {/* 上右:轮播图 */}
-
-
-
-
- {/* 下三图 */}
- {[3, 4, 5].map((i) => (
-
-
+ {/* 顶部Logo区:使用背景图片方式展示logo,宽70高20 */}
+
+
+
+ {/* 左侧图片区:占据屏幕3/5的宽度 */}
+
+ {/* 使用grid布局来安排图片的位置 */}
+
+ {/* 上左第一张图 */}
+
+
- ))}
+
+ {/* 上右轮播图 */}
+
+
+
+
+ {/* 下三图:动态渲染 */}
+ {[3, 4, 6].map((i) => (
+
+
+
+ ))}
+
+
+
+ {/* 右侧新闻列表:占据屏幕剩余2/5的宽度 */}
+
+
+ {newsList.map((item) => (
+
+ •
+ window.open(item.url, '_blank')}>{item.content}
+
+ ))}
+
-
- {/* 右侧新闻列表 */}
-
-
- {newsList.map((item, index) => (
-
- •
- {item}
-
- ))}
-
+ {/* 底部两个特色区域,分别展示书籍信息 */}
+
+ {/* 左边书籍区域 */}
+
+
+ {/* 左边容器内的文本内容 */}
+
+
+ 习近平新时代中国特色社会主义思想专题数据库
+
+
+
+
+ {/* 右边书籍区域 */}
+
+
+ {/* 右边容器内的文本内容 */}
+
+
-
-
-
-
- {/* 左边容器内容 */}
-
-
- 习近平新时代中国特色社会
-
- 主义思想专题数据库
-
-
-
-
-
-
-
+
+
+
+
+
);
};
-export default LearnPage;
\ No newline at end of file
+export default LearnPage;
\ No newline at end of file
diff --git a/app/components/news/body/Integrated.tsx b/app/components/news/body/Integrated.tsx
index 1d292ca..80feb58 100644
--- a/app/components/news/body/Integrated.tsx
+++ b/app/components/news/body/Integrated.tsx
@@ -54,7 +54,9 @@ export default function Integrated() {
{/* 装饰性蓝色竖条 */}
{/* 标题文字:深蓝色,加粗,4xl字号 */}
-
综合服务
+
{/* 服务项容器:使用flex布局排列三列,列间距45px,设置内边距 */}
diff --git a/app/components/news/header/TopNav.tsx b/app/components/news/header/TopNav.tsx
index d9791e5..38d95fe 100644
--- a/app/components/news/header/TopNav.tsx
+++ b/app/components/news/header/TopNav.tsx
@@ -1,9 +1,10 @@
import { Search } from 'lucide-react';
-import React, { useState,useEffect} from 'react';
+import React, { useState, useEffect } from 'react';
import { Button } from '@/ui/button';
interface MenuItem {
label: string;
key: string;
+ sectionId:string;
}
interface TopNavProps {
@@ -15,31 +16,44 @@ interface TopNavProps {
export function TopNav({
menuItems = [
- { label: '首页', key: 'home' },
- { label: '烽火动态', key: 'news' },
- { label: '烽火铸魂', key: 'soul' },
- { label: '烽火训练', key: 'training' },
- { label: '联系热线', key: 'hotline' },
- { label: '综合服务', key: 'service' },
+ { label: '首页', key: 'home', sectionId:'home' },
+ { label: '烽火动态', key: 'news', sectionId:'fireNews' },
+ { label: '烽火铸魂', key: 'soul', sectionId:'soul' },
+ { label: '烽火训练', key: 'training', sectionId:'training' },
+ { label: '联系热线', key: 'hotline', sectionId:'hotline' },
+ { label: '综合服务', key: 'service', sectionId:'service' },
],
activeKey: externalActiveKey,
onSearch,
onItemClick,
-}: TopNavProps){
+}: TopNavProps) {
const [internalActiveKey, setInternalActiveKey] = useState('home');
const currentActiveKey = externalActiveKey !== undefined ? externalActiveKey : internalActiveKey;
const [searchKeyword, setSearchKeyword] = useState('');
-
+
const handleSearchSubmit = (e: React.FormEvent) => {
e.preventDefault();
onSearch?.(searchKeyword);
+
};
const handleItemClick = (item: MenuItem) => {
if (externalActiveKey === undefined) {
setInternalActiveKey(item.key);
}
+
+ // 如果有对应的 sectionId,则滚动到该区域
+ // if (item.sectionId) {
+ // const element = document.getElementById(item.sectionId);
+ // if (element) {
+ // element.scrollIntoView({
+ // behavior: 'smooth', // 平滑滚动
+ // block: 'start' // 滚动到顶部对齐
+ // });
+ // }
+ // }
+
onItemClick?.(item.key);
};
@@ -49,24 +63,24 @@ export function TopNav({
{/* 搜索框与导航菜单组合 */}
{/* 搜索框 */}
-
+
+ onClick={handleSearchSubmit}
+
+ >
- setSearchKeyword(e.target.value)}
- className="pl-5 pr-4 py-2 text-sm h-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-64 transition-all duration-200 hover:shadow-sm" />
+ setSearchKeyword(e.target.value)}
+ className="pl-5 pr-4 py-2 text-sm h-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-64 transition-all duration-200 hover:shadow-sm" />
-
-
- {/* 导航菜单 */}
+
+
+ {/* 导航菜单 */}
{menuItems.map((item) => {
const isActive = currentActiveKey === item.key;
@@ -74,9 +88,8 @@ export function TopNav({
handleItemClick(item)}
- className={`px-4 py-2 text-2xl font-extralight transition-all duration-500 relative z-10 ${
- isActive ? 'text-white' : 'text-gray-600 hover:font-bold'
- }`}
+ className={`px-4 py-2 text-2xl transition-all duration-500 relative z-10 ${isActive ? 'text-white font-bold' : 'text-gray-600 hover:font-bold cursor-pointer'
+ }`}
>
{/* 激活状态背景层 */}
{isActive && (
diff --git a/app/components/news/list/NewsList.tsx b/app/components/news/list/NewsList.tsx
index c5757a4..955401f 100644
--- a/app/components/news/list/NewsList.tsx
+++ b/app/components/news/list/NewsList.tsx
@@ -32,7 +32,7 @@ const NewsList: React.FC = () => {
{/* 使用 Flexbox 将两个列表放在一行 */}
{/* 科技新闻 */}
-
+
{/* 标题栏:独立于列表之外 */}
@@ -57,7 +57,7 @@ const NewsList: React.FC = () => {
{/* 教育新闻 */}
-
+
{/* 标题栏:独立于列表之外 */}
diff --git a/public/images/book2.png b/public/images/book2.png
index 4e6ea37..38a9984 100644
Binary files a/public/images/book2.png and b/public/images/book2.png differ
diff --git a/public/images/learn.png b/public/images/learn.png
new file mode 100644
index 0000000..db05395
Binary files /dev/null and b/public/images/learn.png differ