messageshow.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="m-item" :id="'message'+id">
  3. <view class="m-left" @click="users(user.home.id)">
  4. <image class="head_icon" :src="user.home.img" v-if="message.user=='home'"></image>
  5. </view>
  6. <view class="m-content">
  7. <view class="m-content-head" >
  8. <view :class="'m-content-head-s-'+message.user" v-if="message.user=='home'">{{this.$store.getters.chatname}} {{message.date}}</view>
  9. <view :class="'m-content-head-s-'+message.user" v-else>{{message.date}} {{this.$store.getters.realname}} </view>
  10. <view :class="'m-content-head-'+message.user">{{message.content}} </view>
  11. </view>
  12. </view>
  13. <view class="m-right" @click="users(user.customer.id)">
  14. <image class="head_icon" :src="user.customer.img" v-if="message.user=='customer'"></image>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import {
  20. mapState
  21. } from 'vuex'
  22. import api from '@/api/api'
  23. export default {
  24. data() {
  25. return {
  26. abosultPaht: "../../",
  27. ats:"http://10.0.0.94:8080/jeecg-boot/sys/common/static/"
  28. }
  29. },
  30. methods:{
  31. users:function(e){
  32. this.$store.commit('SET_TEMUSERID',e);
  33. this.$Router.push({name:'teamuser'})
  34. }
  35. },
  36. props: ['message', 'id'],
  37. computed: mapState(['user'])
  38. }
  39. </script>
  40. <style>
  41. .m-item {
  42. display: flex;
  43. flex-direction: row;
  44. padding-top: 40px;
  45. }
  46. .m-left {
  47. display: flex;
  48. width: 80px;
  49. justify-content: center;
  50. align-items: flex-start;
  51. }
  52. .m-content {
  53. display: flex;
  54. flex: 1;
  55. flex-direction: column;
  56. justify-content: center;
  57. word-break: break-all;
  58. }
  59. .m-right {
  60. display: flex;
  61. width: 80px;
  62. justify-content: center;
  63. align-items: flex-start;
  64. }
  65. .head_icon {
  66. width: 40px;
  67. height: 40px;
  68. }
  69. .m-content-head {
  70. position: relative;
  71. }
  72. .m-content-head-right {
  73. display: flex;
  74. justify-content: flex-end;
  75. }
  76. .m-content-head-home {
  77. text-align: left;
  78. background: #1482d1;
  79. border: 1px #1482d1 solid;
  80. border-radius: 5px;
  81. padding: 10px;
  82. color: white;
  83. width:fit-content;
  84. }
  85. .m-content-head-home:before {
  86. border: 15px solid transparent;
  87. border-right: 15px solid #1482d1;
  88. left: -26px;
  89. width: 0;
  90. height: 0;
  91. top: 21px;
  92. position: absolute;
  93. content: ' '
  94. }
  95. .m-content-head-customer {
  96. float: right;
  97. border: 1px white solid;
  98. background: white;
  99. border-radius: 5px;
  100. padding: 10px;
  101. width:fit-content;
  102. }
  103. .m-content-head-customer:after {
  104. border: 15px solid transparent;
  105. border-left: 15px solid white;
  106. top: 21px;
  107. right: -26px;
  108. width: 0;
  109. height: 0;
  110. position: absolute;
  111. content: ' '
  112. }
  113. .m-content-head-s-home{
  114. text-align: left;
  115. padding: 0.5px;
  116. }
  117. .m-content-head-s-customer{
  118. text-align: right;
  119. padding: 0.5px;
  120. }
  121. </style>