manage.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="container">
  3. <u-navbar :is-fixed="false" :border-bottom="false" :is-back="false" title="管理"
  4. :background="{ background: '#0BB9C8' }" title-color="#fff">
  5. <image slot="right" src="/static/images/home/message.png" class="message-icon" mode="widthFix"></image>
  6. </u-navbar>
  7. <view class="tab">
  8. <u-tabs :list="list" :is-scroll="false" :current="current" active-color="#14B9C8" inactive-color="#595959"
  9. height="100" @change="change"></u-tabs>
  10. </view>
  11. <swiper id="swiperBox" :style="{ height: swiperHeight + 'px' }" :current="current" @change="tabsChange">
  12. <swiper-item class="swiper-item" v-for="(item, index) in list" :key="index">
  13. <scroll-view scroll-y style="width: 100%;height: 100%;" @scrolltolower="onreachBottom">
  14. <view class="content">
  15. <u-grid :col="3">
  16. <u-grid-item v-for="(_item, _index) in gridList" :key="_index">
  17. <navigator url="" hover-class="none" class="gitem">
  18. <image :src="_item.img" class="img" mode="widthFix"></image>
  19. <view class="name">{{ _item.name }}</view>
  20. </navigator>
  21. </u-grid-item>
  22. </u-grid>
  23. </view>
  24. </scroll-view>
  25. </swiper-item>
  26. </swiper>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. swiperHeight: 0,
  34. list: [{
  35. name: '常用'
  36. },
  37. {
  38. name: '系统'
  39. },
  40. {
  41. name: '部门'
  42. }
  43. ],
  44. current: 0,
  45. gridList: [{
  46. name: '常规',
  47. img: '/static/images/manage/g1.png'
  48. },
  49. {
  50. name: '权限',
  51. img: '/static/images/manage/g2.png'
  52. },
  53. {
  54. name: '角色',
  55. img: '/static/images/manage/g3.png'
  56. },
  57. {
  58. name: '用户',
  59. img: '/static/images/manage/g4.png'
  60. },
  61. {
  62. name: '分类',
  63. img: '/static/images/manage/g5.png'
  64. },
  65. {
  66. name: '公告',
  67. img: '/static/images/manage/g6.png'
  68. }
  69. ]
  70. };
  71. },
  72. onReady() {
  73. let that = this;
  74. uni.getSystemInfo({
  75. success(e) {
  76. console.log(e);
  77. let {
  78. windowWidth,
  79. windowHeight,
  80. safeArea
  81. } = e;
  82. const query = uni.createSelectorQuery().in(that);
  83. query
  84. .select('#swiperBox')
  85. .boundingClientRect(data => {
  86. that.swiperHeight = safeArea.bottom - data.top;
  87. })
  88. .exec();
  89. }
  90. });
  91. },
  92. methods: {
  93. tabsChange(e) {
  94. this.current = e.detail.current;
  95. },
  96. change(index) {
  97. this.current = index;
  98. }
  99. }
  100. };
  101. </script>
  102. <style lang="scss">
  103. .swiper-box {
  104. height: 100vh;
  105. }
  106. .message-icon {
  107. width: 32rpx;
  108. height: auto;
  109. margin-right: 27rpx;
  110. }
  111. .tab {
  112. margin-bottom: 10rpx;
  113. }
  114. .gitem {
  115. display: flex;
  116. align-items: center;
  117. justify-content: center;
  118. flex-direction: column;
  119. .img {
  120. width: 54rpx;
  121. height: auto;
  122. margin-bottom: 26rpx;
  123. }
  124. font-size: 28rpx;
  125. font-family: PingFang SC;
  126. font-weight: bold;
  127. color: #030305;
  128. line-height: 36rpx;
  129. }
  130. </style>