index.uvue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex:1">
  4. <!-- #endif -->
  5. <view class="my-page">
  6. <!-- 轮播图 -->
  7. <swiper class="swiper-box my-swiper" :current="swiperDotIndex" :indicator-dots="true" @change="changeSwiper">
  8. <swiper-item v-for="item in data" >
  9. <view class="swiper-item" @click="clickBannerItem(item)">
  10. <image class="my-image" :src="item.image" mode="aspectFill" />
  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="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. type ImageItem={
  40. image:string
  41. }
  42. type Item={
  43. colorClass:string,
  44. iconType:string,
  45. path:string,
  46. text:string
  47. }
  48. export default {
  49. data() {
  50. return {
  51. items: [
  52. {colorClass: 'blue', iconType: "person-filled", text: "用户管理",path:"" },
  53. {colorClass: 'blue', iconType: "download", text: "数据下载",path:"/pages/work/download/DownloadList" },
  54. {colorClass: 'blue', iconType: "list", text: "任务管理",path:"/pages/work/task/TaskList" },
  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:"/pages/work/process/ProcessList" },
  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.png'
  66. },
  67. {
  68. image: '/static/images/banner/banner02.png'
  69. }
  70. ] as ImageItem[]
  71. }
  72. },
  73. methods: {
  74. clickBannerItem(item:ImageItem) {
  75. console.info(item)
  76. },
  77. changeSwiper(e:UniSwiperChangeEvent) {
  78. this.current = e.detail.current
  79. },
  80. enterItem(e:Item) {
  81. if (e.path != null && e.path != "") {
  82. uni.navigateTo({
  83. url: e.path as string
  84. });
  85. } else {
  86. uni.showToast({
  87. title: '模块建设中~',
  88. icon: 'none'
  89. });
  90. }
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. /* #ifndef APP-NVUE */
  97. .my-page {
  98. display: flex;
  99. flex-direction: column;
  100. box-sizing: border-box;
  101. background-color: #fff;
  102. /* #ifndef APP-ANDROID */
  103. min-height: 100%;
  104. /* #endif */
  105. height: 100%;
  106. }
  107. /* #ifndef APP-ANDROID */
  108. view {
  109. font-size: 14px;
  110. line-height: inherit;
  111. }
  112. /* #endif */
  113. /* #endif */
  114. .text {
  115. text-align: center;
  116. font-size: 26rpx;
  117. margin-top: 10rpx;
  118. }
  119. .swiper {
  120. height: 300rpx;
  121. }
  122. .swiper-box {
  123. height: 150px;
  124. }
  125. .swiper-item {
  126. /* #ifndef APP-NVUE */
  127. display: flex;
  128. /* #endif */
  129. flex-direction: column;
  130. justify-content: center;
  131. align-items: center;
  132. color: #fff;
  133. height: 300rpx;
  134. line-height: 300rpx;
  135. }
  136. @media screen and (min-width: 500px) {
  137. .my-image {
  138. width: 100%;
  139. }
  140. }
  141. .grid-body {
  142. /* #ifndef APP-NVUE */
  143. display: flex;
  144. /* #endif */
  145. flex-wrap: wrap;
  146. justify-content: space-between;
  147. margin-top: 40rpx;
  148. }
  149. .grid-item {
  150. width: 32%;
  151. padding: 18px 15px;
  152. margin-bottom: 40rpx;
  153. border-radius: 20rpx;
  154. box-shadow: 0 8rpx 20rpx rgba(24, 144, 255, 0.15);
  155. display: flex;
  156. flex-direction: column;
  157. .my-icon{
  158. text-align: center;
  159. border-radius: 20rpx;
  160. }
  161. }
  162. .purple {color:#6366f1;}
  163. .blue {color:#2563eb; }
  164. .orange {color:#d97706;}
  165. .green {color:#059669;}
  166. .yellow {color:yellow;}
  167. $uni-primary: #2979ff !default;
  168. .uni-section {
  169. background-color: #fff;
  170. .uni-section-header {
  171. position: relative;
  172. /* #ifndef APP-NVUE */
  173. display: flex;
  174. /* #endif */
  175. flex-direction: row;
  176. align-items: center;
  177. padding: 12px 10px;
  178. font-weight: normal;
  179. &__decoration{
  180. margin-right: 6px;
  181. background-color: $uni-primary;
  182. &.line {
  183. width: 4px;
  184. height: 12px;
  185. border-radius: 10px;
  186. }
  187. &.circle {
  188. width: 8px;
  189. height: 8px;
  190. border-top-right-radius: 50px;
  191. border-top-left-radius: 50px;
  192. border-bottom-left-radius: 50px;
  193. border-bottom-right-radius: 50px;
  194. }
  195. &.square {
  196. width: 8px;
  197. height: 8px;
  198. }
  199. }
  200. &__content {
  201. /* #ifndef APP-NVUE */
  202. display: flex;
  203. /* #endif */
  204. flex-direction: column;
  205. flex: 1;
  206. color: #333;
  207. .distraction {
  208. flex-direction: row;
  209. align-items: center;
  210. }
  211. &-sub {
  212. margin-top: 2px;
  213. }
  214. }
  215. }
  216. }
  217. </style>