index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view
  3. :class="[
  4. 'text_msg_contatiner',
  5. isSelf(msgBody)
  6. ? 'text_msg_contatiner_mine'
  7. : 'text_msg_contatiner_other',
  8. ]"
  9. >
  10. {{ msgBody.msg }}
  11. <text
  12. :class="isSelf(msgBody) ? 'edited_text_msg' : 'edited_text_msg_other'"
  13. v-if="msgBody.modifiedInfo"
  14. >已编辑</text
  15. >
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. msgBody: {
  22. type: Object,
  23. default: () => ({}),
  24. },
  25. },
  26. data() {
  27. return {};
  28. },
  29. computed: {
  30. isSelf() {
  31. return (item) => {
  32. return (
  33. item.from ===
  34. this.$store.state.LoginStore.loginUserBaseInfos.loginUserId
  35. );
  36. };
  37. },
  38. },
  39. methods: {},
  40. };
  41. </script>
  42. <style scoped>
  43. .text_msg_contatiner {
  44. /* 简体中文/文本/大 */
  45. font-family: 'PingFang SC';
  46. font-style: normal;
  47. font-weight: 400;
  48. font-size: 16px;
  49. line-height: 22px;
  50. /* or 138% */
  51. /* Neutral/1 */
  52. color: #171a1c;
  53. /* Inside auto layout */
  54. flex: none;
  55. order: 0;
  56. flex-grow: 0;
  57. }
  58. .text_msg_contatiner_other {
  59. /* Frame 613 */
  60. /* Auto layout */
  61. display: flex;
  62. flex-direction: column;
  63. align-items: flex-start;
  64. padding: 7px 12px;
  65. /* Primary/5 */
  66. background: #e6f5ff;
  67. border-radius: 12px 16px 16px 4px;
  68. /* Alphabet/Body/Large */
  69. font-family: 'SF Pro';
  70. font-style: normal;
  71. font-weight: 400;
  72. font-size: 16px;
  73. line-height: 22px;
  74. /* or 138% */
  75. letter-spacing: 0.002em;
  76. /* Neutral/98 */
  77. color: #171a1c;
  78. /* Inside auto layout */
  79. flex: none;
  80. order: 0;
  81. flex-grow: 0;
  82. }
  83. .text_msg_contatiner_mine {
  84. /* Frame 613 */
  85. /* Auto layout */
  86. display: flex;
  87. flex-direction: column;
  88. align-items: flex-start;
  89. padding: 7px 12px;
  90. /* Primary/95 */
  91. background: #009eff;
  92. border-radius: 16px 12px 4px 16px;
  93. /* Sei la cosa più bella che mi sia mai capitata, non so stare senza te. */
  94. /* Alphabet/Body/Large */
  95. font-family: 'SF Pro';
  96. font-style: normal;
  97. font-weight: 400;
  98. font-size: 16px;
  99. line-height: 22px;
  100. /* or 138% */
  101. letter-spacing: 0.002em;
  102. /* Neutral/1 */
  103. color: #f9fafa;
  104. /* Inside auto layout */
  105. flex: none;
  106. order: 0;
  107. flex-grow: 0;
  108. }
  109. .edited_text_msg,
  110. .edited_text_msg_other {
  111. /* 已编辑 */
  112. width: 100%;
  113. /* 简体中文/文本/超小 */
  114. font-family: 'PingFang SC';
  115. font-style: normal;
  116. font-weight: 400;
  117. font-size: 11px;
  118. line-height: 14px;
  119. /* identical to box height, or 127% */
  120. text-align: right;
  121. /* Neutral Special/98 */
  122. color: #f8f9fc;
  123. /* Inside auto layout */
  124. flex: none;
  125. order: 1;
  126. flex-grow: 0;
  127. text-align: right;
  128. }
  129. .edited_text_msg_other {
  130. color: #5270ad;
  131. text-align: left;
  132. }
  133. </style>