group.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view class="tab-page group">
  3. <view class="nav-bar">
  4. <view class="nav-search">
  5. <uni-search-bar v-model="searchText" cancelButton="none" radius="100"
  6. placeholder="点击搜索群聊"></uni-search-bar>
  7. </view>
  8. <view class="nav-add" @click="onCreateNewGroup()">
  9. <uni-icons type="personadd" size="35"></uni-icons>
  10. </view>
  11. </view>
  12. <view class="group-tip" v-if="groupStore.groups.length==0">
  13. 温馨提示:您现在还没有加入任何群聊,点击右上方'+'按钮可以创建群聊哦~
  14. </view>
  15. <view class="group-items" v-else>
  16. <scroll-view class="scroll-bar" scroll-with-animation="true" scroll-y="true">
  17. <view v-for="group in groupStore.groups" :key="group.id">
  18. <group-item v-if="!group.quit&&group.showGroupName.includes(searchText)"
  19. :group="group"></group-item>
  20. </view>
  21. </scroll-view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. searchText: ""
  30. }
  31. },
  32. methods: {
  33. onFocusSearch() {
  34. },
  35. onCreateNewGroup() {
  36. uni.navigateTo({
  37. url: "/pages/group/group-edit"
  38. })
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .group {
  45. position: relative;
  46. display: flex;
  47. flex-direction: column;
  48. .nav-bar {
  49. padding: 2rpx 10rpx;
  50. display: flex;
  51. align-items: center;
  52. background-color: white;
  53. .nav-search {
  54. flex: 1;
  55. }
  56. .nav-add {
  57. cursor: pointer;
  58. }
  59. }
  60. .group-tip {
  61. position: absolute;
  62. top: 400rpx;
  63. padding: 50rpx;
  64. text-align: left;
  65. line-height: 50rpx;
  66. color: darkblue;
  67. font-size: 30rpx;
  68. }
  69. .group-items {
  70. flex: 1;
  71. padding: 0;
  72. overflow: hidden;
  73. position: relative;
  74. .scroll-bar {
  75. height: 100%;
  76. }
  77. }
  78. }
  79. </style>