group.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view v-if="$store.state.userStore.userInfo.type == 1" 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-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="group"></group-item>
  18. </view>
  19. </scroll-view>
  20. </view>
  21. </view>
  22. <!-- wx audit -->
  23. <view v-else>
  24. <user-search></user-search>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. }
  32. },
  33. methods: {
  34. onFocusSearch() {},
  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. margin: 5rpx;
  51. display: flex;
  52. align-items: center;
  53. background-color: white;
  54. .nav-search {
  55. flex: 1;
  56. }
  57. .nav-add {
  58. line-height: 56px;
  59. cursor: pointer;
  60. }
  61. }
  62. .group-tip{
  63. position: absolute;
  64. top: 400rpx;
  65. padding: 50rpx;
  66. text-align: left;
  67. line-height: 50rpx;
  68. color: darkblue;
  69. font-size: 30rpx;
  70. }
  71. .group-items {
  72. flex: 1;
  73. padding: 0;
  74. border: #dddddd solid 1px;
  75. overflow: hidden;
  76. position: relative;
  77. .scroll-bar {
  78. height: 100%;
  79. }
  80. }
  81. }
  82. </style>