帖子的相关用户前端与管理员后端
Change-Id: I957181738817aeeaa89fabe23ceaf59d00c37a71
diff --git a/src/components/Post.css b/src/components/Post.css
new file mode 100644
index 0000000..40d787e
--- /dev/null
+++ b/src/components/Post.css
@@ -0,0 +1,483 @@
+.post-container {
+ padding: 2rem;
+ background: #f8f9fa;
+ min-height: 100vh;
+ max-width: 900px;
+ margin: auto;
+}
+
+.post-form-card {
+ background: white;
+ border-radius: 12px;
+ padding: 2rem;
+ box-shadow: 0 8px 20px rgba(255, 102, 0, 0.15);
+ margin-bottom: 2rem;
+ animation: fadeInUp 0.5s ease-in-out;
+}
+
+.post-form-title {
+ font-size: 1.5rem;
+ font-weight: bold;
+ margin-bottom: 1rem;
+ color: #ff6600;
+}
+
+.post-input,
+.post-textarea {
+ width: 100%;
+ padding: 12px 14px;
+ border-radius: 8px;
+ border: 1px solid #ffbf80;
+ margin-bottom: 1rem;
+ font-size: 1rem;
+ transition: border-color 0.3s ease;
+}
+
+.post-input:focus,
+.post-textarea:focus {
+ outline: none;
+ border-color: #ff6600;
+ box-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
+}
+
+.post-textarea {
+ height: 100px;
+ resize: vertical;
+}
+
+.post-file {
+ margin-bottom: 1rem;
+}
+
+.post-button {
+ padding: 10px 20px;
+ border: none;
+ border-radius: 8px;
+ font-size: 1rem;
+ font-weight: 600;
+ margin-right: 0.5rem;
+ transition: all 0.3s ease;
+ cursor: pointer;
+ box-shadow: 0 4px 6px rgba(255, 102, 0, 0.3);
+}
+
+/* 浅橙色实底按钮 */
+.primary {
+ background: linear-gradient(45deg, #FFB366, #FFC299);
+ color: white;
+ box-shadow: 0 6px 10px rgba(255, 179, 102, 0.5);
+}
+
+.primary:hover {
+ background: linear-gradient(45deg, #FFAA33, #FFBF66);
+ box-shadow: 0 8px 14px rgba(255, 170, 51, 0.7);
+}
+
+/* 橙色边框按钮 */
+.primary-outline {
+ background: transparent;
+ border: 2px solid #ff6600;
+ color: #ff6600;
+ box-shadow: none;
+}
+
+.primary-outline:hover {
+ background: #ff6600;
+ color: white;
+ box-shadow: 0 6px 10px rgba(255, 102, 0, 0.4);
+}
+
+.post-list {
+ display: flex;
+ flex-direction: column;
+ gap: 1.5rem;
+}
+
+.post-card {
+ background: white;
+ border-radius: 12px;
+ padding: 1.5rem;
+ box-shadow: 0 4px 15px rgba(255, 102, 0, 0.12);
+ animation: fadeInUp 0.3s ease-out;
+ transition: box-shadow 0.3s ease;
+}
+
+.post-card:hover {
+ box-shadow: 0 8px 30px rgba(255, 102, 0, 0.25);
+}
+
+.post-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ gap: 1rem;
+}
+
+.post-info {
+ flex: 1;
+}
+
+.post-title {
+ font-size: 1.5rem;
+ font-weight: 700;
+ color: #cc5200;
+ margin-bottom: 0.75rem;
+ padding-left: 12px;
+ border-left: 4px solid #ff6600;
+ transition: color 0.3s ease;
+}
+
+.post-title:hover {
+ color: #ff6600;
+}
+
+.post-content {
+ color: #444;
+ margin-bottom: 0.75rem;
+}
+
+.post-image {
+ width: 160px;
+ height: 120px;
+ object-fit: cover;
+ border-radius: 6px;
+ box-shadow: 0 4px 8px rgba(255, 102, 0, 0.3);
+ flex-shrink: 0;
+ cursor: pointer;
+ transition: transform 0.3s ease;
+}
+
+.post-image:hover {
+ transform: scale(1.05);
+}
+
+.post-meta {
+ font-size: 0.9rem;
+ color: #777;
+ margin-top: 0.5rem;
+}
+
+.post-actions-inline {
+ margin-top: 0.75rem;
+ display: flex;
+ align-items: center;
+ gap: 1rem;
+ font-size: 0.95rem;
+}
+
+.post-link {
+ cursor: pointer;
+ text-decoration: underline;
+ transition: color 0.3s ease;
+}
+
+.post-link.like {
+ color: #ff6600;
+}
+
+.post-link.like:hover {
+ color: #ff8533;
+}
+
+.post-link.unlike {
+ color: #cc3300;
+}
+
+.post-link.unlike:hover {
+ color: #ff3300;
+}
+
+.post-comment {
+ margin-top: 1rem;
+ border-top: 1px solid #ffe6cc;
+ padding-top: 1rem;
+}
+
+@keyframes fadeInUp {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+/* 图片模态框 */
+.image-modal {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100vw;
+ height: 100vh;
+ background: rgba(0, 0, 0, 0.75);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ z-index: 9999;
+}
+
+.image-modal-content {
+ position: relative;
+ max-width: 90%;
+ max-height: 90%;
+}
+
+.image-modal-img {
+ width: 100%;
+ max-height: 80vh;
+ border-radius: 12px;
+ box-shadow: 0 0 20px rgba(255, 102, 0, 0.8);
+}
+
+.image-modal-close {
+ position: absolute;
+ top: -20px;
+ right: -20px;
+ background: white;
+ border: none;
+ border-radius: 50%;
+ width: 36px;
+ height: 36px;
+ font-size: 24px;
+ line-height: 36px;
+ text-align: center;
+ cursor: pointer;
+ box-shadow: 0 2px 10px rgba(255, 102, 0, 0.7);
+}
+
+.action-group {
+ display: flex;
+ gap: 0.5rem;
+ margin-bottom: 0.5rem;
+}
+
+.post-empty-state {
+ text-align: center;
+ padding: 2rem;
+ background: white;
+ border-radius: 12px;
+ box-shadow: 0 4px 15px rgba(255, 102, 0, 0.12);
+}
+
+.post-empty-message {
+ font-size: 1.2rem;
+ color: #cc5200;
+ margin-bottom: 1rem;
+}
+
+/* RequestBoard组件样式保持一致 */
+.request-board-container {
+ background: white;
+ border-radius: 12px;
+ padding: 1.5rem;
+ box-shadow: 0 4px 15px rgba(255, 102, 0, 0.12);
+ margin-top: 1rem;
+}
+
+.request-board-section {
+ margin-bottom: 1.5rem;
+}
+
+.request-board-form {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ gap: 1rem;
+ margin-bottom: 1.5rem;
+}
+
+.request-board-input {
+ padding: 10px 12px;
+ border-radius: 8px;
+ border: 1px solid #ffbf80;
+ font-size: 0.95rem;
+}
+
+.request-board-input:focus {
+ border-color: #ff6600;
+ box-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
+ outline: none;
+}
+
+.request-board-textarea {
+ grid-column: span 2;
+ padding: 10px 12px;
+ border-radius: 8px;
+ border: 1px solid #ffbf80;
+ resize: vertical;
+ min-height: 100px;
+}
+
+.request-board-textarea:focus {
+ border-color: #ff6600;
+ box-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
+ outline: none;
+}
+
+.request-board-file {
+ grid-column: span 2;
+}
+
+.request-board-list {
+ display: grid;
+ grid-template-columns: 1fr;
+ gap: 1rem;
+}
+
+.request-board-item {
+ background: white;
+ border-radius: 10px;
+ padding: 1.25rem;
+ box-shadow: 0 2px 8px rgba(255, 102, 0, 0.08);
+}
+
+.request-board-item-title {
+ font-size: 1.3rem;
+ font-weight: 700;
+ margin-bottom: 0.75rem;
+ color: hsl(24, 67%, 55%);
+ border-bottom: 2px solid #ffe0b3;
+ padding-bottom: 0.5rem;
+}
+
+.request-board-item-content {
+ color: #555;
+ margin-bottom: 1rem;
+}
+
+.request-board-item-meta {
+ display: flex;
+ gap: 1rem;
+ margin-bottom: 1rem;
+ color: #777;
+ font-size: 0.9rem;
+}
+
+.request-board-item-image {
+ max-width: 200px;
+ max-height: 150px;
+ border-radius: 6px;
+ margin-bottom: 1rem;
+}
+
+.request-board-item-actions {
+ display: flex;
+ gap: 0.75rem;
+ flex-wrap: wrap;
+}
+
+.request-board-small-input {
+ padding: 8px 10px;
+ border-radius: 6px;
+ border: 1px solid #ffbf80;
+ flex: 1;
+}
+
+.request-board-small-input:focus {
+ border-color: #ff6600;
+ box-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
+ outline: none;
+}
+
+/* 新增的用户信息显示样式 */
+.post-form-user-info {
+ display: flex;
+ align-items: center;
+ margin-bottom: 20px;
+ padding: 10px;
+ background-color: #f8f9fa;
+ border-radius: 8px;
+ border: 1px solid #e9ecef;
+}
+
+.post-form-user-avatar {
+ width: 50px;
+ height: 50px;
+ border-radius: 50%;
+ object-fit: cover;
+ margin-right: 15px;
+ border: 2px solid #40a9ff;
+}
+
+.post-form-user-avatar-placeholder {
+ width: 50px;
+ height: 50px;
+ border-radius: 50%;
+ background-color: #e9ecef;
+ margin-right: 15px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 2px solid #40a9ff;
+}
+
+.avatar-initial {
+ font-size: 24px;
+ font-weight: bold;
+ color: #495057;
+}
+
+.post-form-username {
+ font-weight: 600;
+ font-size: 18px;
+ color: #212529;
+}
+
+.post-form-user-label {
+ margin-left: auto;
+ padding: 5px 10px;
+ background-color: #e6f7ff;
+ color: #1890ff;
+ border-radius: 4px;
+ font-size: 14px;
+}
+
+/* 帖子作者信息样式 */
+.post-author-info {
+ display: flex;
+ align-items: center;
+ padding: 10px 15px;
+ border-bottom: 1px solid #f0f0f0;
+ margin-bottom: 15px;
+}
+
+.post-author-avatar {
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ object-fit: cover;
+ margin-right: 12px;
+ border: 1px solid #e8e8e8;
+}
+
+.post-author-avatar-placeholder {
+ width: 40px;
+ height: 40px;
+ border-radius: 50%;
+ background-color: #f5f5f5;
+ margin-right: 12px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1px solid #e8e8e8;
+}
+
+.post-author-details {
+ display: flex;
+ flex-direction: column;
+}
+
+.post-author-name {
+ font-weight: 600;
+ font-size: 16px;
+ margin-bottom: 3px;
+ color: #333;
+}
+
+.post-meta {
+ font-size: 12px;
+ color: #888;
+ margin: 2px 0;
+}
\ No newline at end of file