ItemMessage.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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;">{{item.createTime}}</text>
  4. <view class="flex-row mt-08">
  5. <image :src="item.isRead === '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"
  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" style="color: #333333;line-height: 60rpx;">{{item.message}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script setup>
  15. const emit = defineEmits(['modify'])
  16. const props = defineProps({
  17. item: {
  18. type: Object,
  19. default () {
  20. return {}
  21. }
  22. },
  23. index: {
  24. type: Number,
  25. default: 0
  26. }
  27. })
  28. const changeReadStatus = () => {
  29. if (props.item.isRead === '0') {
  30. emit('modify', props.item.id)
  31. }
  32. }
  33. </script>
  34. <style>
  35. </style>