index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="roomIndex">
  3. <uni-menubar title="聊天室" />
  4. <tm-translate animation-name="fadeDown">
  5. <tm-listitem :left-icon-size="100" url="/pages/room/sysnotice" dense :value="sysnotice_count" title="系统通知"
  6. left-icon="fa-volume-down" show-left-icon>
  7. <template #rightValue>
  8. <text class="text-red text-weight-b text-size-n">{{sysnotice_count}}</text>
  9. </template>
  10. </tm-listitem>
  11. <view class="cu-list menu-avatar">
  12. <block v-for="(item,index) in chatList" :key="index">
  13. <view class="cu-item" @click="chatClick(item.uid,item.user.nickname,item.t_card_id)" >
  14. <view class="cu-avatar round lg">
  15. <tm-images :src="item.user.avatar"></tm-images>
  16. </view>
  17. <view class="content">
  18. <view class="text-black">{{item.user.nickname}}</view>
  19. <view class="text-gray text-sm flex">
  20. <view class="text-cut">
  21. {{item.label}}
  22. </view>
  23. </view>
  24. </view>
  25. <view class="action">
  26. <view class="text-grey text-xs">{{item.update_time}}</view>
  27. <view class="cu-tag round bg-red sm">{{item.msg_count}}</view>
  28. </view>
  29. </view>
  30. </block>
  31. </view>
  32. </tm-translate>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. sysnotice_count: 0,
  40. value: "",
  41. selected: [{
  42. title: "全部名片"
  43. }],
  44. list: [{
  45. title: "全部名片"
  46. },
  47. {
  48. title: "选项1"
  49. },
  50. {
  51. title: "选项1"
  52. },
  53. {
  54. title: "选项1"
  55. },
  56. {
  57. title: "选项1"
  58. },
  59. ],
  60. iconList: [{
  61. icon: 'icon-commentdots-fill',
  62. color: 'bg-gradient-orange-accent'
  63. },
  64. {
  65. icon: 'icon-paperplane-fill',
  66. color: 'bg-gradient-green-accent'
  67. },
  68. {
  69. icon: 'icon-tag-fill',
  70. color: 'bg-gradient-blue-accent'
  71. }
  72. ],
  73. item_1: [{
  74. text: "删除",
  75. width: 110,
  76. color: 'red'
  77. }, ],
  78. chatList: []
  79. }
  80. },
  81. computed: {
  82. userInfo() {
  83. return this.$tm.vx.state().user.userInfo || {}
  84. }
  85. },
  86. onLoad() {
  87. this.$tm.request.post('chat/roomlist', {
  88. page: 1
  89. }).then(res => {
  90. this.chatList = res.data.data
  91. this.sysnotice_count = res.data.sysnotice_count
  92. })
  93. },
  94. methods: {
  95. chatClick(id, name, card_id) {
  96. uni.navigateTo({
  97. url: "/subpages/pages/card/cardChat?t_uid=" + id + '&name=' + name + '&card_id=' + card_id
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style scoped lang="scss">
  104. </style>