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