956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 1 | import React from "react";
|
| 2 | import MovieIcon from "@mui/icons-material/Movie";
|
| 3 | import EmailIcon from "@mui/icons-material/Email";
|
| 4 | import MusicNoteIcon from "@mui/icons-material/MusicNote";
|
| 5 | import EmojiPeopleIcon from "@mui/icons-material/EmojiPeople";
|
| 6 | import SportsEsportsIcon from "@mui/icons-material/SportsEsports";
|
| 7 | import SportsMartialArtsIcon from "@mui/icons-material/SportsMartialArts";
|
| 8 | import PersonIcon from "@mui/icons-material/Person";
|
| 9 | import AccountCircleIcon from "@mui/icons-material/AccountCircle";
|
| 10 | import { useNavigate } from "react-router-dom";
|
| 11 | import "./App.css";
|
| 12 |
|
| 13 | const navItems = [
|
| 14 | { label: "电影", icon: <MovieIcon />, path: "/movie" },
|
| 15 | { label: "剧集", icon: <EmailIcon />, path: "/tv" },
|
| 16 | { label: "音乐", icon: <MusicNoteIcon />, path: "/music" },
|
| 17 | { label: "动漫", icon: <EmojiPeopleIcon />, path: "/anime" },
|
| 18 | { label: "游戏", icon: <SportsEsportsIcon />, path: "/game" },
|
| 19 | { label: "体育", icon: <SportsMartialArtsIcon />, path: "/sport" },
|
| 20 | { label: "资料", icon: <PersonIcon />, path: "/info" },
|
956303669 | 9e95ae3 | 2025-06-02 21:42:11 +0800 | [diff] [blame^] | 21 | { label: "发布", icon: <AccountCircleIcon />, path: "/publish" }, // Added Publish option
|
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 22 | ];
|
| 23 |
|
| 24 | const tvTypes = [
|
| 25 | "华语剧集(大陆)",
|
| 26 | "欧美剧集",
|
| 27 | "日韩剧集",
|
| 28 | "港台剧集",
|
| 29 | "其他"
|
| 30 | ];
|
| 31 |
|
| 32 | const areaTabs = [
|
| 33 | { label: "大陆", icon: <MovieIcon fontSize="small" /> },
|
| 34 | { label: "港台", icon: <EmailIcon fontSize="small" /> },
|
| 35 | { label: "欧美", icon: <PersonIcon fontSize="small" /> },
|
| 36 | { label: "日韩", icon: <EmojiPeopleIcon fontSize="small" /> },
|
| 37 | { label: "其他", icon: <PersonIcon fontSize="small" /> },
|
| 38 | ];
|
| 39 |
|
956303669 | 9e95ae3 | 2025-06-02 21:42:11 +0800 | [diff] [blame^] | 40 | const exampleTorrents = [
|
| 41 | { type: "Drama", title: "实例1", id: 1 },
|
| 42 | { type: "Comedy", title: "实例2", id: 2 },
|
| 43 | { type: "Sci-Fi", title: "实例3", id: 3 },
|
| 44 | ];
|
| 45 |
|
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 46 | export default function TVPage() {
|
| 47 | const navigate = useNavigate();
|
| 48 | const [activeTab, setActiveTab] = React.useState(0);
|
| 49 |
|
| 50 | // 每个tab对应的剧集类型
|
| 51 | const tvTypesList = [
|
| 52 | ["华语剧集(大陆)", "欧美剧集", "日韩剧集", "港台剧集", "其他"], // 大陆
|
| 53 | ["港台都市", "港台爱情", "港台悬疑", "港台其他"], // 港台
|
| 54 | ["欧美悬疑", "欧美历史", "欧美其他"], // 欧美
|
| 55 | ["日韩青春", "日韩家庭", "日韩其他"], // 日韩
|
| 56 | ["其他类型1", "其他类型2"] // 其他
|
| 57 | ];
|
| 58 | const tvTypes = tvTypesList[activeTab] || [];
|
| 59 |
|
| 60 | return (
|
| 61 | <div className="container">
|
| 62 | {/* 顶部空白与音乐界面一致,用户栏绝对定位在页面右上角 */}
|
| 63 | <div style={{ height: 80 }} />
|
| 64 | <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 }}>
|
| 65 | <div style={{ cursor: 'pointer', marginRight: 16 }} onClick={() => navigate('/user')}>
|
| 66 | <AccountCircleIcon style={{ fontSize: 38, color: '#1a237e', background: '#e0f3ff', borderRadius: '50%' }} />
|
| 67 | </div>
|
| 68 | <div style={{ color: '#222', fontWeight: 500, marginRight: 24 }}>用户栏</div>
|
| 69 | <div style={{ display: 'flex', gap: 28, flex: 1, justifyContent: 'flex-end', alignItems: 'center' }}>
|
| 70 | <span style={{ color: '#1976d2', fontWeight: 500 }}>魔力值: <b>12345</b></span>
|
| 71 | <span style={{ color: '#1976d2', fontWeight: 500 }}>分享率: <b>2.56</b></span>
|
| 72 | <span style={{ color: '#1976d2', fontWeight: 500 }}>上传量: <b>100GB</b></span>
|
| 73 | <span style={{ color: '#1976d2', fontWeight: 500 }}>下载量: <b>50GB</b></span>
|
| 74 | </div>
|
| 75 | </div>
|
| 76 | {/* 下方内容整体下移,留出与音乐界面一致的间距 */}
|
| 77 | <div style={{ height: 32 }} />
|
| 78 | <nav className="nav-bar card">
|
| 79 | {navItems.map((item) => (
|
| 80 | <div
|
| 81 | key={item.label}
|
| 82 | className={item.label === "剧集" ? "nav-item active" : "nav-item"}
|
| 83 | onClick={() => navigate(item.path)}
|
| 84 | >
|
| 85 | {item.icon}
|
| 86 | <span>{item.label}</span>
|
| 87 | </div>
|
| 88 | ))}
|
| 89 | </nav>
|
| 90 | <div className="search-section card">
|
| 91 | <input className="search-input" placeholder="输入搜索关键词" />
|
| 92 | <button className="search-btn">
|
| 93 | <span role="img" aria-label="search">🔍</span>
|
| 94 | </button>
|
| 95 | </div>
|
| 96 | <div className="area-tabs" style={{ display: 'flex', justifyContent: 'center', gap: 24, margin: '18px 0' }}>
|
| 97 | {areaTabs.map((tab, idx) => (
|
| 98 | <div
|
| 99 | key={tab.label}
|
| 100 | className={activeTab === idx ? "area-tab active" : "area-tab"}
|
| 101 | onClick={() => setActiveTab(idx)}
|
| 102 | >
|
| 103 | {tab.icon} <span>{tab.label}</span>
|
| 104 | </div>
|
| 105 | ))}
|
| 106 | </div>
|
| 107 | <div className="table-section">
|
| 108 | <table className="movie-table">
|
| 109 | <thead>
|
| 110 | <tr>
|
| 111 | <th>剧集类型</th>
|
| 112 | <th>标题</th>
|
| 113 | <th>发布者</th>
|
| 114 | </tr>
|
| 115 | </thead>
|
| 116 | <tbody>
|
956303669 | 9e95ae3 | 2025-06-02 21:42:11 +0800 | [diff] [blame^] | 117 | {tvTypes.map((type, index) => (
|
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 118 | <tr key={type}>
|
956303669 | 9e95ae3 | 2025-06-02 21:42:11 +0800 | [diff] [blame^] | 119 | <td>
|
| 120 | <a href={`/torrent/${type}`} style={{ color: '#1a237e', textDecoration: 'none' }}>
|
| 121 | {type}
|
| 122 | </a>
|
| 123 | </td>
|
| 124 | <td>
|
| 125 | <a href={`/torrent/${type}`} style={{ color: '#1a237e', textDecoration: 'none' }}>
|
| 126 | 种子{index + 1}
|
| 127 | </a>
|
| 128 | </td>
|
956303669 | a32fc2c | 2025-06-02 19:45:53 +0800 | [diff] [blame] | 129 | <td></td>
|
| 130 | </tr>
|
| 131 | ))}
|
| 132 | </tbody>
|
| 133 | </table>
|
| 134 | </div>
|
| 135 | <div style={{ height: 32 }} />
|
| 136 | <Pagination />
|
| 137 | </div>
|
| 138 | );
|
| 139 | }
|
| 140 |
|
| 141 | function Pagination() {
|
| 142 | const [page, setPage] = React.useState(3);
|
| 143 | const total = 5;
|
| 144 | return (
|
| 145 | <div className="pagination">
|
| 146 | <button onClick={() => setPage(p => Math.max(1, p - 1))} disabled={page === 1}>上一页</button>
|
| 147 | <span className="page-num">{page}/{total}</span>
|
| 148 | <button onClick={() => setPage(p => Math.min(total, p + 1))} disabled={page === total}>下一页</button>
|
| 149 | <span className="page-info">第 <b>{page}</b> 页</span>
|
| 150 | </div>
|
| 151 | );
|
| 152 | }
|