manage.vue 3.4 KB

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