Compare commits

...

2 Commits

Author SHA1 Message Date
jinsir b477d75218 Merge branch 'main' of http://113.45.67.59:3003/qiuchenfan/news 2025-11-18 21:01:53 +08:00
jinsir 1b9f1884b8 list 组件 2025-11-18 21:01:42 +08:00
2 changed files with 25 additions and 16 deletions

View File

@ -3,18 +3,27 @@ import List from '../list/List';
export default function GrassrootsDynamics() {
return (
<div className="grid grid-cols-2 gap-6 bg-gray-50 p-6 rounded-2xl shadow-xl">
{/* 左边图片 */}
<div className="w-full h-auto rounded-lg shadow-md">
<img
src="/images/carousel-1.jpg"
alt="基层动态"
/>
</div>
{/* 右边列表 */}
<div>
<List />
</div>
</div>
<div className="flex bg-white rounded-2xl shadow-xl overflow-hidden">
{/* 左边图片 */}
<div className="w-2/5 bg-pink-50 p-6 flex flex-col items-center justify-center relative">
{/* 装饰图形 */}
<div className="absolute top-4 left-4 w-16 h-16 bg-blue-500 rounded-full opacity-80"></div>
<div className="absolute bottom-4 right-4 w-20 h-20 bg-blue-500 rounded-full opacity-80"></div>
{/* 图片 */}
<div className="w-full h-64 flex items-center justify-center overflow-hidden rounded-lg">
<img
src="/images/carousel-1.jpg"
alt="基层动态"
className="w-full h-full object-cover"
/>
</div>
</div>
{/* 右边列表 */}
<div className="w-3/5 bg-blue-100 text-white p-6">
<List />
</div>
</div>
);
}

View File

@ -29,9 +29,9 @@ const NewsItem: React.FC<NewsProps> = ({ title = '', time = '', url = '' }) => {
// 使用新闻数据渲染列表
const List: React.FC = () => {
return (
<div className=" ">
<div className="grid grid-cols-1 md:grid-cols-2 ">
<div className=" p-6 rounded-lg ">
<div >
<div >
<div className=" p-6 ">
<ul className="space-y-4">
{mockNewsData.map((news) => (
<NewsItem title={news.title} time={news.time} url={news.url} />