messageshow.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view class="m-item" :id="'message'+id">
  3. <view class="m-left">
  4. <image class="head_icon" src="https://img-cdn-qiniu.dcloud.net.cn/uniapp/app/homeHL.png" v-if="message.user=='home'"></image>
  5. </view>
  6. <view class="m-content">
  7. <view class="m-content-head" :class="{'m-content-head-right':message.user=='customer'}">
  8. <view :class="'m-content-head-'+message.user">{{message.content}} </view>
  9. </view>
  10. </view>
  11. <view class="m-right">
  12. <image class="head_icon" src="https://img-cdn-qiniu.dcloud.net.cn/uniapp/app/customerHL.png" v-if="message.user=='customer'"></image>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: ['message', 'id']
  19. }
  20. </script>
  21. <style>
  22. .m-item {
  23. display: flex;
  24. flex-direction: row;
  25. padding-top: 40upx;
  26. }
  27. .m-left {
  28. display: flex;
  29. width: 120upx;
  30. justify-content: center;
  31. align-items: flex-start;
  32. }
  33. .m-content {
  34. display: flex;
  35. flex: 1;
  36. flex-direction: column;
  37. justify-content: center;
  38. word-break: break-all;
  39. }
  40. .m-right {
  41. display: flex;
  42. width: 120upx;
  43. justify-content: center;
  44. align-items: flex-start;
  45. }
  46. .head_icon {
  47. width: 80upx;
  48. height: 80upx;
  49. }
  50. .m-content-head {
  51. position: relative;
  52. }
  53. .m-content-head-right {
  54. display: flex;
  55. justify-content: flex-end;
  56. }
  57. .m-content-head-home {
  58. text-align: left;
  59. background: #1482d1;
  60. border: 1px #1482d1 solid;
  61. border-radius: 20upx;
  62. padding: 20upx;
  63. color: white;
  64. }
  65. .m-content-head-home:before {
  66. border: 15upx solid transparent;
  67. border-right: 15upx solid #1482d1;
  68. left: -26upx;
  69. width: 0;
  70. height: 0;
  71. position: absolute;
  72. content: ' '
  73. }
  74. .m-content-head-customer {
  75. border: 1upx white solid;
  76. background: white;
  77. border-radius: 20upx;
  78. padding: 20upx;
  79. }
  80. .m-content-head-customer:after {
  81. border: 15upx solid transparent;
  82. border-left: 15upx solid white;
  83. top: 20upx;
  84. right: -26upx;
  85. width: 0;
  86. height: 0;
  87. position: absolute;
  88. content: ' '
  89. }
  90. </style>