From 1ea4a91ec695731c36087685485cb6083ce2f4c3 Mon Sep 17 00:00:00 2001 From: qiuchenfan <2035024011@qq.com> Date: Tue, 18 Nov 2025 17:26:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9lunbotu=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/Carousel.tsx | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/app/components/Carousel.tsx b/app/components/Carousel.tsx index eb036a4..eeb7795 100755 --- a/app/components/Carousel.tsx +++ b/app/components/Carousel.tsx @@ -1,4 +1,3 @@ -// src/components/CarouselDemo.tsx import * as React from "react"; import Autoplay from "embla-carousel-autoplay"; @@ -11,11 +10,7 @@ import { CarouselPrevious, type CarouselApi, } from "@/ui/carousel"; -<<<<<<< HEAD:app/components/untils/Carousel.tsx -import FireNewsList from "./FireNewsList"; -======= const imageUrls = [ ->>>>>>> 1d49f000efd9f3e6ac13da4e459b8e1e600c3335:app/components/Carousel.tsx "/images/carousel-1.jpg", "/images/carousel-2.jpg", @@ -62,24 +57,12 @@ export function CarouselDemo() {
-<<<<<<< HEAD:app/components/untils/Carousel.tsx - -
-
-======= {`Slide ->>>>>>> 1d49f000efd9f3e6ac13da4e459b8e1e600c3335:app/components/Carousel.tsx
@@ -90,15 +73,6 @@ export function CarouselDemo() { - {/* 要闻列表 - 右上角 */} -
- - - - - -
- {/* 分页指示器 - 右下角 */}
{Array.from({ length: count }).map((_, index) => ( From 90ccecda1d42b13bc741e3b47f093344a87a44c4 Mon Sep 17 00:00:00 2001 From: qiuchenfan <2035024011@qq.com> Date: Tue, 18 Nov 2025 17:35:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/news/body/Culturebg.tsx | 2 +- app/components/news/body/Integrated.tsx | 2 +- app/routes/news.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/news/body/Culturebg.tsx b/app/components/news/body/Culturebg.tsx index cd5f0c4..25a08c5 100644 --- a/app/components/news/body/Culturebg.tsx +++ b/app/components/news/body/Culturebg.tsx @@ -22,7 +22,7 @@ export default function CultureBgPage() { ]; return ( -
+
export default function Integrated() { return ( -
+
diff --git a/app/routes/news.tsx b/app/routes/news.tsx index 7a8f095..60a2a4a 100755 --- a/app/routes/news.tsx +++ b/app/routes/news.tsx @@ -19,11 +19,11 @@ export default function Home() {
- - + +
); } From 1201c37eaf7e3bcc79b5f5027c934bd5241f3eb1 Mon Sep 17 00:00:00 2001 From: jinsir <874871581@qq.com> Date: Tue, 18 Nov 2025 17:36:30 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/body/GrassrootsDynamics.tsx | 20 ++++++++++ app/components/list/List.tsx | 46 ++++++++++++++++++++++ app/components/list/NewsData.tsx | 19 ++++++++- app/components/list/NewsList.tsx | 10 ++++- app/routes/news.tsx | 4 ++ 5 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 app/components/body/GrassrootsDynamics.tsx create mode 100644 app/components/list/List.tsx diff --git a/app/components/body/GrassrootsDynamics.tsx b/app/components/body/GrassrootsDynamics.tsx new file mode 100644 index 0000000..3c64040 --- /dev/null +++ b/app/components/body/GrassrootsDynamics.tsx @@ -0,0 +1,20 @@ +import React from 'react'; +import List from '../list/List'; + +export default function GrassrootsDynamics() { + return ( +
+ {/* 左边图片 */} +
+ 基层动态 +
+ {/* 右边列表 */} +
+ +
+
+ ); +} \ No newline at end of file diff --git a/app/components/list/List.tsx b/app/components/list/List.tsx new file mode 100644 index 0000000..0034864 --- /dev/null +++ b/app/components/list/List.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { mockNewsData } from './NewsData'; // 导入新闻数据 + + + +interface NewsProps { + title?: string; + description?: string; + time?: string; + type?: string; + url?: string; +} + + +const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { + return ( +
+
url && window.open(url)} + className="flex items-center justify-between hover:text-blue-600 cursor-pointer transition duration-300 ease-in-out" + > +

{title}

+

{time}

+
+
+ ); +}; + +// 使用新闻数据渲染列表 +const List: React.FC = () => { + return ( +
+
+
+
    + {mockNewsData.map((news) => ( + + ))} +
+
+
+
+ ); +}; + +export default List; \ No newline at end of file diff --git a/app/components/list/NewsData.tsx b/app/components/list/NewsData.tsx index 4d22885..d1d6c17 100644 --- a/app/components/list/NewsData.tsx +++ b/app/components/list/NewsData.tsx @@ -6,6 +6,10 @@ export interface News { url?: string; } +export interface NewsTitle { + id: string; + name: string; +} // 导出生成的模拟新闻数据 export const NewsData = (): News[] => { return [ @@ -25,5 +29,18 @@ export const NewsData = (): News[] => { ]; }; +export const NewsTitleData = (): NewsTitle[] => { + return [ + { id: "news-1", name: "科技" }, + { id: "news-2", name: "财经" }, + { id: "news-3", name: "娱乐" }, + { id: "news-4", name: "体育" }, + { id: "news-5", name: "教育" }, + { id: "news-6", name: "军事" }, + ] +} + + // 默认导出模拟新闻数据 -export const mockNewsData = NewsData(); \ No newline at end of file +export const mockNewsData = NewsData(); +export const mockNewsTitleData = NewsTitleData(); \ No newline at end of file diff --git a/app/components/list/NewsList.tsx b/app/components/list/NewsList.tsx index bdc5959..34160e7 100644 --- a/app/components/list/NewsList.tsx +++ b/app/components/list/NewsList.tsx @@ -1,5 +1,7 @@ import React from 'react'; import { mockNewsData } from './NewsData'; // 导入新闻数据 +import { mockNewsTitleData } from './NewsData'; // 导入新闻标题数据 + interface NewsProps { title?: string; @@ -9,6 +11,10 @@ interface NewsProps { url?: string; } +interface NewsTitle { + id: string; + name: string; +} const NewsItem: React.FC = ({ title = '', time = '', url = '' }) => { return (
@@ -37,8 +43,8 @@ const NewsList: React.FC = () => {
    - {mockNewsData.map((news, index) => ( - + {mockNewsData.map((news) => ( + ))}
diff --git a/app/routes/news.tsx b/app/routes/news.tsx index eaba461..ce5816f 100755 --- a/app/routes/news.tsx +++ b/app/routes/news.tsx @@ -3,6 +3,7 @@ import type { Route } from "./+types/news"; import {Header} from "@/components/header/Header"; import {TopNav} from "@/components/header/TopNav"; import NewsList from "@/components/list/NewsList"; +import GrassrootsDynamics from "@/components/body/GrassrootsDynamics"; export function meta( ) { return [ { title: "New React Router App" }, @@ -13,8 +14,11 @@ export function meta( ) { export default function Home() { return (
+
+ +
); }