xingjinwen | d652cc6 | 2025-06-04 19:52:19 +0800 | [diff] [blame^] | 1 | <template> |
| 2 | <div class="topic-detail-page"> |
| 3 | <div class="page-container"> |
| 4 | <!-- 面包屑导航 --> |
| 5 | <div class="breadcrumb"> |
| 6 | <el-breadcrumb separator="/"> |
| 7 | <el-breadcrumb-item :to="{ path: '/forum' }">论坛首页</el-breadcrumb-item> |
| 8 | <el-breadcrumb-item :to="{ path: `/forum/section/${topic.sectionId}` }"> |
| 9 | {{ topic.sectionName }} |
| 10 | </el-breadcrumb-item> |
| 11 | <el-breadcrumb-item>{{ topic.title }}</el-breadcrumb-item> |
| 12 | </el-breadcrumb> |
| 13 | </div> |
| 14 | |
| 15 | <!-- 主题信息 --> |
| 16 | <div class="topic-header"> |
| 17 | <div class="topic-info"> |
| 18 | <div class="topic-title-row"> |
| 19 | <h1 class="topic-title">{{ topic.title }}</h1> |
| 20 | <div class="topic-status"> |
| 21 | <el-tag v-if="topic.pinned" type="warning" size="small">置顶</el-tag> |
| 22 | <el-tag v-if="topic.hot" type="danger" size="small">热门</el-tag> |
| 23 | <el-tag v-if="topic.closed" type="info" size="small">已关闭</el-tag> |
| 24 | </div> |
| 25 | </div> |
| 26 | |
| 27 | <div class="topic-tags"> |
| 28 | <el-tag |
| 29 | v-for="tag in topic.tags" |
| 30 | :key="tag" |
| 31 | size="small" |
| 32 | type="info" |
| 33 | effect="plain" |
| 34 | > |
| 35 | {{ tag }} |
| 36 | </el-tag> |
| 37 | </div> |
| 38 | |
| 39 | <div class="topic-meta"> |
| 40 | <div class="author-info"> |
| 41 | <el-avatar :size="32">{{ topic.author.charAt(0) }}</el-avatar> |
| 42 | <div class="author-details"> |
| 43 | <span class="author-name">{{ topic.author }}</span> |
| 44 | <span class="post-time">发表于 {{ formatDateTime(topic.createTime) }}</span> |
| 45 | </div> |
| 46 | </div> |
| 47 | |
| 48 | <div class="topic-stats"> |
| 49 | <div class="stat-item"> |
| 50 | <el-icon><View /></el-icon> |
| 51 | <span>{{ topic.views }} 浏览</span> |
| 52 | </div> |
| 53 | <div class="stat-item"> |
| 54 | <el-icon><Comment /></el-icon> |
| 55 | <span>{{ topic.replies }} 回复</span> |
| 56 | </div> |
| 57 | </div> |
| 58 | </div> |
| 59 | </div> |
| 60 | |
| 61 | <div class="topic-actions"> |
| 62 | <el-button |
| 63 | v-if="!topic.closed" |
| 64 | type="primary" |
| 65 | :icon="Edit" |
| 66 | @click="showReplyDialog = true" |
| 67 | > |
| 68 | 回复主题 |
| 69 | </el-button> |
| 70 | <el-dropdown @command="handleTopicAction"> |
| 71 | <el-button :icon="More"> |
| 72 | 更多 <el-icon class="el-icon--right"><ArrowDown /></el-icon> |
| 73 | </el-button> |
| 74 | <template #dropdown> |
| 75 | <el-dropdown-menu> |
| 76 | <el-dropdown-item command="favorite"> |
| 77 | {{ isFavorited ? '取消收藏' : '收藏主题' }} |
| 78 | </el-dropdown-item> |
| 79 | <el-dropdown-item command="share">分享主题</el-dropdown-item> |
| 80 | <el-dropdown-item command="report" divided>举报主题</el-dropdown-item> |
| 81 | </el-dropdown-menu> |
| 82 | </template> |
| 83 | </el-dropdown> |
| 84 | </div> |
| 85 | </div> |
| 86 | |
| 87 | <!-- 主题内容和回复列表 --> |
| 88 | <div class="posts-container"> |
| 89 | <!-- 主楼 --> |
| 90 | <div class="post-item main-post"> |
| 91 | <div class="post-header"> |
| 92 | <div class="floor-number">#1</div> |
| 93 | <div class="post-author"> |
| 94 | <el-avatar :size="48">{{ topic.author.charAt(0) }}</el-avatar> |
| 95 | <div class="author-info"> |
| 96 | <span class="author-name">{{ topic.author }}</span> |
| 97 | <span class="author-title">{{ topic.authorTitle || '会员' }}</span> |
| 98 | <div class="author-stats"> |
| 99 | <span>帖子: {{ topic.authorPosts || 0 }}</span> |
| 100 | <span>声望: {{ topic.authorReputation || 0 }}</span> |
| 101 | </div> |
| 102 | </div> |
| 103 | </div> |
| 104 | <div class="post-time"> |
| 105 | {{ formatDateTime(topic.createTime) }} |
| 106 | </div> |
| 107 | </div> |
| 108 | |
| 109 | <div class="post-content"> |
| 110 | <div class="content-text" v-html="formatContent(topic.content)"></div> |
| 111 | </div> |
| 112 | |
| 113 | <div class="post-actions"> |
| 114 | <el-button type="text" size="small" @click="likePost(topic.id)"> |
| 115 | <el-icon><Like /></el-icon> |
| 116 | {{ topic.likes || 0 }} |
| 117 | </el-button> |
| 118 | <el-button type="text" size="small" @click="quotePost(topic)"> |
| 119 | <el-icon><ChatDotRound /></el-icon> |
| 120 | 引用 |
| 121 | </el-button> |
| 122 | <el-button type="text" size="small" @click="reportPost(topic.id)"> |
| 123 | <el-icon><Flag /></el-icon> |
| 124 | 举报 |
| 125 | </el-button> |
| 126 | </div> |
| 127 | </div> |
| 128 | |
| 129 | <!-- 回复列表 --> |
| 130 | <div |
| 131 | v-for="(reply, index) in replies" |
| 132 | :key="reply.id" |
| 133 | class="post-item reply-post" |
| 134 | > |
| 135 | <div class="post-header"> |
| 136 | <div class="floor-number">#{{ index + 2 }}</div> |
| 137 | <div class="post-author"> |
| 138 | <el-avatar :size="48">{{ reply.author.charAt(0) }}</el-avatar> |
| 139 | <div class="author-info"> |
| 140 | <span class="author-name">{{ reply.author }}</span> |
| 141 | <span class="author-title">{{ reply.authorTitle || '会员' }}</span> |
| 142 | <div class="author-stats"> |
| 143 | <span>帖子: {{ reply.authorPosts || 0 }}</span> |
| 144 | <span>声望: {{ reply.authorReputation || 0 }}</span> |
| 145 | </div> |
| 146 | </div> |
| 147 | </div> |
| 148 | <div class="post-time"> |
| 149 | {{ formatDateTime(reply.createTime) }} |
| 150 | </div> |
| 151 | </div> |
| 152 | |
| 153 | <div class="post-content"> |
| 154 | <div v-if="reply.quotedPost" class="quoted-content"> |
| 155 | <div class="quote-header"> |
| 156 | <el-icon><ChatDotRound /></el-icon> |
| 157 | <span>{{ reply.quotedPost.author }} 发表于 {{ formatDateTime(reply.quotedPost.time) }}</span> |
| 158 | </div> |
| 159 | <div class="quote-text">{{ reply.quotedPost.content }}</div> |
| 160 | </div> |
| 161 | <div class="content-text" v-html="formatContent(reply.content)"></div> |
| 162 | </div> |
| 163 | |
| 164 | <div class="post-actions"> |
| 165 | <el-button type="text" size="small" @click="likePost(reply.id)"> |
| 166 | <el-icon><Like /></el-icon> |
| 167 | {{ reply.likes || 0 }} |
| 168 | </el-button> |
| 169 | <el-button type="text" size="small" @click="quotePost(reply)"> |
| 170 | <el-icon><ChatDotRound /></el-icon> |
| 171 | 引用 |
| 172 | </el-button> |
| 173 | <el-button type="text" size="small" @click="reportPost(reply.id)"> |
| 174 | <el-icon><Flag /></el-icon> |
| 175 | 举报 |
| 176 | </el-button> |
| 177 | </div> |
| 178 | </div> |
| 179 | </div> |
| 180 | |
| 181 | <!-- 分页 --> |
| 182 | <div class="pagination-wrapper"> |
| 183 | <el-pagination |
| 184 | v-model:current-page="currentPage" |
| 185 | v-model:page-size="pageSize" |
| 186 | :page-sizes="[10, 20, 50]" |
| 187 | :total="totalReplies" |
| 188 | layout="total, sizes, prev, pager, next, jumper" |
| 189 | @size-change="handleSizeChange" |
| 190 | @current-change="handleCurrentChange" |
| 191 | /> |
| 192 | </div> |
| 193 | |
| 194 | <!-- 快速回复 --> |
| 195 | <div v-if="!topic.closed" class="quick-reply"> |
| 196 | <h3>快速回复</h3> |
| 197 | <el-input |
| 198 | v-model="quickReplyContent" |
| 199 | type="textarea" |
| 200 | :rows="4" |
| 201 | placeholder="输入你的回复..." |
| 202 | maxlength="2000" |
| 203 | show-word-limit |
| 204 | /> |
| 205 | <div class="quick-reply-actions"> |
| 206 | <el-button @click="clearQuickReply">清空</el-button> |
| 207 | <el-button type="primary" @click="submitQuickReply" :loading="submittingReply"> |
| 208 | 发表回复 |
| 209 | </el-button> |
| 210 | </div> |
| 211 | </div> |
| 212 | </div> |
| 213 | |
| 214 | <!-- 回复对话框 --> |
| 215 | <el-dialog |
| 216 | v-model="showReplyDialog" |
| 217 | title="回复主题" |
| 218 | width="700px" |
| 219 | :before-close="handleCloseReplyDialog" |
| 220 | > |
| 221 | <el-form |
| 222 | ref="replyFormRef" |
| 223 | :model="replyForm" |
| 224 | :rules="replyRules" |
| 225 | label-width="80px" |
| 226 | > |
| 227 | <el-form-item v-if="quotedContent" label="引用内容"> |
| 228 | <div class="quoted-preview"> |
| 229 | <div class="quote-header"> |
| 230 | <span>{{ quotedContent.author }}</span> |
| 231 | </div> |
| 232 | <div class="quote-content">{{ quotedContent.content }}</div> |
| 233 | <el-button type="text" size="small" @click="clearQuote"> |
| 234 | 清除引用 |
| 235 | </el-button> |
| 236 | </div> |
| 237 | </el-form-item> |
| 238 | |
| 239 | <el-form-item label="回复内容" prop="content"> |
| 240 | <el-input |
| 241 | v-model="replyForm.content" |
| 242 | type="textarea" |
| 243 | :rows="8" |
| 244 | placeholder="请输入回复内容..." |
| 245 | maxlength="5000" |
| 246 | show-word-limit |
| 247 | /> |
| 248 | </el-form-item> |
| 249 | </el-form> |
| 250 | |
| 251 | <template #footer> |
| 252 | <el-button @click="handleCloseReplyDialog">取消</el-button> |
| 253 | <el-button type="primary" @click="submitReply" :loading="submittingReply"> |
| 254 | 发表回复 |
| 255 | </el-button> |
| 256 | </template> |
| 257 | </el-dialog> |
| 258 | </div> |
| 259 | </template> |
| 260 | |
| 261 | <script> |
| 262 | import { ref, reactive, onMounted } from 'vue' |
| 263 | import { useRoute, useRouter } from 'vue-router' |
| 264 | import { ElMessage, ElMessageBox } from 'element-plus' |
| 265 | import { |
| 266 | Edit, |
| 267 | More, |
| 268 | View, |
| 269 | Comment, |
| 270 | Like, |
| 271 | ChatDotRound, |
| 272 | Flag, |
| 273 | ArrowDown |
| 274 | } from '@element-plus/icons-vue' |
| 275 | |
| 276 | export default { |
| 277 | name: 'ForumTopicView', |
| 278 | setup() { |
| 279 | const route = useRoute() |
| 280 | const router = useRouter() |
| 281 | const replyFormRef = ref(null) |
| 282 | |
| 283 | const showReplyDialog = ref(false) |
| 284 | const submittingReply = ref(false) |
| 285 | const isFavorited = ref(false) |
| 286 | const currentPage = ref(1) |
| 287 | const pageSize = ref(20) |
| 288 | const totalReplies = ref(0) |
| 289 | const quickReplyContent = ref('') |
| 290 | const quotedContent = ref(null) |
| 291 | |
| 292 | const topic = ref({ |
| 293 | id: 1, |
| 294 | title: '2024年度最佳PT站点推荐与对比分析', |
| 295 | sectionId: 1, |
| 296 | sectionName: '站务讨论', |
| 297 | author: 'PTExpert', |
| 298 | authorTitle: '资深会员', |
| 299 | authorPosts: 1256, |
| 300 | authorReputation: 2890, |
| 301 | createTime: '2025-06-01T10:30:00', |
| 302 | content: ` |
| 303 | <p>大家好,作为一个使用PT站点多年的老用户,我想和大家分享一下2024年各大PT站点的使用体验和对比分析。</p> |
| 304 | |
| 305 | <h3>评测标准</h3> |
| 306 | <ul> |
| 307 | <li>资源丰富度:种子数量、更新速度、稀有资源</li> |
| 308 | <li>用户体验:界面设计、功能完善度、响应速度</li> |
| 309 | <li>社区氛围:用户活跃度、互帮互助程度</li> |
| 310 | <li>规则友好性:考核难度、分享率要求、保种要求</li> |
| 311 | </ul> |
| 312 | |
| 313 | <h3>推荐站点</h3> |
| 314 | <p>经过综合评测,以下几个站点值得推荐:</p> |
| 315 | <ol> |
| 316 | <li><strong>站点A</strong>:资源最全,更新最快,适合影视爱好者</li> |
| 317 | <li><strong>站点B</strong>:音乐资源丰富,无损居多,音质发烧友首选</li> |
| 318 | <li><strong>站点C</strong>:软件资源全面,更新及时,开发者必备</li> |
| 319 | </ol> |
| 320 | |
| 321 | <p>具体的详细评测报告我会在后续回复中逐一介绍,欢迎大家讨论和补充!</p> |
| 322 | `, |
| 323 | views: 2856, |
| 324 | replies: 147, |
| 325 | likes: 89, |
| 326 | tags: ['PT站点', '推荐', '对比'], |
| 327 | pinned: true, |
| 328 | hot: true, |
| 329 | closed: false |
| 330 | }) |
| 331 | |
| 332 | const replies = ref([ |
| 333 | { |
| 334 | id: 2, |
| 335 | author: 'MovieLover88', |
| 336 | authorTitle: '影视达人', |
| 337 | authorPosts: 567, |
| 338 | authorReputation: 1234, |
| 339 | createTime: '2025-06-01T11:15:00', |
| 340 | content: '感谢楼主的详细分析!特别期待站点A的详细评测,最近正在寻找好的影视资源站点。', |
| 341 | likes: 12 |
| 342 | }, |
| 343 | { |
| 344 | id: 3, |
| 345 | author: 'TechGuru', |
| 346 | authorTitle: '技术专家', |
| 347 | authorPosts: 890, |
| 348 | authorReputation: 2156, |
| 349 | createTime: '2025-06-01T12:30:00', |
| 350 | content: '站点C确实不错,软件资源很全面。不过楼主能不能也评测一下游戏类的PT站点?', |
| 351 | likes: 8, |
| 352 | quotedPost: { |
| 353 | author: 'PTExpert', |
| 354 | time: '2025-06-01T10:30:00', |
| 355 | content: '站点C:软件资源全面,更新及时,开发者必备' |
| 356 | } |
| 357 | } |
| 358 | ]) |
| 359 | |
| 360 | const replyForm = reactive({ |
| 361 | content: '' |
| 362 | }) |
| 363 | |
| 364 | const replyRules = { |
| 365 | content: [ |
| 366 | { required: true, message: '请输入回复内容', trigger: 'blur' }, |
| 367 | { min: 5, max: 5000, message: '内容长度在 5 到 5000 个字符', trigger: 'blur' } |
| 368 | ] |
| 369 | } |
| 370 | |
| 371 | onMounted(() => { |
| 372 | const topicId = route.params.id |
| 373 | fetchTopicDetail(topicId) |
| 374 | }) |
| 375 | |
| 376 | const fetchTopicDetail = async (id) => { |
| 377 | try { |
| 378 | console.log('获取主题详情:', id) |
| 379 | totalReplies.value = 147 |
| 380 | } catch (error) { |
| 381 | ElMessage.error('获取主题详情失败') |
| 382 | router.back() |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | const formatDateTime = (dateString) => { |
| 387 | const date = new Date(dateString) |
| 388 | return date.toLocaleString('zh-CN', { |
| 389 | year: 'numeric', |
| 390 | month: '2-digit', |
| 391 | day: '2-digit', |
| 392 | hour: '2-digit', |
| 393 | minute: '2-digit' |
| 394 | }) |
| 395 | } |
| 396 | |
| 397 | const formatContent = (content) => { |
| 398 | return content.replace(/\n/g, '<br>') |
| 399 | } |
| 400 | |
| 401 | const handleTopicAction = (command) => { |
| 402 | switch (command) { |
| 403 | case 'favorite': |
| 404 | isFavorited.value = !isFavorited.value |
| 405 | ElMessage.success(isFavorited.value ? '已收藏' : '已取消收藏') |
| 406 | break |
| 407 | case 'share': |
| 408 | navigator.clipboard.writeText(window.location.href) |
| 409 | ElMessage.success('链接已复制到剪贴板') |
| 410 | break |
| 411 | case 'report': |
| 412 | reportPost(topic.value.id) |
| 413 | break |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | const likePost = (postId) => { |
| 418 | if (postId === topic.value.id) { |
| 419 | topic.value.likes = (topic.value.likes || 0) + 1 |
| 420 | } else { |
| 421 | const reply = replies.value.find(r => r.id === postId) |
| 422 | if (reply) { |
| 423 | reply.likes = (reply.likes || 0) + 1 |
| 424 | } |
| 425 | } |
| 426 | ElMessage.success('点赞成功') |
| 427 | } |
| 428 | |
| 429 | const quotePost = (post) => { |
| 430 | quotedContent.value = { |
| 431 | author: post.author, |
| 432 | content: post.content.replace(/<[^>]*>/g, '').substring(0, 100) + '...', |
| 433 | time: post.createTime |
| 434 | } |
| 435 | showReplyDialog.value = true |
| 436 | } |
| 437 | |
| 438 | const reportPost = async (postId) => { |
| 439 | try { |
| 440 | await ElMessageBox.prompt('请说明举报原因', '举报内容', { |
| 441 | confirmButtonText: '提交举报', |
| 442 | cancelButtonText: '取消', |
| 443 | inputType: 'textarea', |
| 444 | inputPlaceholder: '请详细说明举报原因...' |
| 445 | }) |
| 446 | |
| 447 | ElMessage.success('举报已提交,我们会尽快处理') |
| 448 | } catch { |
| 449 | // 用户取消 |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | const clearQuote = () => { |
| 454 | quotedContent.value = null |
| 455 | } |
| 456 | |
| 457 | const handleCloseReplyDialog = () => { |
| 458 | if (replyForm.content) { |
| 459 | ElMessageBox.confirm( |
| 460 | '确定要关闭吗?未保存的内容将会丢失。', |
| 461 | '提示', |
| 462 | { |
| 463 | confirmButtonText: '确定', |
| 464 | cancelButtonText: '取消', |
| 465 | type: 'warning' |
| 466 | } |
| 467 | ).then(() => { |
| 468 | resetReplyForm() |
| 469 | showReplyDialog.value = false |
| 470 | }).catch(() => { |
| 471 | // 用户取消 |
| 472 | }) |
| 473 | } else { |
| 474 | resetReplyForm() |
| 475 | showReplyDialog.value = false |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | const submitReply = async () => { |
| 480 | try { |
| 481 | await replyFormRef.value?.validate() |
| 482 | |
| 483 | submittingReply.value = true |
| 484 | |
| 485 | await new Promise(resolve => setTimeout(resolve, 1500)) |
| 486 | |
| 487 | const newReply = { |
| 488 | id: Date.now(), |
| 489 | author: localStorage.getItem('username') || '用户', |
| 490 | authorTitle: '会员', |
| 491 | authorPosts: 0, |
| 492 | authorReputation: 0, |
| 493 | createTime: new Date().toISOString(), |
| 494 | content: replyForm.content, |
| 495 | likes: 0, |
| 496 | quotedPost: quotedContent.value |
| 497 | } |
| 498 | |
| 499 | replies.value.push(newReply) |
| 500 | topic.value.replies += 1 |
| 501 | |
| 502 | ElMessage.success('回复发表成功!') |
| 503 | resetReplyForm() |
| 504 | showReplyDialog.value = false |
| 505 | |
| 506 | } catch (error) { |
| 507 | console.error('表单验证失败:', error) |
| 508 | } finally { |
| 509 | submittingReply.value = false |
| 510 | } |
| 511 | } |
| 512 | |
| 513 | const submitQuickReply = async () => { |
| 514 | if (!quickReplyContent.value.trim()) { |
| 515 | ElMessage.warning('请输入回复内容') |
| 516 | return |
| 517 | } |
| 518 | |
| 519 | submittingReply.value = true |
| 520 | try { |
| 521 | await new Promise(resolve => setTimeout(resolve, 1000)) |
| 522 | |
| 523 | const newReply = { |
| 524 | id: Date.now(), |
| 525 | author: localStorage.getItem('username') || '用户', |
| 526 | authorTitle: '会员', |
| 527 | authorPosts: 0, |
| 528 | authorReputation: 0, |
| 529 | createTime: new Date().toISOString(), |
| 530 | content: quickReplyContent.value, |
| 531 | likes: 0 |
| 532 | } |
| 533 | |
| 534 | replies.value.push(newReply) |
| 535 | topic.value.replies += 1 |
| 536 | quickReplyContent.value = '' |
| 537 | |
| 538 | ElMessage.success('回复发表成功!') |
| 539 | } catch (error) { |
| 540 | ElMessage.error('发表回复失败') |
| 541 | } finally { |
| 542 | submittingReply.value = false |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | const clearQuickReply = () => { |
| 547 | quickReplyContent.value = '' |
| 548 | } |
| 549 | |
| 550 | const resetReplyForm = () => { |
| 551 | replyFormRef.value?.resetFields() |
| 552 | replyForm.content = '' |
| 553 | quotedContent.value = null |
| 554 | } |
| 555 | |
| 556 | const handleSizeChange = (size) => { |
| 557 | pageSize.value = size |
| 558 | currentPage.value = 1 |
| 559 | } |
| 560 | |
| 561 | const handleCurrentChange = (page) => { |
| 562 | currentPage.value = page |
| 563 | } |
| 564 | |
| 565 | return { |
| 566 | showReplyDialog, |
| 567 | submittingReply, |
| 568 | isFavorited, |
| 569 | currentPage, |
| 570 | pageSize, |
| 571 | totalReplies, |
| 572 | quickReplyContent, |
| 573 | quotedContent, |
| 574 | topic, |
| 575 | replies, |
| 576 | replyForm, |
| 577 | replyRules, |
| 578 | replyFormRef, |
| 579 | formatDateTime, |
| 580 | formatContent, |
| 581 | handleTopicAction, |
| 582 | likePost, |
| 583 | quotePost, |
| 584 | reportPost, |
| 585 | clearQuote, |
| 586 | handleCloseReplyDialog, |
| 587 | submitReply, |
| 588 | submitQuickReply, |
| 589 | clearQuickReply, |
| 590 | handleSizeChange, |
| 591 | handleCurrentChange, |
| 592 | Edit, |
| 593 | More, |
| 594 | View, |
| 595 | Comment, |
| 596 | Like, |
| 597 | ChatDotRound, |
| 598 | Flag, |
| 599 | ArrowDown |
| 600 | } |
| 601 | } |
| 602 | } |
| 603 | </script> |
| 604 | |
| 605 | <style lang="scss" scoped> |
| 606 | .topic-detail-page { |
| 607 | max-width: 1000px; |
| 608 | margin: 0 auto; |
| 609 | padding: 24px; |
| 610 | background: #f5f5f5; |
| 611 | min-height: 100vh; |
| 612 | } |
| 613 | |
| 614 | .breadcrumb { |
| 615 | margin-bottom: 16px; |
| 616 | } |
| 617 | |
| 618 | .topic-header { |
| 619 | background: #fff; |
| 620 | border-radius: 12px; |
| 621 | padding: 24px; |
| 622 | margin-bottom: 24px; |
| 623 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); |
| 624 | |
| 625 | display: flex; |
| 626 | justify-content: space-between; |
| 627 | align-items: flex-start; |
| 628 | gap: 24px; |
| 629 | |
| 630 | .topic-info { |
| 631 | flex: 1; |
| 632 | |
| 633 | .topic-title-row { |
| 634 | display: flex; |
| 635 | align-items: center; |
| 636 | gap: 12px; |
| 637 | margin-bottom: 12px; |
| 638 | |
| 639 | .topic-title { |
| 640 | font-size: 24px; |
| 641 | font-weight: 600; |
| 642 | color: #2c3e50; |
| 643 | margin: 0; |
| 644 | flex: 1; |
| 645 | } |
| 646 | |
| 647 | .topic-status { |
| 648 | .el-tag { |
| 649 | margin-left: 8px; |
| 650 | } |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | .topic-tags { |
| 655 | margin-bottom: 16px; |
| 656 | |
| 657 | .el-tag { |
| 658 | margin-right: 8px; |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | .topic-meta { |
| 663 | display: flex; |
| 664 | justify-content: space-between; |
| 665 | align-items: center; |
| 666 | |
| 667 | .author-info { |
| 668 | display: flex; |
| 669 | align-items: center; |
| 670 | gap: 12px; |
| 671 | |
| 672 | .author-details { |
| 673 | .author-name { |
| 674 | display: block; |
| 675 | font-weight: 600; |
| 676 | color: #2c3e50; |
| 677 | font-size: 14px; |
| 678 | } |
| 679 | |
| 680 | .post-time { |
| 681 | display: block; |
| 682 | font-size: 12px; |
| 683 | color: #909399; |
| 684 | } |
| 685 | } |
| 686 | } |
| 687 | |
| 688 | .topic-stats { |
| 689 | display: flex; |
| 690 | gap: 16px; |
| 691 | |
| 692 | .stat-item { |
| 693 | display: flex; |
| 694 | align-items: center; |
| 695 | gap: 4px; |
| 696 | font-size: 14px; |
| 697 | color: #7f8c8d; |
| 698 | } |
| 699 | } |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | .topic-actions { |
| 704 | display: flex; |
| 705 | gap: 12px; |
| 706 | flex-shrink: 0; |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | .posts-container { |
| 711 | .post-item { |
| 712 | background: #fff; |
| 713 | border-radius: 12px; |
| 714 | margin-bottom: 16px; |
| 715 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); |
| 716 | overflow: hidden; |
| 717 | |
| 718 | &.main-post { |
| 719 | border-left: 4px solid #409eff; |
| 720 | } |
| 721 | |
| 722 | .post-header { |
| 723 | background: #f8f9fa; |
| 724 | padding: 16px 24px; |
| 725 | display: flex; |
| 726 | align-items: center; |
| 727 | gap: 16px; |
| 728 | border-bottom: 1px solid #f0f0f0; |
| 729 | |
| 730 | .floor-number { |
| 731 | background: #409eff; |
| 732 | color: white; |
| 733 | padding: 4px 8px; |
| 734 | border-radius: 4px; |
| 735 | font-size: 12px; |
| 736 | font-weight: 600; |
| 737 | min-width: 32px; |
| 738 | text-align: center; |
| 739 | } |
| 740 | |
| 741 | .post-author { |
| 742 | display: flex; |
| 743 | align-items: center; |
| 744 | gap: 12px; |
| 745 | flex: 1; |
| 746 | |
| 747 | .author-info { |
| 748 | .author-name { |
| 749 | display: block; |
| 750 | font-weight: 600; |
| 751 | color: #2c3e50; |
| 752 | font-size: 14px; |
| 753 | } |
| 754 | |
| 755 | .author-title { |
| 756 | display: block; |
| 757 | font-size: 12px; |
| 758 | color: #67c23a; |
| 759 | margin-bottom: 4px; |
| 760 | } |
| 761 | |
| 762 | .author-stats { |
| 763 | font-size: 11px; |
| 764 | color: #909399; |
| 765 | |
| 766 | span { |
| 767 | margin-right: 12px; |
| 768 | } |
| 769 | } |
| 770 | } |
| 771 | } |
| 772 | |
| 773 | .post-time { |
| 774 | font-size: 12px; |
| 775 | color: #909399; |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | .post-content { |
| 780 | padding: 24px; |
| 781 | |
| 782 | .quoted-content { |
| 783 | background: #f5f7fa; |
| 784 | border-left: 4px solid #e4e7ed; |
| 785 | padding: 12px 16px; |
| 786 | margin-bottom: 16px; |
| 787 | border-radius: 0 4px 4px 0; |
| 788 | |
| 789 | .quote-header { |
| 790 | display: flex; |
| 791 | align-items: center; |
| 792 | gap: 8px; |
| 793 | font-size: 12px; |
| 794 | color: #909399; |
| 795 | margin-bottom: 8px; |
| 796 | } |
| 797 | |
| 798 | .quote-text { |
| 799 | font-size: 14px; |
| 800 | color: #606266; |
| 801 | line-height: 1.5; |
| 802 | } |
| 803 | } |
| 804 | |
| 805 | .content-text { |
| 806 | line-height: 1.6; |
| 807 | color: #2c3e50; |
| 808 | |
| 809 | :deep(h3) { |
| 810 | color: #2c3e50; |
| 811 | font-size: 18px; |
| 812 | font-weight: 600; |
| 813 | margin: 20px 0 12px 0; |
| 814 | } |
| 815 | |
| 816 | :deep(p) { |
| 817 | margin-bottom: 12px; |
| 818 | } |
| 819 | |
| 820 | :deep(ul), :deep(ol) { |
| 821 | margin: 12px 0; |
| 822 | padding-left: 20px; |
| 823 | |
| 824 | li { |
| 825 | margin-bottom: 8px; |
| 826 | } |
| 827 | } |
| 828 | } |
| 829 | } |
| 830 | |
| 831 | .post-actions { |
| 832 | padding: 12px 24px; |
| 833 | border-top: 1px solid #f0f0f0; |
| 834 | background: #fafafa; |
| 835 | |
| 836 | .el-button { |
| 837 | margin-right: 16px; |
| 838 | |
| 839 | .el-icon { |
| 840 | margin-right: 4px; |
| 841 | } |
| 842 | } |
| 843 | } |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | .pagination-wrapper { |
| 848 | text-align: center; |
| 849 | margin: 24px 0; |
| 850 | } |
| 851 | |
| 852 | .quick-reply { |
| 853 | background: #fff; |
| 854 | border-radius: 12px; |
| 855 | padding: 24px; |
| 856 | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); |
| 857 | |
| 858 | h3 { |
| 859 | font-size: 18px; |
| 860 | font-weight: 600; |
| 861 | color: #2c3e50; |
| 862 | margin: 0 0 16px 0; |
| 863 | } |
| 864 | |
| 865 | .quick-reply-actions { |
| 866 | margin-top: 12px; |
| 867 | text-align: right; |
| 868 | |
| 869 | .el-button { |
| 870 | margin-left: 12px; |
| 871 | } |
| 872 | } |
| 873 | } |
| 874 | |
| 875 | .quoted-preview { |
| 876 | background: #f5f7fa; |
| 877 | border: 1px solid #e4e7ed; |
| 878 | border-radius: 4px; |
| 879 | padding: 12px; |
| 880 | |
| 881 | .quote-header { |
| 882 | font-size: 12px; |
| 883 | color: #909399; |
| 884 | margin-bottom: 8px; |
| 885 | } |
| 886 | |
| 887 | .quote-content { |
| 888 | font-size: 14px; |
| 889 | color: #606266; |
| 890 | margin-bottom: 8px; |
| 891 | line-height: 1.5; |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | @media (max-width: 768px) { |
| 896 | .topic-detail-page { |
| 897 | padding: 16px; |
| 898 | } |
| 899 | |
| 900 | .topic-header { |
| 901 | flex-direction: column; |
| 902 | align-items: flex-start; |
| 903 | |
| 904 | .topic-actions { |
| 905 | width: 100%; |
| 906 | justify-content: flex-end; |
| 907 | } |
| 908 | } |
| 909 | |
| 910 | .post-header { |
| 911 | flex-direction: column; |
| 912 | align-items: flex-start; |
| 913 | gap: 12px; |
| 914 | |
| 915 | .floor-number { |
| 916 | align-self: flex-start; |
| 917 | } |
| 918 | } |
| 919 | |
| 920 | .post-content { |
| 921 | padding: 16px; |
| 922 | } |
| 923 | |
| 924 | .post-actions { |
| 925 | padding: 12px 16px; |
| 926 | |
| 927 | .el-button { |
| 928 | margin-right: 8px; |
| 929 | margin-bottom: 8px; |
| 930 | } |
| 931 | } |
| 932 | } |
| 933 | </style> |