group.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. border: #dddddd solid 1px;
  47. display: flex;
  48. flex-direction: column;
  49. .nav-bar {
  50. padding: 2rpx 10rpx;
  51. display: flex;
  52. align-items: center;
  53. background-color: white;
  54. .nav-search {
  55. flex: 1;
  56. }
  57. .nav-add {
  58. cursor: pointer;
  59. }
  60. }
  61. .group-tip {
  62. position: absolute;
  63. top: 400rpx;
  64. padding: 50rpx;
  65. text-align: left;
  66. line-height: 50rpx;
  67. color: darkblue;
  68. font-size: 30rpx;
  69. }
  70. .group-items {
  71. flex: 1;
  72. padding: 0;
  73. border: #dddddd solid 1px;
  74. overflow: hidden;
  75. position: relative;
  76. .scroll-bar {
  77. height: 100%;
  78. }
  79. }
  80. }
  81. </style>