956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 1 | import React from "react"; |
ssq | 5067cb9 | 2025-06-05 11:44:23 +0000 | [diff] [blame] | 2 | import { BrowserRouter as Router, Routes, Route, useNavigate, Link, Navigate } from "react-router-dom"; |
wht | 10563a8 | 2025-06-08 15:52:18 +0800 | [diff] [blame^] | 3 | import HomeIcon from "@mui/icons-material/Home"; |
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 4 | import MovieIcon from "@mui/icons-material/Movie"; |
| 5 | import EmailIcon from "@mui/icons-material/Email"; |
| 6 | import MusicNoteIcon from "@mui/icons-material/MusicNote"; |
| 7 | import EmojiPeopleIcon from "@mui/icons-material/EmojiPeople"; |
| 8 | import SportsEsportsIcon from "@mui/icons-material/SportsEsports"; |
| 9 | import SportsMartialArtsIcon from "@mui/icons-material/SportsMartialArts"; |
| 10 | import PersonIcon from "@mui/icons-material/Person"; |
| 11 | import AccountCircleIcon from "@mui/icons-material/AccountCircle"; |
wht | 6a1b678 | 2025-06-06 19:14:59 +0800 | [diff] [blame] | 12 | import ForumIcon from "@mui/icons-material/Forum"; |
wht | dc90a03 | 2025-06-08 03:03:52 +0800 | [diff] [blame] | 13 | import HelpIcon from "@mui/icons-material/Help"; |
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 14 | import "./App.css"; |
| 15 | import MoviePage from "./MoviePage"; |
| 16 | import TVPage from "./TVPage"; |
| 17 | import MusicPage from "./MusicPage"; |
| 18 | import AnimePage from "./AnimePage"; |
| 19 | import GamePage from "./GamePage"; |
| 20 | import SportPage from "./SportPage"; |
| 21 | import InfoPage from "./InfoPage"; |
| 22 | import UserProfile from "./UserProfile"; |
956303669 | 9e95ae3 | 2025-06-02 21:42:11 +0800 | [diff] [blame] | 23 | import PublishPage from "./PublishPage"; |
| 24 | import TorrentDetailPage from './TorrentDetailPage'; |
wht | 6a1b678 | 2025-06-06 19:14:59 +0800 | [diff] [blame] | 25 | import ForumPage from "./ForumPage"; |
| 26 | import PostDetailPage from "./PostDetailPage"; |
ssq | 5067cb9 | 2025-06-05 11:44:23 +0000 | [diff] [blame] | 27 | import LoginPage from './LoginPage'; |
| 28 | import RegisterPage from './RegisterPage'; |
22301133 | 38fd388 | 2025-06-06 23:33:57 +0800 | [diff] [blame] | 29 | import RequireAuth from './RequireAuth'; |
wht | b1e7959 | 2025-06-07 16:03:09 +0800 | [diff] [blame] | 30 | import AdminPage from './AdminPage'; |
| 31 | import AppealPage from './AppealPage'; |
| 32 | import MigrationPage from './MigrationPage'; |
wht | dc90a03 | 2025-06-08 03:03:52 +0800 | [diff] [blame] | 33 | import BegSeedPage from "./BegSeedPage"; |
| 34 | import BegInfo from "./BegInfo"; |
wht | 10563a8 | 2025-06-08 15:52:18 +0800 | [diff] [blame^] | 35 | import SeedPromotionPage from "./SeedPromotionPage"; |
| 36 | import HomePage from "./HomePage"; |
wht | b1e7959 | 2025-06-07 16:03:09 +0800 | [diff] [blame] | 37 | |
wht | 6a1b678 | 2025-06-06 19:14:59 +0800 | [diff] [blame] | 38 | |
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 39 | const navItems = [ |
| 40 | { label: "电影", icon: <MovieIcon />, path: "/movie" }, |
| 41 | { label: "剧集", icon: <EmailIcon />, path: "/tv" }, |
| 42 | { label: "音乐", icon: <MusicNoteIcon />, path: "/music" }, |
| 43 | { label: "动漫", icon: <EmojiPeopleIcon />, path: "/anime" }, |
| 44 | { label: "游戏", icon: <SportsEsportsIcon />, path: "/game" }, |
| 45 | { label: "体育", icon: <SportsMartialArtsIcon />, path: "/sport" }, |
| 46 | { label: "资料", icon: <PersonIcon />, path: "/info" }, |
wht | 6a1b678 | 2025-06-06 19:14:59 +0800 | [diff] [blame] | 47 | { label: "论坛", icon: <ForumIcon />, path: "/forum" }, |
| 48 | { label: "发布", icon: <AccountCircleIcon />, path: "/publish" }, |
wht | dc90a03 | 2025-06-08 03:03:52 +0800 | [diff] [blame] | 49 | { label: "求种", icon: <HelpIcon />, path: "/begseed" }, |
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 50 | ]; |
| 51 | |
| 52 | function Home() { |
| 53 | const navigate = useNavigate(); |
| 54 | return ( |
| 55 | <div className="container"> |
| 56 | {/* 顶部空白与电影界面一致 */} |
| 57 | <div style={{ height: 80 }} /> |
| 58 | {/* 用户栏 */} |
| 59 | <div className="user-bar" style={{ position: 'fixed', top: 18, right: 42, zIndex: 100, display: 'flex', alignItems: 'center', background: '#e0f3ff', borderRadius: 12, padding: '6px 18px', boxShadow: '0 2px 8px #b2d8ea', minWidth: 320, minHeight: 48, width: 420 }}> |
| 60 | <div style={{ cursor: 'pointer', marginRight: 16 }} onClick={() => navigate('/user')}> |
| 61 | <AccountCircleIcon style={{ fontSize: 38, color: '#1a237e', background: '#e0f3ff', borderRadius: '50%' }} /> |
| 62 | </div> |
| 63 | <div style={{ color: '#222', fontWeight: 500, marginRight: 24 }}>用户栏</div> |
| 64 | <div style={{ display: 'flex', gap: 28, flex: 1, justifyContent: 'flex-end', alignItems: 'center' }}> |
| 65 | <span style={{ color: '#1976d2', fontWeight: 500 }}>魔力值: <b>12345</b></span> |
| 66 | <span style={{ color: '#1976d2', fontWeight: 500 }}>分享率: <b>2.56</b></span> |
| 67 | <span style={{ color: '#1976d2', fontWeight: 500 }}>上传量: <b>100GB</b></span> |
| 68 | <span style={{ color: '#1976d2', fontWeight: 500 }}>下载量: <b>50GB</b></span> |
| 69 | </div> |
| 70 | </div> |
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 71 | <div style={{ height: 32 }} /> |
| 72 | <nav className="nav-bar card"> |
| 73 | {navItems.map((item) => ( |
| 74 | <div |
| 75 | key={item.label} |
| 76 | className={"nav-item"} |
| 77 | onClick={() => navigate(item.path)} |
| 78 | > |
| 79 | {item.icon} |
| 80 | <span>{item.label}</span> |
| 81 | </div> |
| 82 | ))} |
| 83 | </nav> |
| 84 | <div className="search-section card"> |
| 85 | <input className="search-input" placeholder="输入搜索关键词" /> |
| 86 | <button className="search-btn"> |
| 87 | <span role="img" aria-label="search">🔍</span> |
| 88 | </button> |
| 89 | </div> |
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 90 | <div className="table-section card"> |
| 91 | <table className="movie-table"> |
| 92 | <thead> |
| 93 | <tr> |
| 94 | <th>类型</th> |
| 95 | <th>标题</th> |
| 96 | <th>发布者</th> |
| 97 | </tr> |
| 98 | </thead> |
| 99 | <tbody> |
| 100 | <tr> |
| 101 | <td>电影</td> |
| 102 | <td></td> |
| 103 | <td></td> |
| 104 | </tr> |
| 105 | <tr> |
| 106 | <td>剧集</td> |
| 107 | <td></td> |
| 108 | <td></td> |
| 109 | </tr> |
| 110 | <tr> |
| 111 | <td>音乐</td> |
| 112 | <td></td> |
| 113 | <td></td> |
| 114 | </tr> |
| 115 | <tr> |
| 116 | <td>动漫</td> |
| 117 | <td></td> |
| 118 | <td></td> |
| 119 | </tr> |
| 120 | <tr> |
| 121 | <td>游戏</td> |
| 122 | <td></td> |
| 123 | <td></td> |
| 124 | </tr> |
| 125 | </tbody> |
| 126 | </table> |
| 127 | </div> |
| 128 | <div style={{ height: 32 }} /> |
| 129 | <Pagination /> |
| 130 | </div> |
| 131 | ); |
| 132 | } |
| 133 | |
| 134 | function Pagination() { |
| 135 | const [page, setPage] = React.useState(3); |
| 136 | const total = 5; |
| 137 | return ( |
| 138 | <div className="pagination"> |
| 139 | <button onClick={() => setPage(p => Math.max(1, p - 1))} disabled={page === 1}>上一页</button> |
| 140 | <span className="page-num">{page}/{total}</span> |
| 141 | <button onClick={() => setPage(p => Math.min(total, p + 1))} disabled={page === total}>下一页</button> |
| 142 | <span className="page-info">第 <b>{page}</b> 页</span> |
| 143 | </div> |
| 144 | ); |
| 145 | } |
| 146 | |
| 147 | function Page({ label }) { |
| 148 | return ( |
| 149 | <div style={{ padding: 40, fontSize: 32 }}> |
| 150 | {label} 页面(可自定义内容) |
| 151 | <br /> |
| 152 | <Link to="/">返回首页</Link> |
| 153 | </div> |
| 154 | ); |
| 155 | } |
| 156 | |
| 157 | export default function App() { |
| 158 | return ( |
| 159 | <Router> |
| 160 | <Routes> |
ssq | 5067cb9 | 2025-06-05 11:44:23 +0000 | [diff] [blame] | 161 | <Route path="/login" element={<LoginPage />} /> |
| 162 | <Route path="/register" element={<RegisterPage />} /> |
| 163 | <Route path="/" element={<Navigate to="/login" replace />} /> |
22301133 | 38fd388 | 2025-06-06 23:33:57 +0800 | [diff] [blame] | 164 | {/* Protected routes */} |
| 165 | <Route element={<RequireAuth />}> |
wht | 10563a8 | 2025-06-08 15:52:18 +0800 | [diff] [blame^] | 166 | <Route path="/home" element={<HomePage />} /> |
22301133 | 38fd388 | 2025-06-06 23:33:57 +0800 | [diff] [blame] | 167 | <Route path="/movie" element={<MoviePage />} /> |
| 168 | <Route path="/tv" element={<TVPage />} /> |
| 169 | <Route path="/music" element={<MusicPage />} /> |
| 170 | <Route path="/anime" element={<AnimePage />} /> |
| 171 | <Route path="/game" element={<GamePage />} /> |
| 172 | <Route path="/sport" element={<SportPage />} /> |
| 173 | <Route path="/forum" element={<ForumPage />} /> |
| 174 | <Route path="/forum/:postId" element={<PostDetailPage />} /> |
| 175 | <Route path="/info" element={<InfoPage />} /> |
| 176 | <Route path="/user" element={<UserProfile />} /> |
| 177 | <Route path="/publish" element={<PublishPage />} /> |
| 178 | <Route path="/torrent/:torrentId" element={<TorrentDetailPage />} /> |
wht | b1e7959 | 2025-06-07 16:03:09 +0800 | [diff] [blame] | 179 | <Route path="/admin" element={<AdminPage />} /> |
| 180 | <Route path="/appeal-review" element={<AppealPage />} /> |
| 181 | <Route path="/migration-review" element={<MigrationPage />} /> |
wht | 10563a8 | 2025-06-08 15:52:18 +0800 | [diff] [blame^] | 182 | <Route path="/seed-promotion" element={<SeedPromotionPage />} /> |
wht | dc90a03 | 2025-06-08 03:03:52 +0800 | [diff] [blame] | 183 | <Route path="/begseed" element={<BegSeedPage />} /> |
| 184 | <Route path="/begseed/:begid" element={<BegInfo />} /> |
22301133 | 38fd388 | 2025-06-06 23:33:57 +0800 | [diff] [blame] | 185 | </Route> |
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 186 | </Routes> |
| 187 | </Router> |
| 188 | ); |
| 189 | } |