xingjinwen | d652cc6 | 2025-06-04 19:52:19 +0800 | [diff] [blame^] | 1 | <template> |
| 2 | <div class="forum-page"> |
| 3 | <div class="page-container"> |
| 4 | <!-- 论坛头部 --> |
| 5 | <div class="forum-header"> |
| 6 | <div class="header-content"> |
| 7 | <h1>社区论坛</h1> |
| 8 | <p class="header-description">与其他用户交流讨论,分享经验心得</p> |
| 9 | <div class="header-actions"> |
| 10 | <el-button type="primary" :icon="Edit" @click="showNewTopicDialog = true"> |
| 11 | 发布新帖 |
| 12 | </el-button> |
| 13 | </div> |
| 14 | </div> |
| 15 | </div> |
| 16 | |
| 17 | <!-- 论坛统计 --> |
| 18 | <div class="forum-stats"> |
| 19 | <div class="stats-grid"> |
| 20 | <div class="stat-item"> |
| 21 | <el-icon size="32" color="#409eff"><ChatDotRound /></el-icon> |
| 22 | <div class="stat-info"> |
| 23 | <h3>{{ forumStats.totalTopics }}</h3> |
| 24 | <p>主题总数</p> |
| 25 | </div> |
| 26 | </div> |
| 27 | <div class="stat-item"> |
| 28 | <el-icon size="32" color="#67c23a"><Comment /></el-icon> |
| 29 | <div class="stat-info"> |
| 30 | <h3>{{ forumStats.totalReplies }}</h3> |
| 31 | <p>回复总数</p> |
| 32 | </div> |
| 33 | </div> |
| 34 | <div class="stat-item"> |
| 35 | <el-icon size="32" color="#e6a23c"><User /></el-icon> |
| 36 | <div class="stat-info"> |
| 37 | <h3>{{ forumStats.activeUsers }}</h3> |
| 38 | <p>活跃用户</p> |
| 39 | </div> |
| 40 | </div> |
| 41 | <div class="stat-item"> |
| 42 | <el-icon size="32" color="#f56c6c"><View /></el-icon> |
| 43 | <div class="stat-info"> |
| 44 | <h3>{{ forumStats.todayPosts }}</h3> |
| 45 | <p>今日发帖</p> |
| 46 | </div> |
| 47 | </div> |
| 48 | </div> |
| 49 | </div> |
| 50 | |
| 51 | <!-- 版块列表 --> |
| 52 | <div class="forum-sections"> |
| 53 | <h2 class="section-title">论坛版块</h2> |
| 54 | <div class="sections-list"> |
| 55 | <div |
| 56 | v-for="section in forumSections" |
| 57 | :key="section.id" |
| 58 | class="section-card" |
| 59 | @click="navigateToSection(section.id)" |
| 60 | > |
| 61 | <div class="section-icon"> |
| 62 | <el-icon size="48" :color="section.color"> |
| 63 | <component :is="section.icon" /> |
| 64 | </el-icon> |
| 65 | </div> |
| 66 | <div class="section-info"> |
| 67 | <h3 class="section-name">{{ section.name }}</h3> |
| 68 | <p class="section-description">{{ section.description }}</p> |
| 69 | <div class="section-stats"> |
| 70 | <span class="stat">{{ section.topics }} 主题</span> |
| 71 | <span class="stat">{{ section.replies }} 回复</span> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div class="section-latest"> |
| 75 | <div v-if="section.latestTopic" class="latest-topic"> |
| 76 | <p class="topic-title">{{ section.latestTopic.title }}</p> |
| 77 | <div class="topic-meta"> |
| 78 | <span class="author">{{ section.latestTopic.author }}</span> |
| 79 | <span class="time">{{ formatTime(section.latestTopic.time) }}</span> |
| 80 | </div> |
| 81 | </div> |
| 82 | </div> |
| 83 | </div> |
| 84 | </div> |
| 85 | </div> |
| 86 | |
| 87 | <!-- 热门主题 --> |
| 88 | <div class="hot-topics"> |
| 89 | <div class="section-header"> |
| 90 | <h2 class="section-title">热门主题</h2> |
| 91 | <el-button type="primary" text @click="$router.push('/forum/topics')"> |
| 92 | 查看全部 <el-icon><ArrowRight /></el-icon> |
| 93 | </el-button> |
| 94 | </div> |
| 95 | <div class="topics-list"> |
| 96 | <div |
| 97 | v-for="topic in hotTopics" |
| 98 | :key="topic.id" |
| 99 | class="topic-item" |
| 100 | @click="navigateToTopic(topic.id)" |
| 101 | > |
| 102 | <div class="topic-content"> |
| 103 | <div class="topic-header"> |
| 104 | <h4 class="topic-title">{{ topic.title }}</h4> |
| 105 | <div class="topic-tags"> |
| 106 | <el-tag |
| 107 | v-for="tag in topic.tags" |
| 108 | :key="tag" |
| 109 | size="small" |
| 110 | type="info" |
| 111 | > |
| 112 | {{ tag }} |
| 113 | </el-tag> |
| 114 | </div> |
| 115 | </div> |
| 116 | <div class="topic-meta"> |
| 117 | <div class="author-info"> |
| 118 | <el-avatar :size="24">{{ topic.author.charAt(0) }}</el-avatar> |
| 119 | <span class="author-name">{{ topic.author }}</span> |
| 120 | </div> |
| 121 | <div class="topic-stats"> |
| 122 | <span class="stat-item"> |
| 123 | <el-icon><View /></el-icon> |
| 124 | {{ topic.views }} |
| 125 | </span> |
| 126 | <span class="stat-item"> |
| 127 | <el-icon><Comment /></el-icon> |
| 128 | {{ topic.replies }} |
| 129 | </span> |
| 130 | <span class="time">{{ formatTime(topic.lastReply) }}</span> |
| 131 | </div> |
| 132 | </div> |
| 133 | </div> |
| 134 | <div class="topic-status"> |
| 135 | <el-tag v-if="topic.pinned" type="warning" size="small">置顶</el-tag> |
| 136 | <el-tag v-if="topic.hot" type="danger" size="small">热门</el-tag> |
| 137 | </div> |
| 138 | </div> |
| 139 | </div> |
| 140 | </div> |
| 141 | |
| 142 | <!-- 最新回复 --> |
| 143 | <div class="recent-replies"> |
| 144 | <h2 class="section-title">最新回复</h2> |
| 145 | <div class="replies-list"> |
| 146 | <div |
| 147 | v-for="reply in recentReplies" |
| 148 | :key="reply.id" |
| 149 | class="reply-item" |
| 150 | @click="navigateToTopic(reply.topicId)" |
| 151 | > |
| 152 | <div class="reply-avatar"> |
| 153 | <el-avatar :size="40">{{ reply.author.charAt(0) }}</el-avatar> |
| 154 | </div> |
| 155 | <div class="reply-content"> |
| 156 | <div class="reply-header"> |
| 157 | <span class="reply-author">{{ reply.author }}</span> |
| 158 | <span class="reply-action">回复了主题</span> |
| 159 | <span class="topic-title">{{ reply.topicTitle }}</span> |
| 160 | </div> |
| 161 | <div class="reply-text">{{ reply.content }}</div> |
| 162 | <div class="reply-time">{{ formatTime(reply.time) }}</div> |
| 163 | </div> |
| 164 | </div> |
| 165 | </div> |
| 166 | </div> |
| 167 | </div> |
| 168 | |
| 169 | <!-- 发布新帖对话框 --> |
| 170 | <el-dialog |
| 171 | v-model="showNewTopicDialog" |
| 172 | title="发布新主题" |
| 173 | width="600px" |
| 174 | :before-close="handleCloseDialog" |
| 175 | > |
| 176 | <el-form |
| 177 | ref="topicFormRef" |
| 178 | :model="newTopic" |
| 179 | :rules="topicRules" |
| 180 | label-width="80px" |
| 181 | > |
| 182 | <el-form-item label="版块" prop="sectionId"> |
| 183 | <el-select v-model="newTopic.sectionId" placeholder="选择版块"> |
| 184 | <el-option |
| 185 | v-for="section in forumSections" |
| 186 | :key="section.id" |
| 187 | :label="section.name" |
| 188 | :value="section.id" |
| 189 | /> |
| 190 | </el-select> |
| 191 | </el-form-item> |
| 192 | |
| 193 | <el-form-item label="标题" prop="title"> |
| 194 | <el-input |
| 195 | v-model="newTopic.title" |
| 196 | placeholder="请输入主题标题" |
| 197 | maxlength="100" |
| 198 | show-word-limit |
| 199 | /> |
| 200 | </el-form-item> |
| 201 | |
| 202 | <el-form-item label="标签"> |
| 203 | <div class="tags-input"> |
| 204 | <el-tag |
| 205 | v-for="tag in newTopic.tags" |
| 206 | :key="tag" |
| 207 | closable |
| 208 | @close="removeTopicTag(tag)" |
| 209 | > |
| 210 | {{ tag }} |
| 211 | </el-tag> |
| 212 | <el-input |
| 213 | v-if="tagInputVisible" |
| 214 | ref="tagInputRef" |
| 215 | v-model="tagInputValue" |
| 216 | size="small" |
| 217 | @keyup.enter="addTopicTag" |
| 218 | @blur="addTopicTag" |
| 219 | style="width: 100px;" |
| 220 | /> |
| 221 | <el-button |
| 222 | v-else |
| 223 | size="small" |
| 224 | @click="showTagInput" |
| 225 | > |
| 226 | + 添加标签 |
| 227 | </el-button> |
| 228 | </div> |
| 229 | </el-form-item> |
| 230 | |
| 231 | <el-form-item label="内容" prop="content"> |
| 232 | <el-input |
| 233 | v-model="newTopic.content" |
| 234 | type="textarea" |
| 235 | :rows="8" |
| 236 | placeholder="请输入主题内容..." |
| 237 | maxlength="5000" |
| 238 | show-word-limit |
| 239 | /> |
| 240 | </el-form-item> |
| 241 | </el-form> |
| 242 | |
| 243 | <template #footer> |
| 244 | <el-button @click="handleCloseDialog">取消</el-button> |
| 245 | <el-button type="primary" @click="submitNewTopic" :loading="submitting"> |
| 246 | 发布主题 |
| 247 | </el-button> |
| 248 | </template> |
| 249 | </el-dialog> |
| 250 | </div> |
| 251 | </template> |
| 252 | |
| 253 | <script> |
| 254 | import { ref, reactive, onMounted, nextTick } from 'vue' |
| 255 | import { useRouter } from 'vue-router' |
| 256 | import { ElMessage, ElMessageBox } from 'element-plus' |
| 257 | import { |
| 258 | Edit, |
| 259 | ChatDotRound, |
| 260 | Comment, |
| 261 | User, |
| 262 | View, |
| 263 | ArrowRight, |
| 264 | Film, |
| 265 | Headphones, |
| 266 | Monitor, |
| 267 | GamePad, |
| 268 | ChatLineRound, |
| 269 | QuestionFilled, |
| 270 | Bell |
| 271 | } from '@element-plus/icons-vue' |
| 272 | |
| 273 | export default { |
| 274 | name: 'ForumView', |
| 275 | setup() { |
| 276 | const router = useRouter() |
| 277 | const topicFormRef = ref(null) |
| 278 | const tagInputRef = ref(null) |
| 279 | |
| 280 | const showNewTopicDialog = ref(false) |
| 281 | const submitting = ref(false) |
| 282 | const tagInputVisible = ref(false) |
| 283 | const tagInputValue = ref('') |
| 284 | |
| 285 | const forumStats = reactive({ |
| 286 | totalTopics: '15,268', |
| 287 | totalReplies: '89,456', |
| 288 | activeUsers: '2,341', |
| 289 | todayPosts: '156' |
| 290 | }) |
| 291 | |
| 292 | const newTopic = reactive({ |
| 293 | sectionId: '', |
| 294 | title: '', |
| 295 | content: '', |
| 296 | tags: [] |
| 297 | }) |
| 298 | |
| 299 | const topicRules = { |
| 300 | sectionId: [ |
| 301 | { required: true, message: '请选择版块', trigger: 'change' } |
| 302 | ], |
| 303 | title: [ |
| 304 | { required: true, message: '请输入标题', trigger: 'blur' }, |
| 305 | { min: 5, max: 100, message: '标题长度在 5 到 100 个字符', trigger: 'blur' } |
| 306 | ], |
| 307 | content: [ |
| 308 | { required: true, message: '请输入内容', trigger: 'blur' }, |
| 309 | { min: 10, max: 5000, message: '内容长度在 10 到 5000 个字符', trigger: 'blur' } |
| 310 | ] |
| 311 | } |
| 312 | |
| 313 | const forumSections = ref([ |
| 314 | { |
| 315 | id: 1, |
| 316 | name: '电影讨论', |
| 317 | description: '分享和讨论电影资源,交流观影心得', |
| 318 | icon: 'Film', |
| 319 | color: '#409eff', |
| 320 | topics: 3256, |
| 321 | replies: 18934, |
| 322 | latestTopic: { |
| 323 | title: '2024年最佳科幻电影推荐', |
| 324 | author: 'MovieFan', |
| 325 | time: '2025-06-03T14:30:00' |
| 326 | } |
| 327 | }, |
| 328 | { |
| 329 | id: 2, |
| 330 | name: '音乐分享', |
| 331 | description: '音乐资源分享,音乐制作技术交流', |
| 332 | icon: 'Headphones', |
| 333 | color: '#67c23a', |
| 334 | topics: 1892, |
| 335 | replies: 9567, |
| 336 | latestTopic: { |
| 337 | title: '无损音乐格式对比分析', |
| 338 | author: 'AudioExpert', |
| 339 | time: '2025-06-03T13:45:00' |
| 340 | } |
| 341 | }, |
| 342 | { |
| 343 | id: 3, |
| 344 | name: '软件技术', |
| 345 | description: '软件资源分享,技术问题讨论', |
| 346 | icon: 'Monitor', |
| 347 | color: '#e6a23c', |
| 348 | topics: 2134, |
| 349 | replies: 12456, |
| 350 | latestTopic: { |
| 351 | title: 'Adobe 2025 新功能体验分享', |
| 352 | author: 'TechGuru', |
| 353 | time: '2025-06-03T12:20:00' |
| 354 | } |
| 355 | }, |
| 356 | { |
| 357 | id: 4, |
| 358 | name: '游戏天地', |
| 359 | description: '游戏资源分享,游戏攻略讨论', |
| 360 | icon: 'GamePad', |
| 361 | color: '#f56c6c', |
| 362 | topics: 1567, |
| 363 | replies: 8234, |
| 364 | latestTopic: { |
| 365 | title: '年度游戏大作盘点', |
| 366 | author: 'GameMaster', |
| 367 | time: '2025-06-03T11:50:00' |
| 368 | } |
| 369 | }, |
| 370 | { |
| 371 | id: 5, |
| 372 | name: '站务公告', |
| 373 | description: '网站公告,规则说明,意见建议', |
| 374 | icon: 'Bell', |
| 375 | color: '#909399', |
| 376 | topics: 234, |
| 377 | replies: 1567, |
| 378 | latestTopic: { |
| 379 | title: '网站维护通知', |
| 380 | author: 'Admin', |
| 381 | time: '2025-06-03T10:00:00' |
| 382 | } |
| 383 | }, |
| 384 | { |
| 385 | id: 6, |
| 386 | name: '新手求助', |
| 387 | description: '新手问题解答,使用教程分享', |
| 388 | icon: 'QuestionFilled', |
| 389 | color: '#606266', |
| 390 | topics: 456, |
| 391 | replies: 2890, |
| 392 | latestTopic: { |
| 393 | title: '新手如何提高分享率?', |
| 394 | author: 'Newbie123', |
| 395 | time: '2025-06-03T09:30:00' |
| 396 | } |
| 397 | } |
| 398 | ]) |
| 399 | |
| 400 | const hotTopics = ref([ |
| 401 | { |
| 402 | id: 1, |
| 403 | title: '2024年度最佳PT站点推荐与对比分析', |
| 404 | author: 'PTExpert', |
| 405 | views: 2856, |
| 406 | replies: 147, |
| 407 | lastReply: '2025-06-03T14:25:00', |
| 408 | tags: ['PT站点', '推荐', '对比'], |
| 409 | pinned: true, |
| 410 | hot: true |
| 411 | }, |
| 412 | { |
| 413 | id: 2, |
| 414 | title: '如何安全高效地使用BT下载工具', |
| 415 | author: 'SafeDownloader', |
| 416 | views: 1932, |
| 417 | replies: 89, |
| 418 | lastReply: '2025-06-03T13:50:00', |
| 419 | tags: ['BT工具', '安全', '教程'], |
| 420 | hot: true |
| 421 | }, |
| 422 | { |
| 423 | id: 3, |
| 424 | title: '分享率提升技巧与经验总结', |
| 425 | author: 'SeedMaster', |
| 426 | views: 1654, |
| 427 | replies: 76, |
| 428 | lastReply: '2025-06-03T12:40:00', |
| 429 | tags: ['分享率', '技巧', '经验'] |
| 430 | } |
| 431 | ]) |
| 432 | |
| 433 | const recentReplies = ref([ |
| 434 | { |
| 435 | id: 1, |
| 436 | author: 'MovieLover88', |
| 437 | topicId: 1, |
| 438 | topicTitle: '阿凡达2观影感受分享', |
| 439 | content: '画面效果确实震撼,特别是水下的场景...', |
| 440 | time: '2025-06-03T14:45:00' |
| 441 | }, |
| 442 | { |
| 443 | id: 2, |
| 444 | author: 'TechEnthusiast', |
| 445 | topicId: 2, |
| 446 | topicTitle: '最新版Photoshop使用技巧', |
| 447 | content: '新的AI功能确实很强大,大大提高了工作效率...', |
| 448 | time: '2025-06-03T14:30:00' |
| 449 | }, |
| 450 | { |
| 451 | id: 3, |
| 452 | author: 'GameFan2024', |
| 453 | topicId: 3, |
| 454 | topicTitle: '赛博朋克2077最新更新体验', |
| 455 | content: '修复了很多bug,现在游戏体验好多了...', |
| 456 | time: '2025-06-03T14:15:00' |
| 457 | } |
| 458 | ]) |
| 459 | |
| 460 | onMounted(() => { |
| 461 | // 初始化论坛数据 |
| 462 | }) |
| 463 | |
| 464 | const formatTime = (timeString) => { |
| 465 | const date = new Date(timeString) |
| 466 | const now = new Date() |
| 467 | const diff = now - date |
| 468 | const hours = Math.floor(diff / (1000 * 60 * 60)) |
| 469 | |
| 470 | if (hours < 1) return '刚刚' |
| 471 | if (hours < 24) return `${hours}小时前` |
| 472 | const days = Math.floor(hours / 24) |
| 473 | return `${days}天前` |
| 474 | } |
| 475 | |
| 476 | const navigateToSection = (sectionId) => { |
| 477 | router.push(`/forum/section/${sectionId}`) |
| 478 | } |
| 479 | |
| 480 | const navigateToTopic = (topicId) => { |
| 481 | router.push(`/forum/topic/${topicId}`) |
| 482 | } |
| 483 | |
| 484 | const showTagInput = () => { |
| 485 | tagInputVisible.value = true |
| 486 | nextTick(() => { |
| 487 | tagInputRef.value?.focus() |
| 488 | }) |
| 489 | } |
| 490 | |
| 491 | const addTopicTag = () => { |
| 492 | const tag = tagInputValue.value.trim() |
| 493 | if (tag && !newTopic.tags.includes(tag)) { |
| 494 | newTopic.tags.push(tag) |
| 495 | } |
| 496 | tagInputVisible.value = false |
| 497 | tagInputValue.value = '' |
| 498 | } |
| 499 | |
| 500 | const removeTopicTag = (tag) => { |
| 501 | const index = newTopic.tags.indexOf(tag) |
| 502 | if (index > -1) { |
| 503 | newTopic.tags.splice(index, 1) |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | const handleCloseDialog = () => { |
| 508 | if (newTopic.title || newTopic.content) { |
| 509 | ElMessageBox.confirm( |
| 510 | '确定要关闭吗?未保存的内容将会丢失。', |
| 511 | '提示', |
| 512 | { |
| 513 | confirmButtonText: '确定', |
| 514 | cancelButtonText: '取消', |
| 515 | type: 'warning' |
| 516 | } |
| 517 | ).then(() => { |
| 518 | resetForm() |
| 519 | showNewTopicDialog.value = false |
| 520 | }).catch(() => { |
| 521 | // 用户取消 |
| 522 | }) |
| 523 | } else { |
| 524 | resetForm() |
| 525 | showNewTopicDialog.value = false |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | const submitNewTopic = async () => { |
| 530 | try { |
| 531 | await topicFormRef.value?.validate() |
| 532 | |
| 533 | submitting.value = true |
| 534 | |
| 535 | // 模拟提交过程 |
| 536 | await new Promise(resolve => setTimeout(resolve, 1500)) |
| 537 | |
| 538 | ElMessage.success('主题发布成功!') |
| 539 | resetForm() |
| 540 | showNewTopicDialog.value = false |
| 541 | |
| 542 | // 跳转到新创建的主题页面 |
| 543 | router.push('/forum/topic/new') |
| 544 | |
| 545 | } catch (error) { |
| 546 | console.error('表单验证失败:', error) |
| 547 | } finally { |
| 548 | submitting.value = false |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | const resetForm = () => { |
| 553 | topicFormRef.value?.resetFields() |
| 554 | newTopic.sectionId = '' |
| 555 | newTopic.title = '' |
| 556 | newTopic.content = '' |
| 557 | newTopic.tags = [] |
| 558 | } |
| 559 | |
| 560 | return { |
| 561 | showNewTopicDialog, |
| 562 | submitting, |
| 563 | tagInputVisible, |
| 564 | tagInputValue, |
| 565 | topicFormRef, |
| 566 | tagInputRef, |
| 567 | forumStats, |
| 568 | forumSections, |
| 569 | hotTopics, |
| 570 | recentReplies, |
| 571 | newTopic, |
| 572 | topicRules, |
| 573 | formatTime, |
| 574 | navigateToSection, |
| 575 | navigateToTopic, |
| 576 | showTagInput, |
| 577 | addTopicTag, |
| 578 | removeTopicTag, |
| 579 | handleCloseDialog, |
| 580 | submitNewTopic, |
| 581 | Edit, |
| 582 | ChatDotRound, |
| 583 | Comment, |
| 584 | User, |
| 585 | View, |
| 586 | ArrowRight, |
| 587 | Film, |
| 588 | Headphones, |
| 589 | Monitor, |
| 590 | GamePad, |
| 591 | Bell, |
| 592 | QuestionFilled |
| 593 | } |
| 594 | } |
| 595 | } |
| 596 | </script> |
| 597 | |
| 598 | <style lang="scss" scoped> |
| 599 | .forum-page { |
| 600 | max-width: 1200px; |
| 601 | margin: 0 auto; |
| 602 | padding: 24px; |
| 603 | background: #f5f5f5; |
| 604 | min-height: 100vh; |
| 605 | } |
| 606 | |
| 607 | .forum-header { |
| 608 | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 609 | border-radius: 12px; |
| 610 | padding: 48px 32px; |
| 611 | margin-bottom: 24px; |
| 612 | color: white; |
| 613 | text-align: center; |
| 614 | |
| 615 | h1 { |
| 616 | font-size: 36px; |
| 617 | font-weight: 600; |
| 618 | margin: 0 0 12px 0; |
| 619 | } |
| 620 | |
| 621 | .header-description { |
| 622 | font-size: 18px; |
| 623 | margin: 0 0 24px 0; |
| 624 | opacity: 0.9; |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | .forum-stats { |
| 629 | background: #fff; |
| 630 | border-radius: 12px; |
| 631 | padding: 24px; |
| 632 | margin-bottom: 24px; |
| 633 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); |
| 634 | |
| 635 | .stats-grid { |
| 636 | display: grid; |
| 637 | grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); |
| 638 | gap: 24px; |
| 639 | |
| 640 | .stat-item { |
| 641 | display: flex; |
| 642 | align-items: center; |
| 643 | gap: 16px; |
| 644 | |
| 645 | .stat-info { |
| 646 | h3 { |
| 647 | font-size: 24px; |
| 648 | font-weight: 600; |
| 649 | color: #2c3e50; |
| 650 | margin: 0 0 4px 0; |
| 651 | } |
| 652 | |
| 653 | p { |
| 654 | font-size: 14px; |
| 655 | color: #7f8c8d; |
| 656 | margin: 0; |
| 657 | } |
| 658 | } |
| 659 | } |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | .forum-sections { |
| 664 | background: #fff; |
| 665 | border-radius: 12px; |
| 666 | padding: 24px; |
| 667 | margin-bottom: 24px; |
| 668 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); |
| 669 | |
| 670 | .section-title { |
| 671 | font-size: 20px; |
| 672 | font-weight: 600; |
| 673 | color: #2c3e50; |
| 674 | margin: 0 0 20px 0; |
| 675 | } |
| 676 | |
| 677 | .sections-list { |
| 678 | .section-card { |
| 679 | display: flex; |
| 680 | align-items: center; |
| 681 | gap: 20px; |
| 682 | padding: 20px; |
| 683 | border: 1px solid #f0f0f0; |
| 684 | border-radius: 8px; |
| 685 | margin-bottom: 12px; |
| 686 | cursor: pointer; |
| 687 | transition: all 0.3s ease; |
| 688 | |
| 689 | &:hover { |
| 690 | background: #f8f9fa; |
| 691 | border-color: #409eff; |
| 692 | transform: translateX(4px); |
| 693 | } |
| 694 | |
| 695 | .section-info { |
| 696 | flex: 1; |
| 697 | |
| 698 | .section-name { |
| 699 | font-size: 18px; |
| 700 | font-weight: 600; |
| 701 | color: #2c3e50; |
| 702 | margin: 0 0 8px 0; |
| 703 | } |
| 704 | |
| 705 | .section-description { |
| 706 | font-size: 14px; |
| 707 | color: #7f8c8d; |
| 708 | margin: 0 0 12px 0; |
| 709 | } |
| 710 | |
| 711 | .section-stats { |
| 712 | display: flex; |
| 713 | gap: 16px; |
| 714 | |
| 715 | .stat { |
| 716 | font-size: 12px; |
| 717 | color: #909399; |
| 718 | } |
| 719 | } |
| 720 | } |
| 721 | |
| 722 | .section-latest { |
| 723 | width: 200px; |
| 724 | |
| 725 | .latest-topic { |
| 726 | .topic-title { |
| 727 | font-size: 14px; |
| 728 | color: #2c3e50; |
| 729 | margin: 0 0 8px 0; |
| 730 | overflow: hidden; |
| 731 | text-overflow: ellipsis; |
| 732 | display: -webkit-box; |
| 733 | -webkit-line-clamp: 2; |
| 734 | -webkit-box-orient: vertical; |
| 735 | } |
| 736 | |
| 737 | .topic-meta { |
| 738 | font-size: 12px; |
| 739 | color: #909399; |
| 740 | |
| 741 | .author { |
| 742 | margin-right: 8px; |
| 743 | } |
| 744 | } |
| 745 | } |
| 746 | } |
| 747 | } |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | .hot-topics { |
| 752 | background: #fff; |
| 753 | border-radius: 12px; |
| 754 | padding: 24px; |
| 755 | margin-bottom: 24px; |
| 756 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); |
| 757 | |
| 758 | .section-header { |
| 759 | display: flex; |
| 760 | justify-content: space-between; |
| 761 | align-items: center; |
| 762 | margin-bottom: 20px; |
| 763 | |
| 764 | .section-title { |
| 765 | font-size: 20px; |
| 766 | font-weight: 600; |
| 767 | color: #2c3e50; |
| 768 | margin: 0; |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | .topics-list { |
| 773 | .topic-item { |
| 774 | display: flex; |
| 775 | justify-content: space-between; |
| 776 | align-items: center; |
| 777 | padding: 16px; |
| 778 | border: 1px solid #f0f0f0; |
| 779 | border-radius: 8px; |
| 780 | margin-bottom: 12px; |
| 781 | cursor: pointer; |
| 782 | transition: all 0.3s ease; |
| 783 | |
| 784 | &:hover { |
| 785 | background: #f8f9fa; |
| 786 | border-color: #409eff; |
| 787 | } |
| 788 | |
| 789 | .topic-content { |
| 790 | flex: 1; |
| 791 | |
| 792 | .topic-header { |
| 793 | display: flex; |
| 794 | align-items: center; |
| 795 | gap: 12px; |
| 796 | margin-bottom: 8px; |
| 797 | |
| 798 | .topic-title { |
| 799 | font-size: 16px; |
| 800 | font-weight: 500; |
| 801 | color: #2c3e50; |
| 802 | margin: 0; |
| 803 | } |
| 804 | |
| 805 | .topic-tags { |
| 806 | .el-tag { |
| 807 | margin-right: 4px; |
| 808 | } |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | .topic-meta { |
| 813 | display: flex; |
| 814 | justify-content: space-between; |
| 815 | align-items: center; |
| 816 | |
| 817 | .author-info { |
| 818 | display: flex; |
| 819 | align-items: center; |
| 820 | gap: 8px; |
| 821 | |
| 822 | .author-name { |
| 823 | font-size: 14px; |
| 824 | color: #7f8c8d; |
| 825 | } |
| 826 | } |
| 827 | |
| 828 | .topic-stats { |
| 829 | display: flex; |
| 830 | align-items: center; |
| 831 | gap: 16px; |
| 832 | font-size: 12px; |
| 833 | color: #909399; |
| 834 | |
| 835 | .stat-item { |
| 836 | display: flex; |
| 837 | align-items: center; |
| 838 | gap: 4px; |
| 839 | } |
| 840 | } |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | .topic-status { |
| 845 | .el-tag { |
| 846 | margin-left: 8px; |
| 847 | } |
| 848 | } |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | .recent-replies { |
| 854 | background: #fff; |
| 855 | border-radius: 12px; |
| 856 | padding: 24px; |
| 857 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); |
| 858 | |
| 859 | .section-title { |
| 860 | font-size: 20px; |
| 861 | font-weight: 600; |
| 862 | color: #2c3e50; |
| 863 | margin: 0 0 20px 0; |
| 864 | } |
| 865 | |
| 866 | .replies-list { |
| 867 | .reply-item { |
| 868 | display: flex; |
| 869 | flex-direction: column; |
| 870 | gap: 12px; |
| 871 | padding: 16px; |
| 872 | border: 1px solid #f0f0f0; |
| 873 | border-radius: 8px; |
| 874 | margin-bottom: 12px; |
| 875 | cursor: pointer; |
| 876 | transition: all 0.3s ease; |
| 877 | |
| 878 | &:hover { |
| 879 | background: #f8f9fa; |
| 880 | border-color: #409eff; |
| 881 | } |
| 882 | |
| 883 | .reply-content { |
| 884 | flex: 1; |
| 885 | |
| 886 | .reply-header { |
| 887 | font-size: 14px; |
| 888 | margin-bottom: 8px; |
| 889 | |
| 890 | .reply-author { |
| 891 | font-weight: 600; |
| 892 | color: #2c3e50; |
| 893 | } |
| 894 | |
| 895 | .reply-action { |
| 896 | color: #7f8c8d; |
| 897 | margin: 0 4px; |
| 898 | } |
| 899 | |
| 900 | .topic-title { |
| 901 | color: #409eff; |
| 902 | font-weight: 500; |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | .reply-text { |
| 907 | font-size: 14px; |
| 908 | color: #5a6c7d; |
| 909 | margin-bottom: 8px; |
| 910 | overflow: hidden; |
| 911 | text-overflow: ellipsis; |
| 912 | display: -webkit-box; |
| 913 | -webkit-line-clamp: 2; |
| 914 | -webkit-box-orient: vertical; |
| 915 | } |
| 916 | |
| 917 | .reply-time { |
| 918 | font-size: 12px; |
| 919 | color: #909399; |
| 920 | } |
| 921 | } |
| 922 | } |
| 923 | } |
| 924 | } |
| 925 | </style> |
| 926 | |
| 927 | .tags-input { |
| 928 | display: flex; |
| 929 | flex-wrap: wrap; |
| 930 | gap: 8px; |
| 931 | align-items: center; |
| 932 | |
| 933 | .el-tag { |
| 934 | margin: 0; |
| 935 | } |
| 936 | } |
| 937 | |
| 938 | @media (max-width: 768px) { |
| 939 | .forum-page { |
| 940 | padding: 16px; |
| 941 | } |
| 942 | |
| 943 | .forum-header { |
| 944 | padding: 32px 24px; |
| 945 | |
| 946 | h1 { |
| 947 | font-size: 28px; |
| 948 | } |
| 949 | |
| 950 | .header-description { |
| 951 | font-size: 16px; |
| 952 | } |
| 953 | } |
| 954 | |
| 955 | .stats-grid { |
| 956 | grid-template-columns: repeat(2, 1fr); |
| 957 | } |
| 958 | |
| 959 | .section-card { |
| 960 | flex-direction: column; |
| 961 | text-align: center; |
| 962 | |
| 963 | .section-latest { |
| 964 | width: 100%; |
| 965 | margin-top: 16px; |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | .topic-item { |
| 970 | flex-direction: column; |
| 971 | align-items: flex-start; |
| 972 | |
| 973 | .topic-status { |
| 974 | margin-top: 12px; |
| 975 | align-self: flex-end; |
| 976 | } |
| 977 | } |
| 978 | } |