index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="work-container">
  3. <!-- 轮播图 -->
  4. <uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
  5. <swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
  6. <swiper-item v-for="(item, index) in data" :key="index">
  7. <view class="swiper-item" @click="clickBannerItem(item)">
  8. <image :src="item.image" mode="aspectFill" :draggable="false" />
  9. </view>
  10. </swiper-item>
  11. </swiper>
  12. </uni-swiper-dot>
  13. <!-- 宫格组件 -->
  14. <uni-section title="系统管理" type="line"></uni-section>
  15. <view class="grid-body">
  16. <uni-grid :column="4" :showBorder="false" @change="changeGrid">
  17. <uni-grid-item>
  18. <view class="grid-item-box">
  19. <uni-icons type="person-filled" size="30"></uni-icons>
  20. <text class="text">用户管理</text>
  21. </view>
  22. </uni-grid-item>
  23. <uni-grid-item>
  24. <view class="grid-item-box">
  25. <uni-icons type="staff-filled" size="30"></uni-icons>
  26. <text class="text">角色管理</text>
  27. </view>
  28. </uni-grid-item>
  29. <uni-grid-item>
  30. <view class="grid-item-box">
  31. <uni-icons type="color" size="30"></uni-icons>
  32. <text class="text">菜单管理</text>
  33. </view>
  34. </uni-grid-item>
  35. <uni-grid-item>
  36. <view class="grid-item-box">
  37. <uni-icons type="settings-filled" size="30"></uni-icons>
  38. <text class="text">部门管理</text>
  39. </view>
  40. </uni-grid-item>
  41. <uni-grid-item>
  42. <view class="grid-item-box">
  43. <uni-icons type="heart-filled" size="30"></uni-icons>
  44. <text class="text">岗位管理</text>
  45. </view>
  46. </uni-grid-item>
  47. <uni-grid-item>
  48. <view class="grid-item-box">
  49. <uni-icons type="bars" size="30"></uni-icons>
  50. <text class="text">字典管理</text>
  51. </view>
  52. </uni-grid-item>
  53. <uni-grid-item>
  54. <view class="grid-item-box">
  55. <uni-icons type="gear-filled" size="30"></uni-icons>
  56. <text class="text">参数设置</text>
  57. </view>
  58. </uni-grid-item>
  59. <uni-grid-item>
  60. <view class="grid-item-box">
  61. <uni-icons type="chat-filled" size="30"></uni-icons>
  62. <text class="text">通知公告</text>
  63. </view>
  64. </uni-grid-item>
  65. <uni-grid-item>
  66. <view class="grid-item-box">
  67. <uni-icons type="wallet-filled" size="30"></uni-icons>
  68. <text class="text">日志管理</text>
  69. </view>
  70. </uni-grid-item>
  71. </uni-grid>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. current: 0,
  80. swiperDotIndex: 0,
  81. data: [{
  82. image: '/static/images/banner/banner01.jpg'
  83. },
  84. {
  85. image: '/static/images/banner/banner02.jpg'
  86. },
  87. {
  88. image: '/static/images/banner/banner03.jpg'
  89. }
  90. ]
  91. }
  92. },
  93. methods: {
  94. clickBannerItem(item) {
  95. console.info(item)
  96. },
  97. changeSwiper(e) {
  98. this.current = e.detail.current
  99. },
  100. changeGrid(e) {
  101. this.$modal.showToast('模块建设中~')
  102. }
  103. }
  104. }
  105. </script>
  106. <style lang="scss">
  107. /* #ifndef APP-NVUE */
  108. page {
  109. display: flex;
  110. flex-direction: column;
  111. box-sizing: border-box;
  112. background-color: #fff;
  113. min-height: 100%;
  114. height: auto;
  115. }
  116. view {
  117. font-size: 14px;
  118. line-height: inherit;
  119. }
  120. /* #endif */
  121. .text {
  122. text-align: center;
  123. font-size: 26rpx;
  124. margin-top: 10rpx;
  125. }
  126. .grid-item-box {
  127. flex: 1;
  128. /* #ifndef APP-NVUE */
  129. display: flex;
  130. /* #endif */
  131. flex-direction: column;
  132. align-items: center;
  133. justify-content: center;
  134. padding: 15px 0;
  135. }
  136. .uni-margin-wrap {
  137. width: 690rpx;
  138. width: 100%;
  139. ;
  140. }
  141. .swiper {
  142. height: 300rpx;
  143. }
  144. .swiper-box {
  145. height: 150px;
  146. }
  147. .swiper-item {
  148. /* #ifndef APP-NVUE */
  149. display: flex;
  150. /* #endif */
  151. flex-direction: column;
  152. justify-content: center;
  153. align-items: center;
  154. color: #fff;
  155. height: 300rpx;
  156. line-height: 300rpx;
  157. }
  158. @media screen and (min-width: 500px) {
  159. .uni-swiper-dot-box {
  160. width: 400px;
  161. /* #ifndef APP-NVUE */
  162. margin: 0 auto;
  163. /* #endif */
  164. margin-top: 8px;
  165. }
  166. .image {
  167. width: 100%;
  168. }
  169. }
  170. </style>