messageDetail.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="app-container pb-20">
  3. <TopBar title="消息详情" show-back />
  4. <view class="px-4 py-4">
  5. <view class="card p-4">
  6. <view class="flex items-center justify-between mb-3">
  7. <text class="text-base font-bold text-gray-800">{{ message?.title || '消息详情' }}</text>
  8. </view>
  9. <view class="flex items-center text-gray-400 text-sm mb-4">
  10. <text class="mr-1"></text>
  11. <text>{{ message?.createTime ? formatDate(message.createTime, 'YYYY-MM-DD HH:mm') : '' }}</text>
  12. </view>
  13. <view class="border-t border-gray-100 pt-4">
  14. <text class="text-gray-600 text-sm leading-relaxed block mb-4">{{ message?.content || '暂无内容' }}</text>
  15. <view v-if="message?.type === 'task'" class="bg-gray-50 rounded-lg p-4 mb-4">
  16. <view class="flex justify-between text-sm mb-2">
  17. <text class="text-gray-500">任务名称:</text>
  18. <text class="text-gray-700">{{ message.title }}</text>
  19. </view>
  20. <view class="flex justify-between text-sm mb-2">
  21. <text class="text-gray-500">执行班组:</text>
  22. <text class="text-gray-700">张师傅组</text>
  23. </view>
  24. <view class="flex justify-between text-sm mb-2">
  25. <text class="text-gray-500">预计到达:</text>
  26. <text class="text-gray-700">09:30</text>
  27. </view>
  28. <view class="flex justify-between text-sm">
  29. <text class="text-gray-500">联系电话:</text>
  30. <text class="text-gray-700">139****6666</text>
  31. </view>
  32. </view>
  33. <text class="text-gray-600 text-sm leading-relaxed block">
  34. 施工过程中如有任何问题,请及时联系调度中心。服务完成后,请及时验收确认。
  35. </text>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script setup lang="ts">
  42. import { ref, onMounted } from 'vue'
  43. import TopBar from '@/components/common/TopBar.vue'
  44. import { formatDate } from '@/utils'
  45. import type { Notification } from '@/types'
  46. const message = ref<Notification | null>(null)
  47. onMounted(() => {
  48. const data = uni.getStorageSync('current_message')
  49. if (data) {
  50. message.value = data
  51. }
  52. })
  53. </script>