group.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="tab-page group">
  3. <view class="nav-bar">
  4. <view class="nav-search">
  5. <uni-search-bar @focus="onFocusSearch" cancelButton="none" placeholder="点击搜索群聊"></uni-search-bar>
  6. </view>
  7. <view class="nav-add" @click="onCreateNewGroup()">
  8. <uni-icons type="personadd" size="30"></uni-icons>
  9. </view>
  10. </view>
  11. <view class="group-items">
  12. <scroll-view class="scroll-bar" scroll-with-animation="true" scroll-y="true">
  13. <view v-for="group in $store.state.groupStore.groups" :key="group.id">
  14. <group-item :group="group"></group-item>
  15. </view>
  16. </scroll-view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. }
  25. },
  26. methods: {
  27. onFocusSearch() {},
  28. onCreateNewGroup() {
  29. uni.navigateTo({
  30. url: "/pages/group/group-edit"
  31. })
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .group {
  38. position: relative;
  39. border: #dddddd solid 1px;
  40. display: flex;
  41. flex-direction: column;
  42. .nav-bar {
  43. margin: 5rpx;
  44. display: flex;
  45. align-items: center;
  46. background-color: white;
  47. .nav-search {
  48. flex: 1;
  49. }
  50. .nav-add {
  51. line-height: 56px;
  52. cursor: pointer;
  53. }
  54. }
  55. .group-items {
  56. flex: 1;
  57. padding: 0;
  58. border: #dddddd solid 1px;
  59. overflow: hidden;
  60. position: relative;
  61. .scroll-bar {
  62. height: 100%;
  63. }
  64. }
  65. }
  66. </style>