element.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="element">
  3. <view class="element-header">
  4. <view class="element-title">1号环控</view>
  5. <view class="element-status">
  6. 2024-01-25 16:05:05
  7. <u-icon name="reload" color="#14A478" style="margin-left: 20rpx" />
  8. </view>
  9. </view>
  10. <view class="element-body">
  11. <view class="element-row" v-for="(item, index) in list" :key="index">
  12. <image :src="item.url" class="element-col-icon" />
  13. <view class="element-col">
  14. <view class="element-col-title"
  15. >{{ item.content }}
  16. <text class="unit">{{ item.unit }}</text>
  17. </view>
  18. <view class="element-col-content">{{ item.title }}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. name: 'Element',
  27. data() {
  28. return {
  29. list: [
  30. {
  31. url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/air-humidity.png',
  32. title: '空气温度',
  33. unit: '℃',
  34. content: '12',
  35. },
  36. {
  37. url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/air-temperature.png',
  38. title: '空气湿度',
  39. unit: '%',
  40. content: '80',
  41. },
  42. {
  43. url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/soil-temperature.png',
  44. title: '土壤温度',
  45. unit: '℃',
  46. content: '80',
  47. },
  48. {
  49. url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/soil-humidity.png',
  50. title: '土壤湿度',
  51. unit: '%',
  52. content: '80',
  53. },
  54. {
  55. url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/co2.png',
  56. title: '二氧化碳',
  57. unit: 'ppm',
  58. content: '80',
  59. },
  60. {
  61. url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/illumination.png',
  62. title: '光照',
  63. unit: 'LUX',
  64. content: '80',
  65. },
  66. {
  67. url: 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/zhongshui/ph.png',
  68. title: '土壤PH值',
  69. unit: '',
  70. content: '80',
  71. },
  72. ],
  73. };
  74. },
  75. };
  76. </script>
  77. <style lang="less" scoped>
  78. .element {
  79. .element-header {
  80. display: flex;
  81. justify-content: space-between;
  82. align-items: center;
  83. margin-bottom: 20rpx;
  84. color: #042118;
  85. font-family: 'Source Han Sans CN VF';
  86. font-size: 28rpx;
  87. font-weight: 700;
  88. .element-status {
  89. color: #687a74;
  90. text-align: center;
  91. font-family: 'Source Han Sans CN VF';
  92. font-size: 28rpx;
  93. font-weight: 400;
  94. }
  95. }
  96. .element-body {
  97. display: grid;
  98. grid-template-columns: repeat(2, 1fr);
  99. grid-gap: 20rpx;
  100. padding: 20rpx;
  101. .element-row {
  102. display: flex;
  103. margin-bottom: 20rpx;
  104. .element-col-icon {
  105. width: 100rpx;
  106. height: 100rpx;
  107. margin-right: 10rpx;
  108. }
  109. .element-col {
  110. .element-col-title {
  111. font-size: 28rpx;
  112. color: #042118;
  113. font-weight: 700;
  114. .unit {
  115. font-size: 24rpx;
  116. color: #999;
  117. }
  118. }
  119. .element-col-content {
  120. font-size: 24rpx;
  121. color: #666;
  122. }
  123. }
  124. }
  125. }
  126. }
  127. </style>