group.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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-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. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. }
  28. },
  29. methods: {
  30. onFocusSearch() {},
  31. onCreateNewGroup() {
  32. uni.navigateTo({
  33. url: "/pages/group/group-edit"
  34. })
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .group {
  41. position: relative;
  42. border: #dddddd solid 1px;
  43. display: flex;
  44. flex-direction: column;
  45. .nav-bar {
  46. margin: 5rpx;
  47. display: flex;
  48. align-items: center;
  49. background-color: white;
  50. .nav-search {
  51. flex: 1;
  52. }
  53. .nav-add {
  54. line-height: 56px;
  55. cursor: pointer;
  56. }
  57. }
  58. .group-tip{
  59. position: absolute;
  60. top: 400rpx;
  61. padding: 50rpx;
  62. text-align: left;
  63. line-height: 50rpx;
  64. color: darkblue;
  65. font-size: 30rpx;
  66. }
  67. .group-items {
  68. flex: 1;
  69. padding: 0;
  70. border: #dddddd solid 1px;
  71. overflow: hidden;
  72. position: relative;
  73. .scroll-bar {
  74. height: 100%;
  75. }
  76. }
  77. }
  78. </style>