blob: 345f8807e2b9ed7ec91ac0c847db1b7340b32ff4 [file] [log] [blame]
San3yuan4d0e8032025-04-04 17:21:40 +08001import React from "react";
2import { Navigate } from "react-router";
San3yuan2534d422025-04-08 21:43:18 +08003import SelfStatus from "@/components/selfStatus/selfStatus";
San3yuan4d0e8032025-04-04 17:21:40 +08004
San3yuan6f2ed692025-04-16 20:24:49 +08005import style from "./index.module.css";
San3yuan03ab0642025-04-29 18:00:25 +08006import Navbar from "@/components/navbar/navbar";
7import PostsPanel from "@/components/postsPanel/postsPanel";
8import { hotPosts } from "@/api/post";
9import { Carousel } from 'antd';
10import ad1 from '&/assets/ad1.png'
11import ad2 from '&/assets/ad2.png'
12import { useEffect } from "react";
San3yuan6f2ed692025-04-16 20:24:49 +080013
San3yuan4d0e8032025-04-04 17:21:40 +080014export default function Forum() {
San3yuan03ab0642025-04-29 18:00:25 +080015 useEffect(() => {
16 // 禁止滚动
17 document.body.style.overflow = 'hidden';
San3yuan4d0e8032025-04-04 17:21:40 +080018
San3yuan03ab0642025-04-29 18:00:25 +080019 // 组件卸载时恢复滚动
20 return () => {
21 document.body.style.overflow = 'auto';
22 };
23 }, []);
24
25
San3yuan4d0e8032025-04-04 17:21:40 +080026 return (
San3yuan6f2ed692025-04-16 20:24:49 +080027 <div className={style.container}>
San3yuan03ab0642025-04-29 18:00:25 +080028 <div className={style.up}>
29 <div className={style.upleft}>
30 <div className={style.navbar}>
31 <Navbar/>
32 </div>
33 <div className={style.upcontent}>
34 <div className={style.advertisements}>
35 <Carousel arrows infinite={false}>
36 <div>
37 <img src={ad1} alt="广告1" className={style.adImage} />
38 </div>
39 <div>
40 <img src={ad2} alt="广告2" className={style.adImage} />
41 </div>
42 </Carousel>
43 </div>
44 <div className={style.hotPosts}>
45 <PostsPanel name='热门种子' url={hotPosts} limit={5}/>
46 </div>
47 </div>
48 </div>
49 <div className={style.upright}>
50 <div className={style.selfStatus}>
51 <SelfStatus />
52 </div>
53 </div>
54 </div>
55 <div className={style.down}>
56 <div className={style.newPost}>
57 <PostsPanel name='最新发布' url={hotPosts} limit={5}/>
58 </div>
59 <div className={style.likePost}>
60 <PostsPanel name='猜你喜欢' url={hotPosts} limit={5}/>
61 </div>
62 <div className={style.forsalePost}>
63 <PostsPanel name='促销种子' url={hotPosts} limit={5}/>
64 </div>
San3yuan6f2ed692025-04-16 20:24:49 +080065 </div>
San3yuan4d0e8032025-04-04 17:21:40 +080066 </div>
67 );
68}