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 "./App.css";
|
| 11 | import { useNavigate } from "react-router-dom";
|
| 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" },
|
| 21 | ];
|
| 22 |
|
| 23 | const animeTypes = [
|
| 24 | "华语动漫(大陆)",
|
| 25 | "欧美动漫",
|
| 26 | "日韩动漫",
|
| 27 | "港台动漫",
|
| 28 | "其他"
|
| 29 | ];
|
| 30 |
|
| 31 | const areaTabs = [
|
| 32 | { label: "大陆", icon: <EmojiPeopleIcon fontSize="small" /> },
|
| 33 | { label: "港台", icon: <EmailIcon fontSize="small" /> },
|
| 34 | { label: "欧美", icon: <PersonIcon fontSize="small" /> },
|
| 35 | { label: "日韩", icon: <EmojiPeopleIcon fontSize="small" /> },
|
| 36 | { label: "其他", icon: <PersonIcon fontSize="small" /> },
|
| 37 | ];
|
| 38 |
|
| 39 | export default function AnimePage() {
|
| 40 | const navigate = useNavigate();
|
| 41 | const [activeTab, setActiveTab] = React.useState(0);
|
| 42 |
|
| 43 | // 每个tab对应的动漫类型
|
| 44 | const animeTypesList = [
|
| 45 | ["华语动漫(大陆)", "欧美动漫", "日韩动漫", "港台动漫", "其他"], // 大陆
|
| 46 | ["港台热血", "港台搞笑", "港台其他"], // 港台
|
| 47 | ["欧美冒险", "欧美科幻", "欧美其他"], // 欧美
|
| 48 | ["日韩热血", "日韩恋爱", "日韩其他"], // 日韩
|
| 49 | ["其他类型1", "其他类型2"] // 其他
|
| 50 | ];
|
| 51 | const animeTypes = animeTypesList[activeTab] || [];
|
| 52 |
|
| 53 | return (
|
| 54 | <div className="container">
|
| 55 | {/* 顶部空白与音乐界面一致,用户栏绝对定位在页面右上角 */}
|
| 56 | <div style={{ height: 80 }} />
|
| 57 | <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 }}>
|
| 58 | <div style={{ cursor: 'pointer', marginRight: 16 }} onClick={() => navigate('/user')}>
|
| 59 | <AccountCircleIcon style={{ fontSize: 38, color: '#1a237e', background: '#e0f3ff', borderRadius: '50%' }} />
|
| 60 | </div>
|
| 61 | <div style={{ color: '#222', fontWeight: 500, marginRight: 24 }}>用户栏</div>
|
| 62 | <div style={{ display: 'flex', gap: 28, flex: 1, justifyContent: 'flex-end', alignItems: 'center' }}>
|
| 63 | <span style={{ color: '#1976d2', fontWeight: 500 }}>魔力值: <b>12345</b></span>
|
| 64 | <span style={{ color: '#1976d2', fontWeight: 500 }}>分享率: <b>2.56</b></span>
|
| 65 | <span style={{ color: '#1976d2', fontWeight: 500 }}>上传量: <b>100GB</b></span>
|
| 66 | <span style={{ color: '#1976d2', fontWeight: 500 }}>下载量: <b>50GB</b></span>
|
| 67 | </div>
|
| 68 | </div>
|
| 69 | {/* 下方内容整体下移,留出与音乐界面一致的间距 */}
|
| 70 | <div style={{ height: 32 }} />
|
| 71 | <nav className="nav-bar">
|
| 72 | {navItems.map((item) => (
|
| 73 | <div
|
| 74 | key={item.label}
|
| 75 | className={item.label === "动漫" ? "nav-item active" : "nav-item"}
|
| 76 | onClick={() => navigate(item.path)}
|
| 77 | >
|
| 78 | {item.icon}
|
| 79 | <span>{item.label}</span>
|
| 80 | </div>
|
| 81 | ))}
|
| 82 | </nav>
|
| 83 | <div className="search-section card">
|
| 84 | <input className="search-input" placeholder="输入搜索关键词" />
|
| 85 | <button className="search-btn">
|
| 86 | <span role="img" aria-label="search">🔍</span>
|
| 87 | </button>
|
| 88 | </div>
|
| 89 | <div className="area-tabs" style={{ display: 'flex', justifyContent: 'center', gap: 24, margin: '18px 0' }}>
|
| 90 | {areaTabs.map((tab, idx) => (
|
| 91 | <div
|
| 92 | key={tab.label}
|
| 93 | className={activeTab === idx ? "area-tab active" : "area-tab"}
|
| 94 | onClick={() => setActiveTab(idx)}
|
| 95 | >
|
| 96 | {tab.icon} <span>{tab.label}</span>
|
| 97 | </div>
|
| 98 | ))}
|
| 99 | </div>
|
| 100 | <div className="table-section">
|
| 101 | <table className="movie-table">
|
| 102 | <thead>
|
| 103 | <tr>
|
| 104 | <th>动漫类型</th>
|
| 105 | <th>标题</th>
|
| 106 | <th>发布者</th>
|
| 107 | </tr>
|
| 108 | </thead>
|
| 109 | <tbody>
|
| 110 | {animeTypes.map(type => (
|
| 111 | <tr key={type}>
|
| 112 | <td>{type}</td>
|
| 113 | <td></td>
|
| 114 | <td></td>
|
| 115 | </tr>
|
| 116 | ))}
|
| 117 | </tbody>
|
| 118 | </table>
|
| 119 | </div>
|
| 120 | <div style={{ height: 32 }} />
|
| 121 | <Pagination />
|
| 122 | </div>
|
| 123 | );
|
| 124 | }
|
| 125 |
|
| 126 | function Pagination() {
|
| 127 | const [page, setPage] = React.useState(3);
|
| 128 | const total = 5;
|
| 129 | return (
|
| 130 | <div className="pagination">
|
| 131 | <button onClick={() => setPage(p => Math.max(1, p - 1))} disabled={page === 1}>上一页</button>
|
| 132 | <span className="page-num">{page}/{total}</span>
|
| 133 | <button onClick={() => setPage(p => Math.min(total, p + 1))} disabled={page === total}>下一页</button>
|
| 134 | <span className="page-info">第 <b>{page}</b> 页</span>
|
| 135 | </div>
|
| 136 | );
|
| 137 | }
|