ChatInfo.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div class="chat-info" :class="{ isLeft: isLeft }">
  3. <div class="chat-time">今天12:10</div>
  4. <div class="chat-content">
  5. <div class="chat-message">你好,这个藏品怎么支付?</div>
  6. <img src="../assets/png_moren.png" alt="" class="icon" />
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. props: {
  13. info: {
  14. type: Object,
  15. default: () => {
  16. return {}
  17. }
  18. },
  19. isLeft: {
  20. type: Boolean,
  21. default: false
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="less" scoped>
  27. .chat-info {
  28. padding: 16px;
  29. &.isLeft {
  30. .chat-content {
  31. flex-direction: row-reverse;
  32. .chat-message {
  33. background: var(--ion-text-color);
  34. border-radius: 2px 12px 12px 12px;
  35. color: #000000;
  36. }
  37. }
  38. }
  39. }
  40. .chat-time {
  41. font-size: 12px;
  42. color: #878d99;
  43. line-height: 17px;
  44. text-align: center;
  45. margin-bottom: 10px;
  46. }
  47. .chat-content {
  48. .f();
  49. justify-content: flex-end;
  50. .icon {
  51. width: 36px;
  52. height: 36px;
  53. box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.04);
  54. border-radius: 4px;
  55. }
  56. .chat-message {
  57. background: #000000;
  58. border-radius: 12px 2px 12px 12px;
  59. font-size: 16px;
  60. font-family: PingFangSC-Regular, PingFang SC;
  61. font-weight: 400;
  62. color: var(--ion-text-color);
  63. line-height: 26px;
  64. padding: 10px;
  65. margin: 0 8px;
  66. }
  67. }
  68. </style>