index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="msg_quote_container u-line-2">
  3. <text>{{ msgQuoteContent.msgSender }}</text
  4. >:<text>{{ msgQuotePreview }}</text></view
  5. >
  6. </template>
  7. <script>
  8. import { MESSAGE_STATUS } from '@/EaseIM/constant';
  9. export default {
  10. props: {
  11. msgQuoteContent: {
  12. type: Object,
  13. default: () => ({
  14. msgID: '', //引用消息id
  15. msgPreview: '', //引用消息预览
  16. msgSender: '', //引用消息发送人
  17. msgType: '', //引用消息类型
  18. }),
  19. required: true,
  20. },
  21. },
  22. computed: {
  23. messageStatusCollection() {
  24. return this.$store.getters.messageStatusCollection;
  25. },
  26. msgQuotePreview() {
  27. if (
  28. this.messageStatusCollection[this.msgQuoteContent.msgID] ===
  29. MESSAGE_STATUS.RECALL
  30. ) {
  31. return '消息被撤回';
  32. } else {
  33. return this.msgQuoteContent.msgPreview;
  34. }
  35. },
  36. },
  37. };
  38. </script>
  39. <style scoped>
  40. .msg_quote_container {
  41. width: 100%;
  42. max-width: 70%;
  43. min-width: 100px;
  44. background-color: #f1f2f3;
  45. border-radius: 4px;
  46. color: #75828a;
  47. padding: 8px 12px 8px 12px;
  48. font-size: 14px;
  49. word-break: break-all;
  50. }
  51. </style>