noticeDetail.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="sub-page">
  3. <TopBar title="通知详情" show-back />
  4. <view class="px-4 pt-3">
  5. <view v-if="notice" class="glass-card p-5">
  6. <text class="notice-title">{{ notice.title }}</text>
  7. <view class="meta-row">
  8. <text class="meta-text">{{ formatDate(notice.createTime, 'YYYY-MM-DD HH:mm') }}</text>
  9. </view>
  10. <view class="notice-body">
  11. <text class="body-p">{{ notice.content }}</text>
  12. </view>
  13. </view>
  14. <EmptyState v-else message="公告不存在" />
  15. </view>
  16. </view>
  17. </template>
  18. <script setup lang="ts">
  19. import { ref } from 'vue'
  20. import { onLoad } from '@dcloudio/uni-app'
  21. import TopBar from '../../components/common/TopBar.vue'
  22. import EmptyState from '../../components/common/EmptyState.vue'
  23. import { formatDate } from '../../utils'
  24. interface Notice {
  25. id: string
  26. title: string
  27. content: string
  28. createTime: string
  29. }
  30. const allNotices: Notice[] = [
  31. { id: 'n1', title: '关于调度系统升级的通知', content: '为了提升系统性能和用户体验,我们将于本周末对调度系统进行升级维护。升级期间系统可能短暂不可用,请提前做好工作安排。升级后新增排班自动提醒功能,敬请期待。', createTime: '2026-01-20T09:00:00' },
  32. { id: 'n2', title: '春节期间值班安排公告', content: '春节将至,为确保节日期间服务不中断,请各班组做好值班安排。具体值班表已发送至各班组负责人,如有疑问请联系调度中心。祝大家新春快乐!', createTime: '2026-01-15T09:00:00' },
  33. { id: 'n3', title: '安全生产月活动通知', content: '本月为安全生产月,公司将开展安全培训和应急演练。请所有员工参加,提升安全意识和应急处理能力。具体安排另行通知。', createTime: '2026-02-28T10:00:00' },
  34. { id: 'n4', title: '新员工培训计划安排', content: '本月将有新员工入职,请各班组安排老员工进行带教。培训内容包括:系统操作、安全规范、服务流程等。请各班组提前做好准备。', createTime: '2026-03-10T14:00:00' },
  35. ]
  36. const notice = ref<Notice | null>(null)
  37. onLoad((options) => {
  38. if (options?.id) {
  39. notice.value = allNotices.find(n => n.id === options.id) || null
  40. }
  41. })
  42. </script>
  43. <style scoped>
  44. .sub-page {
  45. max-width: 430px;
  46. margin: 0 auto;
  47. min-height: 100vh;
  48. background-color: #f6fbf9;
  49. padding-bottom: 24px;
  50. }
  51. .glass-card {
  52. background-color: rgba(255, 255, 255, 0.85);
  53. backdrop-filter: blur(14px);
  54. -webkit-backdrop-filter: blur(14px);
  55. border: 1px solid rgba(164, 216, 152, 0.35);
  56. border-radius: 24px;
  57. box-shadow: 0 18px 50px -12px rgba(54, 143, 111, 0.28);
  58. overflow: hidden;
  59. margin-bottom: 12px;
  60. }
  61. .notice-title {
  62. display: block;
  63. font-size: 17px;
  64. font-weight: 700;
  65. color: #1f2937;
  66. line-height: 1.4;
  67. }
  68. .meta-row {
  69. margin-top: 10px;
  70. padding-bottom: 12px;
  71. border-bottom: 1px solid rgba(164, 216, 152, 0.18);
  72. }
  73. .meta-text {
  74. font-size: 12px;
  75. color: #9ca3af;
  76. }
  77. .notice-body {
  78. padding-top: 12px;
  79. }
  80. .body-p {
  81. display: block;
  82. font-size: 14px;
  83. line-height: 1.8;
  84. color: #4b5563;
  85. }
  86. </style>