index.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <!-- <view class="chat_content" @touchmove.stop.prevent> -->
  3. <view>
  4. <cu-custom bgImage="/static/barBG.png" :isBack="false">
  5. <template v-slot:content>
  6. <text style="letter-spacing: 4rpx;font-style: italic;color:black;font-weight: bold;">群组</text>
  7. </template>
  8. <template v-slot:right>
  9. <text class="cuIcon cuIcon-add text-black" @tap="newGroup"></text>
  10. </template>
  11. </cu-custom>
  12. <!-- <index-bar :indexMap="groupIndexMap" :bottom="true" class="tab-bar-mar"> -->
  13. <view v-for="(item,key) in groupIndexMap.keys()" :key="key">
  14. <view :class="'indexItem-' + item" :id="'indexes-' + item" :data-index="item">
  15. <view class="padding">{{ item }}</view>
  16. <view class="cu-list menu-avatar no-padding">
  17. <view class="cu-item" v-for="(group) in groupIndexMap.get(item)" :key="group.id"
  18. @tap.stop="showGroup(group.id)">
  19. <vim-avatar :img="group.avatar" :name="group.name" />
  20. <view class="content">
  21. <view class="text-black text-jiachu">{{ group.name }}</view>
  22. <view class="text-black text-sm">
  23. {{ group.name }}
  24. </view>
  25. </view>
  26. <view class="action">
  27. <view class="cu-tag round bg-red sm" v-if="waitCheckMap.get(group.id)">{{ waitCheckMap.get(group.id) }}</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view style="height: 150rpx;"></view>
  34. <!-- </index-bar> -->
  35. </view>
  36. </template>
  37. <script setup lang="ts">
  38. import {getCurrentInstance, ref} from "vue";
  39. import {useGroupStore} from "@/store/groupStore";
  40. import CuCustom from '@/colorui/components/cu-custom.vue'
  41. import IndexBar from '@/components/IndexBar.vue'
  42. import {storeToRefs} from "pinia";
  43. import VimAvatar from "@/components/VimAvatar.vue";
  44. const groupStore = useGroupStore();
  45. const {proxy} = getCurrentInstance();
  46. const hidden = ref(true);
  47. const loadGroups = () => {
  48. groupStore.loadGroupList();
  49. groupStore.loadWaitCheckList();
  50. }
  51. const newGroup = () => {
  52. uni.navigateTo({
  53. url: '/pages/group/edit'
  54. })
  55. }
  56. const showGroup = (id: string) => {
  57. uni.navigateTo({
  58. url: '/pages/group/group?id=' + id
  59. })
  60. }
  61. loadGroups();
  62. const {waitCheckMap, groupIndexMap} = storeToRefs(groupStore);
  63. </script>
  64. <style scoped>
  65. .chat_content {
  66. position: fixed;
  67. top: 0;
  68. bottom: 0;
  69. left: 0;
  70. right: 0;
  71. overflow: hidden;
  72. }
  73. </style>