reservoirFunc.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <!-- 水库功能区 -->
  3. <view class="reservoir-func-box">
  4. <view class="reservoir-func-item" v-for="(item,index) in reserviorFuncList" :key="index" :style="{'background-color': bgcList[item.bgc]}" @tap="handleClick(item)">
  5. <view class="left">
  6. <view class="title">
  7. {{item.title}}
  8. </view>
  9. <view class="btn">
  10. 查看 >
  11. </view>
  12. </view>
  13. <view class="right">
  14. <uni-badge :is-dot="true" :text="news[item.icon]" absolute="rightTop" :offset="[10, -5]">
  15. <image style="width: 80rpx; height: 80rpx" :src="`/static/images/index/${item.icon}.svg`" mode="scaleToFill"></image>
  16. </uni-badge>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script setup>
  22. import {
  23. reactive
  24. } from 'vue';
  25. const bgcList = ['#F7F9FD', '#FFF9EE']
  26. const reserviorFuncList = [{
  27. title: "调配计划",
  28. icon: "plan",
  29. page: 'Deploy',
  30. bgc: 0
  31. },
  32. {
  33. title: "调度指令",
  34. icon: "command",
  35. page: 'Deploy',
  36. bgc: 0
  37. },
  38. {
  39. title: "水库水情",
  40. icon: "reservoir",
  41. page: 'Reservoir',
  42. bgc: 0
  43. },
  44. {
  45. title: "引水日志",
  46. icon: "log",
  47. page: 'WaterLog',
  48. bgc: 0
  49. },
  50. {
  51. title: "渠道水情",
  52. icon: "ditch",
  53. page: 'Ditch',
  54. bgc: 0
  55. },
  56. {
  57. title: "供水分析",
  58. icon: "analyse",
  59. page: 'Analyse',
  60. bgc: 1
  61. },
  62. {
  63. title: "灌溉进度",
  64. icon: "progress",
  65. page: 'Progress',
  66. bgc: 1
  67. }
  68. ]
  69. const news = reactive({
  70. plan: 0,
  71. command: 0,
  72. reservoir: 10,
  73. log: 0,
  74. ditch: 0,
  75. analyse: 0,
  76. process: 0
  77. })
  78. const handleClick = (item) => {
  79. uni.navigateTo({
  80. url:`/pages/index/pages/${item.page}/index`
  81. })
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .reservoir-func-box {
  86. padding: 40rpx 32rpx;
  87. display: flex;
  88. flex-wrap: wrap;
  89. justify-content: space-between;
  90. border-radius: 24rpx;
  91. background: #FFFFFF;
  92. .reservoir-func-item{
  93. width: 306rpx;
  94. height: 130rpx;
  95. border-radius: 20rpx;
  96. display: flex;
  97. align-items: center;
  98. justify-content: space-between;
  99. margin-bottom: 40rpx;
  100. &:nth-last-of-type(-n+2){
  101. margin-bottom: 0;
  102. }
  103. .left{
  104. margin-left: 20rpx;
  105. .title{
  106. font-family: Source Han Sans;
  107. font-size: 36rpx;
  108. font-weight: 500;
  109. font-feature-settings: "kern" on;
  110. color: $uni-text-color;
  111. }
  112. .btn{
  113. font-family: Source Han Sans;
  114. font-size: 30rpx;
  115. font-feature-settings: "kern" on;
  116. color: $uni-text-color-grey;
  117. }
  118. }
  119. .right{
  120. margin-top: 20rpx;
  121. width: 80rpx;
  122. height: 80rpx;
  123. }
  124. }
  125. }
  126. </style>