index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="content">
  3. <view v-for="(item, index) in modules" :key="index" @tap="gotoModule(item)">
  4. <view v-if="item.icon" class="module-icon">
  5. <image :src="`/static/${item.icon}`" mode="aspectFit" style="width: 100%; height: 100%;"></image>
  6. </view>
  7. <view v-else class="title module">{{item.title}}</view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. modules: [{
  16. title: '安全生产检查',
  17. icon: 'icon-1.png',
  18. url: '/pages/safePruductInspect/safePruductInspect',
  19. },
  20. {
  21. title: '安全储粮检查',
  22. icon: 'icon-2.png',
  23. url: '/pages/safeStorageInspect/safeStorageInspect',
  24. },
  25. {
  26. title: '储备粮验收检查',
  27. icon: 'icon-3.png',
  28. url: '/pages/storageAcceptanceInspect/storageAcceptanceInspect',
  29. },
  30. {
  31. title: '储备信息统计',
  32. icon: 'icon-4.png',
  33. url: '/pages/storageInfoAnalysis/storageInfoAnalysis',
  34. },
  35. {
  36. title: '粮情查询',
  37. icon: 'icon-5.png',
  38. url: '/pages/grainInfo/grainInfo',
  39. },
  40. {
  41. title: '视频监控',
  42. icon: 'icon-6.png',
  43. url: '',
  44. },
  45. {
  46. title: '查询统计',
  47. icon: 'icon-7.png',
  48. url: '/pages/queryStatistics/index',
  49. },
  50. {
  51. title: '智慧安防',
  52. icon: 'icon-8.png',
  53. url: '/pages/smartSecurity/index',
  54. },
  55. {
  56. title: '智慧消防',
  57. icon: 'icon-9.png',
  58. url: '/pages/fireFighting/index',
  59. },
  60. {
  61. title: '安全预案',
  62. icon: 'icon-10.png',
  63. url: '/pages/safetyPlan/safetyPlan',
  64. },
  65. {
  66. title: '价格监测',
  67. icon: 'icon-11.png',
  68. url: '',
  69. },
  70. {
  71. title: '消防水源管理',
  72. icon: 'icon-12.png',
  73. url: '/pages/fireWaterSource/index',
  74. },
  75. ]
  76. }
  77. },
  78. onLoad() {
  79. },
  80. methods: {
  81. gotoModule(module) {
  82. uni.navigateTo({
  83. url: module.url
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. $module_size: 20vw;
  91. page {
  92. background-color: #f6f6fe;
  93. }
  94. .content {
  95. padding: 20px;
  96. // height: 100%;
  97. display: flex;
  98. justify-content: space-around;
  99. flex-wrap: wrap;
  100. background-color: #f6f6fe;
  101. .module {
  102. min-width: $module_size;
  103. min-height: $module_size;
  104. max-width: $module_size;
  105. max-height: $module_size;
  106. margin: 10px;
  107. background-color: #349ed5;
  108. color: white;
  109. display: flex;
  110. justify-content: center;
  111. align-items: center;
  112. .title {
  113. font-size: 0.8rem;
  114. }
  115. }
  116. .module-icon {
  117. margin: 10px;
  118. height: $module_size;
  119. width: $module_size;
  120. display: flex;
  121. justify-content: center;
  122. align-items: center;
  123. }
  124. }
  125. </style>