修改个人中心、发布种子、兴趣小组
Change-Id: I73caa8ef511ad9ae12a0cc49fc0edb5ccb0b2a74
diff --git a/src/pages/UserCenter/UserNav/UserNav.css b/src/pages/UserCenter/UserNav/UserNav.css
index 783fcdc..0c7ed6f 100644
--- a/src/pages/UserCenter/UserNav/UserNav.css
+++ b/src/pages/UserCenter/UserNav/UserNav.css
@@ -1,43 +1,46 @@
/* 竖直导航栏的容器 */
.user-nav-container {
- width: 250px;
- background-color: #f4f4f4;
- padding-top: 20px;
- border-right: 1px solid #ccc;
- height: 100%; /* 让容器填充整个父容器高度 */
- display: flex;
- flex-direction: column;
- align-items: stretch; /* 确保所有导航项都拉伸 */
- }
-
- /* 导航栏样式 */
- .user-nav {
- display: flex;
- flex-direction: column;
- padding: 0;
- margin: 0;
- flex-grow: 1; /* 使导航栏占据剩余空间 */
- }
-
- /* 每一项导航链接 */
- .user-nav-item {
- padding: 15px 20px;
- text-align: left;
- text-decoration: none;
- color: #333;
- font-size: 16px;
- border-bottom: 1px solid #e0e0e0;
- transition: background-color 0.3s ease;
- }
-
- /* 鼠标悬浮时的背景颜色 */
- .user-nav-item:hover {
- background-color: #ddd;
- }
-
- /* 激活项的样式 */
- .user-nav-item.active {
- background-color: #3b8cff;
- color: white;
- }
-
\ No newline at end of file
+ margin-right: -5%;
+ margin-left: 5%;
+ width: 150px; /* 增加容器宽度 */
+ background-color: #5F4437;
+ padding-top: 20px;
+ height: 100%; /* 让容器填充整个父容器高度 */
+ display: flex;
+ flex-direction: column;
+ align-items: stretch; /* 确保所有导航项都拉伸 */
+}
+
+/* 导航栏样式 */
+.user-nav {
+ display: flex;
+ flex-direction: column;
+ padding: 0;
+ margin: 0;
+ flex-grow: 1; /* 使导航栏占据剩余空间 */
+}
+
+/* 每一项导航链接 */
+.user-nav-item {
+ /* padding: 35px 20px; */
+ border-radius: 16px; /* 圆角边框 */
+ padding: 25% 10%;
+ text-decoration: none;
+ color: #ddd;
+ font-size: 16px;
+ /* 删除 border-bottom 属性以移除分隔线 */
+ transition: background-color 0.3s ease;
+ /*文字居中显示*/
+ text-align: center;
+}
+
+/* 鼠标悬浮时的背景颜色 */
+.user-nav-item:hover {
+ background-color: #5a1414;
+}
+
+/* 激活项的样式 */
+.user-nav-item.active {
+ background-color: #BA929A;
+ color: white;
+}
\ No newline at end of file
diff --git a/src/pages/UserCenter/UserProfile.css b/src/pages/UserCenter/UserProfile.css
index d4d9476..988c1c8 100644
--- a/src/pages/UserCenter/UserProfile.css
+++ b/src/pages/UserCenter/UserProfile.css
@@ -1,13 +1,20 @@
.user-center {
- max-width: 800px;
- margin: 0 auto;
- padding: 20px;
+ max-width: 100%;
+ padding: 3%;
font-family: Arial, sans-serif;
+ display: flex;
+ gap: 10%;
+ background-color: #5F4437;
+}
+
+
+.right-content {
+ flex: 3;
}
.profile-header {
+ margin-top: -20%;
text-align: center;
- margin-bottom: 20px;
}
.avatar {
@@ -23,6 +30,7 @@
}
.profile-details {
+ margin-top: 20%;
font-size: 1.2em;
}
@@ -37,4 +45,14 @@
.error {
color: red;
text-align: center;
-}
+}
+
+.common-card {
+ background-color: #e9ded2;
+ border-radius: 16px;
+ margin: 0 auto;
+ margin-top: 40px;
+ padding: 10% 20%;
+ margin-left: 5%;
+ margin-right: 5%;
+}
\ No newline at end of file
diff --git a/src/pages/UserCenter/UserProfile.jsx b/src/pages/UserCenter/UserProfile.jsx
index ff9aeff..78701f1 100644
--- a/src/pages/UserCenter/UserProfile.jsx
+++ b/src/pages/UserCenter/UserProfile.jsx
@@ -2,6 +2,7 @@
import axios from 'axios';
import './UserProfile.css';
import UserNav from './UserNav/UserNav'; // 导入 UserNav 组件
+import Header from '../../components/Header';
const API_BASE = process.env.REACT_APP_API_BASE;
@@ -47,36 +48,43 @@
}
return (
+ <div className="user-profile-container">
+ <Header /> {/* 引入 Header 组件 */}
<div className="user-center">
- <div className="user-nav-container">
+ <div className="user-nav-container">
<UserNav /> {/* 引入导航栏 */}
</div>
- <div className="profile-header">
- <img
- src={userProfile.avatar_url}
- alt={userProfile.nickname}
- className="avatar"
- />
- <h1>{userProfile.nickname}</h1>
- </div>
+ <div className="common-card">
+ <div className="right-content">
+ <div className="profile-header">
+ <img
+ src={userProfile.avatar_url}
+ alt={userProfile.nickname}
+ className="avatar"
+ />
+ <h1>{userProfile.nickname}</h1>
+ </div>
- <div className="profile-details">
- <h2>个人资料</h2>
- <p><strong>邮箱:</strong>{userProfile.email}</p>
- <p><strong>性别:</strong>{userProfile.gender}</p>
- <p><strong>个人简介:</strong>{userProfile.bio}</p>
- <p><strong>兴趣:</strong>{userProfile.interests.join(', ')}</p>
- <p><strong>等级:</strong>{userProfile.level}</p>
- <p><strong>经验:</strong>{userProfile.experience}</p>
- <p><strong>上传量:</strong>{userProfile.upload_amount}</p>
- <p><strong>下载量:</strong>{userProfile.download_amount}</p>
- <p><strong>分享率:</strong>{(userProfile.share_rate * 100).toFixed(2)}%</p>
- <p><strong>VIP:</strong>{userProfile.is_vip ? '是' : '否'}</p>
- {userProfile.is_vip && <p><strong>VIP等级:</strong>{userProfile.vip_type}</p>}
- <p><strong>加入时间:</strong>{new Date(userProfile.joined_date).toLocaleDateString()}</p>
+ <div className="profile-details">
+ {/* <h2>个人资料</h2> */}
+ <p><strong>邮箱:</strong>{userProfile.email}</p>
+ <p><strong>性别:</strong>{userProfile.gender}</p>
+ <p><strong>个人简介:</strong>{userProfile.bio}</p>
+ <p><strong>兴趣:</strong>{userProfile.interests.join(', ')}</p>
+ <p><strong>等级:</strong>{userProfile.level}</p>
+ <p><strong>经验:</strong>{userProfile.experience}</p>
+ <p><strong>上传量:</strong>{userProfile.upload_amount}</p>
+ <p><strong>下载量:</strong>{userProfile.download_amount}</p>
+ <p><strong>分享率:</strong>{(userProfile.share_rate * 100).toFixed(2)}%</p>
+ <p><strong>VIP:</strong>{userProfile.is_vip ? '是' : '否'}</p>
+ {userProfile.is_vip && <p><strong>VIP等级:</strong>{userProfile.vip_type}</p>}
+ <p><strong>加入时间:</strong>{new Date(userProfile.joined_date).toLocaleDateString()}</p>
+ </div>
+ </div>
+ </div>
</div>
</div>
);
};
-export default UserProfile;
+export default UserProfile;