ItemMessage.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view class="px-32 mt-24 flex-column" @click="changeReadStatus">
  3. <text class="w-100p text-center font" style="line-height: 60rpx;color: #9EA5B7;">{{computeTime}}</text>
  4. <view class="flex-row mt-08">
  5. <image :src="item.readStatus === '0'?'/static/images/message-un-read.png':'/static/images/message-read.png'"
  6. style="width: 64rpx;height: 64rpx;" mode="aspectFill"></image>
  7. <view class="flex-1 ml-24 rounded-8 px-32 py-16 flex-column"
  8. style="background-color: white;border: 0.6px solid #FFFFFF;box-shadow: 0px 4px 8px 0px rgba(218, 235, 253, 0.21);">
  9. <text class="font font-weight-bolder"
  10. style="color: #333333;line-height: 60rpx;">{{item.notice_title}}</text>
  11. <text class="font" style="color: #333333;line-height: 60rpx;">{{item.notice_content}}</text>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script setup>
  17. import dayjs from 'dayjs'
  18. import {
  19. computed
  20. } from 'vue'
  21. const emit = defineEmits(['modify'])
  22. const props = defineProps({
  23. item: {
  24. type: Object,
  25. default () {
  26. return {}
  27. }
  28. },
  29. index: {
  30. type: Number,
  31. default: 0
  32. }
  33. })
  34. const computeTime = computed(() => {
  35. return dayjs(props.item.create_time).format('YYYY-MM-DD HH:mm:ss')
  36. })
  37. const changeReadStatus = () => {
  38. if (props.item.readStatus === '0') {
  39. emit('modify', props.item.notice_user_id)
  40. }
  41. }
  42. </script>
  43. <style>
  44. </style>