ComprehensivePanel.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view class="comprehensive_container">
  3. <view v-show="data.contacts.length > 0" class="comprehensive_row">
  4. <view class="row_title">
  5. <text class="row_title_text">联系人</text>
  6. </view>
  7. <global-result-item
  8. v-for="user in data.contacts.slice(0, 2)"
  9. :item="user"
  10. :key="user.userID"
  11. />
  12. <view
  13. v-show="data.contacts.length > 2"
  14. @click="toggleTab(1)"
  15. class="more"
  16. >
  17. <text>查看更多相关联系人</text>
  18. <view class="more_right">
  19. <u-icon name="arrow-right" color="#999" size="18" />
  20. </view>
  21. </view>
  22. </view>
  23. <view v-show="data.groups.length > 0" class="comprehensive_row">
  24. <view class="row_title">
  25. <text class="row_title_text">群组</text>
  26. </view>
  27. <global-result-item
  28. v-for="group in data.groups.slice(0, 2)"
  29. :item="group"
  30. :key="group.groupID"
  31. />
  32. <view v-show="data.groups.length > 2" @click="toggleTab(2)" class="more">
  33. <text>查看更多相关群组</text>
  34. <view class="more_right">
  35. <u-icon name="arrow-right" color="#999" size="18" />
  36. </view>
  37. </view>
  38. </view>
  39. <view v-show="data.chatLogs.length > 0" class="comprehensive_row">
  40. <view class="row_title">
  41. <text class="row_title_text">聊天记录</text>
  42. </view>
  43. <global-result-item
  44. v-for="logs in data.chatLogs.slice(0, 2)"
  45. :item="logs"
  46. :key="logs.conversationID"
  47. />
  48. <view
  49. v-show="data.chatLogs.length > 2"
  50. @click="toggleTab(3)"
  51. class="more"
  52. >
  53. <text>查看更多相关聊天记录</text>
  54. <view class="more_right">
  55. <u-icon name="arrow-right" color="#999" size="18" />
  56. </view>
  57. </view>
  58. </view>
  59. <view v-show="data.documents.length > 0" class="comprehensive_row">
  60. <view class="row_title">
  61. <text class="row_title_text">文件</text>
  62. </view>
  63. <global-result-item
  64. v-for="document in data.documents.slice(0, 2)"
  65. :item="document"
  66. :key="document.clientMsgID"
  67. isFile
  68. />
  69. </view>
  70. <view v-show="data.documents.length > 2" @click="toggleTab(4)" class="more">
  71. <text>查看更多相关文档</text>
  72. <view class="more_right">
  73. <u-icon name="arrow-right" color="#999" size="18" />
  74. </view>
  75. </view>
  76. <view v-show="data.org.length > 0" class="comprehensive_row">
  77. <view class="row_title">
  78. <text class="row_title_text">组织成员</text>
  79. </view>
  80. <global-result-item
  81. v-for="user in data.org.slice(0, 2)"
  82. :item="user"
  83. :key="user.userID"
  84. />
  85. <view
  86. v-show="storeSelfInfo.members.length && data.org.length > 2"
  87. @click="toggleTab(5)"
  88. class="more"
  89. >
  90. <text>查看更多组织成员</text>
  91. <view class="more_right">
  92. <u-icon name="arrow-right" color="#999" size="18" />
  93. </view>
  94. </view>
  95. </view>
  96. <u-empty
  97. icon="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/global_search_empty.png"
  98. v-show="isEmpty"
  99. text="没有更多搜索结果"
  100. />
  101. </view>
  102. </template>
  103. <script>
  104. import { mapGetters } from "vuex";
  105. import GlobalResultItem from "./GlobalResultItem.vue";
  106. export default {
  107. components: {
  108. GlobalResultItem,
  109. },
  110. props: {
  111. data: Object,
  112. },
  113. data() {
  114. return {};
  115. },
  116. computed: {
  117. ...mapGetters(["storeSelfInfo"]),
  118. isEmpty() {
  119. return (
  120. Object.values(this.data).find((item) => item.length > 0) === undefined
  121. );
  122. },
  123. },
  124. methods: {
  125. toggleTab(tab) {
  126. this.$emit("toggleTab", {
  127. index: tab,
  128. });
  129. },
  130. },
  131. };
  132. </script>
  133. <style lang="scss">
  134. .comprehensive_container {
  135. flex: 1;
  136. overflow-y: auto;
  137. .comprehensive_row {
  138. margin: 24rpx;
  139. background-color: #fff;
  140. border-radius: 6px;
  141. overflow: hidden;
  142. .row_title {
  143. display: flex;
  144. justify-content: space-between;
  145. padding: 24rpx 36rpx 0;
  146. font-size: 24rpx;
  147. &_text {
  148. color: $u-tips-color;
  149. }
  150. // .more {
  151. // color: #1B72EC;
  152. // }
  153. }
  154. .more {
  155. @include btwBox();
  156. padding: 20rpx 36rpx 20rpx;
  157. border-top: 1px solid rgba(153, 153, 153, 0.2);
  158. color: $uni-color-primary;
  159. .more_right {
  160. @include vCenterBox();
  161. }
  162. }
  163. }
  164. .u-empty {
  165. margin-top: 20vh !important;
  166. }
  167. }
  168. </style>