index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="contact_container">
  3. <custom-nav-bar>
  4. <view @click="routeBack" class="contact_title" slot="left">
  5. <image class="back_icon" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/common_left_arrow.png" style="width: 12px; height: 20px" alt="" srcset="" />
  6. </view>
  7. <view class="contact_action" slot="more">
  8. <view class="search_icon" @click="toSearch">
  9. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/common_search.png" alt="" srcset="" />
  10. </view>
  11. <!-- <view @click="contactAddClick" class="search_icon">
  12. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/common_add.png" alt="" srcset="" />
  13. </view> -->
  14. </view>
  15. </custom-nav-bar>
  16. <contact-menus />
  17. <orgnization-row v-if="storeSelfInfo.members.length" ref="orgnizationRef" />
  18. </view>
  19. </template>
  20. <script>
  21. import { mapGetters } from "vuex";
  22. import CustomNavBar from "../../../components/CustomNavBar/index.vue";
  23. import ContactMenus from "./components/ContactMenus.vue";
  24. import OrgnizationRow from "./components/OrgnizationRow.vue";
  25. import UserItem from "../../../components/UserItem/index.vue";
  26. export default {
  27. components: {
  28. CustomNavBar,
  29. ContactMenus,
  30. OrgnizationRow,
  31. UserItem
  32. },
  33. data() {
  34. return {
  35. frequentContacts: [],
  36. };
  37. },
  38. onShow() {
  39. this.getFrequentContacts();
  40. this.$nextTick(() => this.$refs.orgnizationRef.getOrganizationData());
  41. },
  42. computed: {
  43. ...mapGetters(["storeSelfInfo"]),
  44. },
  45. methods: {
  46. contactAddClick() {
  47. uni.navigateTo({
  48. url: "/pages_im/pages/contact/contactAdd/index",
  49. });
  50. },
  51. routeBack(){
  52. uni.switchTab({
  53. url: '/pages_im/pages/conversation/conversationList/index'
  54. });
  55. },
  56. getFrequentContacts() {
  57. const tmpData =
  58. uni.getStorageSync(
  59. `${this.$store.getters.storeCurrentUserID}_frequentContacts`,
  60. ) || [];
  61. console.log(tmpData);
  62. this.frequentContacts = [...tmpData].sort((a, b) => b - a);
  63. },
  64. userClick(item) {
  65. uni.navigateTo({
  66. url: `/pages_im/pages/common/userCard/index?sourceID=${item.userID}`,
  67. });
  68. },
  69. toSearch() {
  70. uni.$u.route("/pages_im/pages/common/globalSearch/index");
  71. },
  72. },
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .contact_container {
  77. @include colBox(false);
  78. height: 100vh;
  79. background-color: #f6f6f6;
  80. .contact_title {
  81. padding-left: 0rpx;
  82. font-size: 40rpx;
  83. font-weight: 600;
  84. color: #0c1c33;
  85. }
  86. .back_icon {
  87. padding: 24rpx;
  88. margin-left: 20rpx;
  89. }
  90. .contact_action {
  91. padding-right: 36rpx;
  92. display: flex;
  93. .search_icon {
  94. margin: 0 16rpx;
  95. image {
  96. width: 56rpx;
  97. height: 56rpx;
  98. }
  99. }
  100. }
  101. .list_title {
  102. font-size: 24rpx;
  103. color: #999;
  104. margin-left: 44rpx;
  105. }
  106. .user_list {
  107. flex: 1;
  108. margin-top: 24rpx;
  109. background-color: #fff;
  110. }
  111. }
  112. </style>