index.uvue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex:1">
  4. <!-- #endif -->
  5. <view class="work-container my-page">
  6. <!-- 轮播图 -->
  7. <swiper class="swiper-box my-swiper" :current="swiperDotIndex" :indicator-dots="true" @change="changeSwiper">
  8. <swiper-item v-for="(item, index) in data" :key="index">
  9. <view class=" swiper-item " @click="clickBannerItem(item)">
  10. <image class="my-image" :src="item.image" mode="aspectFill" :draggable="false" />
  11. </view>
  12. </swiper-item>
  13. </swiper>
  14. <!-- 标题栏 -->
  15. <view class=" uni-section">
  16. <view class=" uni-section-header">
  17. <view class=" uni-section-header__decoration line"/>
  18. <view class=" uni-section-header__content">
  19. <text style="font-size:14px;color:#333" class="uni-section__content-title distraction">系统管理</text>
  20. </view>
  21. </view>
  22. </view>
  23. <!-- 宫格 -->
  24. <view class="grid-body">
  25. <view class="grid uni-row">
  26. <view class="grid-item" v-for="(item, index) in items" :key="index" @click="enterItem(item)" >
  27. <!-- 您的网格项内容 -->
  28. <uni-icons class="my-icon" :type="item.iconType" size="40" :color="item.colorClass" ></uni-icons>
  29. <text class="text">{{ item.text }}</text>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- #ifdef APP -->
  35. </scroll-view>
  36. <!-- #endif -->
  37. </template>
  38. <script lang="uts">
  39. export default {
  40. data() {
  41. type ImageItem={
  42. image:string
  43. }
  44. type Item={
  45. colorClass:string,
  46. iconType:string,
  47. path:string,
  48. text:string
  49. }
  50. return {
  51. items: [
  52. {colorClass: 'blue', iconType: "person-filled", text: "用户管理",path:"" },
  53. {colorClass: 'blue', iconType: "download", text: "数据下载",path:"" },
  54. {colorClass: 'blue', iconType: "list", text: "任务管理",path:"" },
  55. {colorClass: 'orange', iconType: "mic", text: "声像记录", path:"/pages/work/record/RecordList"},
  56. {colorClass: 'orange', iconType: "calendar", text: "检验记录",path:"/pages/work/report/InspectionList" },
  57. {colorClass: 'orange', iconType: "gear-filled", text: "关键工序",path:"" },
  58. {colorClass: 'green', iconType: "folder-add-filled", text: "文档查阅",path:"" },
  59. {colorClass: 'green', iconType: "cloud-upload", text: "数据上传",path:"" },
  60. {colorClass: 'green', iconType: "wallet-filled", text: "日志管理",path:"" }
  61. ] as Item[],
  62. current: 0 as number,
  63. swiperDotIndex: 0 as number,
  64. data: [{
  65. image: '/static/images/banner/banner01.jpg'
  66. },
  67. {
  68. image: '/static/images/banner/banner02.jpg'
  69. },
  70. {
  71. image: '/static/images/banner/banner03.jpg'
  72. }
  73. ] as ImageItem[]
  74. }
  75. },
  76. methods: {
  77. clickBannerItem(item) {
  78. console.info(item)
  79. },
  80. changeSwiper(e) {
  81. this.current = e.detail.current
  82. },
  83. enterItem(e) {
  84. console.log(e)
  85. if (e.path) {
  86. uni.navigateTo({
  87. url: e.path
  88. });
  89. } else {
  90. uni.showToast({
  91. title: '模块建设中~',
  92. icon: 'none'
  93. });
  94. }
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. /* #ifndef APP-NVUE */
  101. .my-page {
  102. display: flex;
  103. flex-direction: column;
  104. box-sizing: border-box;
  105. background-color: #fff;
  106. /* #ifndef APP-ANDROID */
  107. min-height: 100%;
  108. /* #endif */
  109. height: 100%;
  110. }
  111. /* #ifndef APP-ANDROID */
  112. view {
  113. font-size: 14px;
  114. line-height: inherit;
  115. }
  116. /* #endif */
  117. /* #endif */
  118. .text {
  119. text-align: center;
  120. font-size: 26rpx;
  121. margin-top: 10rpx;
  122. }
  123. .swiper {
  124. height: 300rpx;
  125. }
  126. .swiper-box {
  127. height: 150px;
  128. }
  129. .swiper-item {
  130. /* #ifndef APP-NVUE */
  131. display: flex;
  132. /* #endif */
  133. flex-direction: column;
  134. justify-content: center;
  135. align-items: center;
  136. color: #fff;
  137. height: 300rpx;
  138. line-height: 300rpx;
  139. }
  140. @media screen and (min-width: 500px) {
  141. .my-image {
  142. width: 100%;
  143. }
  144. }
  145. .grid-body {
  146. display: flex;
  147. flex-wrap: wrap;
  148. justify-content: space-between;
  149. margin-top: 40rpx;
  150. }
  151. .grid-item {
  152. width: 32%;
  153. padding: 18px 15px;
  154. margin-bottom: 40rpx;
  155. border-radius: 20rpx;
  156. box-shadow: 0 8rpx 20rpx rgba(24, 144, 255, 0.15);
  157. display: flex;
  158. flex-direction: column;
  159. .my-icon{
  160. text-align: center;
  161. border-radius: 20rpx;
  162. }
  163. }
  164. .purple {color:#6366f1;}
  165. .blue {color:#2563eb; }
  166. .orange {color:#d97706;}
  167. .green {color:#059669;}
  168. .yellow {color:yellow;}
  169. $uni-primary: #2979ff !default;
  170. .uni-section {
  171. background-color: #fff;
  172. .uni-section-header {
  173. position: relative;
  174. /* #ifndef APP-NVUE */
  175. display: flex;
  176. /* #endif */
  177. flex-direction: row;
  178. align-items: center;
  179. padding: 12px 10px;
  180. font-weight: normal;
  181. &__decoration{
  182. margin-right: 6px;
  183. background-color: $uni-primary;
  184. &.line {
  185. width: 4px;
  186. height: 12px;
  187. border-radius: 10px;
  188. }
  189. &.circle {
  190. width: 8px;
  191. height: 8px;
  192. border-top-right-radius: 50px;
  193. border-top-left-radius: 50px;
  194. border-bottom-left-radius: 50px;
  195. border-bottom-right-radius: 50px;
  196. }
  197. &.square {
  198. width: 8px;
  199. height: 8px;
  200. }
  201. }
  202. &__content {
  203. /* #ifndef APP-NVUE */
  204. display: flex;
  205. /* #endif */
  206. flex-direction: column;
  207. flex: 1;
  208. color: #333;
  209. .distraction {
  210. flex-direction: row;
  211. align-items: center;
  212. }
  213. &-sub {
  214. margin-top: 2px;
  215. }
  216. }
  217. }
  218. }
  219. </style>