messageDetail.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="sub-page">
  3. <TopBar title="消息详情" show-back />
  4. <view class="px-4 pt-3">
  5. <view class="glass-card p-5">
  6. <text class="notice-title">{{ message?.title || '消息详情' }}</text>
  7. <view class="meta-row">
  8. <text class="meta-text">{{ message?.createTime ? formatDate(message.createTime, 'YYYY-MM-DD HH:mm') : '' }}</text>
  9. </view>
  10. <view class="notice-body">
  11. <text class="body-p">{{ message?.content || '暂无内容' }}</text>
  12. <view v-if="message?.type === 'task'" class="task-box">
  13. <view class="meta-line">
  14. <text class="meta-label">任务名称</text>
  15. <text class="meta-value">{{ message.title }}</text>
  16. </view>
  17. <view class="meta-line">
  18. <text class="meta-label">执行班组</text>
  19. <text class="meta-value">张师傅组</text>
  20. </view>
  21. <view class="meta-line">
  22. <text class="meta-label">预计到达</text>
  23. <text class="meta-value">09:30</text>
  24. </view>
  25. <view class="meta-line">
  26. <text class="meta-label">联系电话</text>
  27. <text class="meta-value">139****6666</text>
  28. </view>
  29. </view>
  30. <text class="body-p">施工过程中如有任何问题,请及时联系调度中心。服务完成后,请及时验收确认。</text>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </template>
  36. <script setup lang="ts">
  37. import { ref, onMounted } from 'vue'
  38. import TopBar from '@/components/common/TopBar.vue'
  39. import { formatDate } from '@/utils'
  40. import type { Notification } from '@/types'
  41. const message = ref<Notification | null>(null)
  42. onMounted(() => {
  43. const data = uni.getStorageSync('current_message')
  44. if (data) {
  45. message.value = data
  46. }
  47. })
  48. </script>
  49. <style scoped>
  50. .sub-page {
  51. max-width: 430px;
  52. margin: 0 auto;
  53. min-height: 100vh;
  54. background-color: #f6fbf9;
  55. padding-bottom: 24px;
  56. }
  57. .glass-card {
  58. background-color: rgba(255, 255, 255, 0.85);
  59. backdrop-filter: blur(14px);
  60. -webkit-backdrop-filter: blur(14px);
  61. border: 1px solid rgba(164, 216, 152, 0.35);
  62. border-radius: 24px;
  63. box-shadow: 0 18px 50px -12px rgba(54, 143, 111, 0.28);
  64. overflow: hidden;
  65. margin-bottom: 12px;
  66. }
  67. .notice-title {
  68. display: block;
  69. font-size: 17px;
  70. font-weight: 700;
  71. color: #1f2937;
  72. line-height: 1.4;
  73. }
  74. .meta-row {
  75. margin-top: 8px;
  76. padding-bottom: 12px;
  77. border-bottom: 1px solid rgba(164, 216, 152, 0.18);
  78. }
  79. .meta-text {
  80. font-size: 12px;
  81. color: #9ca3af;
  82. }
  83. .notice-body {
  84. padding-top: 12px;
  85. }
  86. .body-p {
  87. display: block;
  88. margin-bottom: 12px;
  89. font-size: 14px;
  90. line-height: 1.8;
  91. color: #4b5563;
  92. }
  93. .task-box {
  94. padding: 12px;
  95. margin-bottom: 12px;
  96. border-radius: 14px;
  97. background-color: rgba(164, 216, 152, 0.14);
  98. border: 1px solid rgba(164, 216, 152, 0.3);
  99. }
  100. .meta-line {
  101. display: flex;
  102. align-items: center;
  103. justify-content: space-between;
  104. margin-bottom: 6px;
  105. }
  106. .meta-line:last-child {
  107. margin-bottom: 0;
  108. }
  109. .meta-label {
  110. font-size: 12px;
  111. color: #9ca3af;
  112. }
  113. .meta-value {
  114. font-size: 13px;
  115. color: #4b5563;
  116. }
  117. </style>