meter.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="meter-index">
  3. <view class="meter-box">
  4. <view class="title">{{title}}</view>
  5. <view class="sub-title">{{space}}</view>
  6. <view class="meter-box-content">
  7. <view class="meter-box-list">
  8. <view class="content-item">
  9. <view class="content-item-title">
  10. <view class="content-item-icon">
  11. <uni-icons type="icon-jinriyongdianliang" custom-prefix="iconfont" size="26"
  12. color="#577ff5">
  13. </uni-icons>
  14. </view>
  15. <view class="label">今日用电量</view>
  16. </view>
  17. <view class="content-item-article">
  18. <text class="number">6.86</text>
  19. <text class="unit">kwh</text>
  20. </view>
  21. </view>
  22. <view class="content-item">
  23. <view class="content-item-title">
  24. <view class="content-item-icon">
  25. <uni-icons type="icon-zongyongdianliang" custom-prefix="iconfont" size="26"
  26. color="#577ff5">
  27. </uni-icons>
  28. </view>
  29. <view class="label">当月用电量</view>
  30. </view>
  31. <view class="content-item-article">
  32. <text class="number">122.23</text>
  33. <text class="unit">kwh</text>
  34. </view>
  35. </view>
  36. <view class="content-item">
  37. <view class="content-item-title">
  38. <view class="content-item-icon">
  39. <uni-icons type="icon-dianchidianliang" custom-prefix="iconfont" size="18"
  40. color="#577ff5">
  41. </uni-icons>
  42. </view>
  43. <view class="label">电池电量</view>
  44. </view>
  45. <view class="content-item-article">
  46. <text class="number">98</text>
  47. <text class="unit">%</text>
  48. </view>
  49. </view>
  50. </view>
  51. <image class="meter-image"
  52. src="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/9819ac743e2e44f58dbd58787bee2848">
  53. </image>
  54. </view>
  55. </view>
  56. <view class="meter-charts">
  57. <view class="meter-chart-title">历史用电量</view>
  58. <view class="meter-chart-box">
  59. <u-echart tips="用电量"></u-echart>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import uEchart from './uEchart.vue'
  66. export default {
  67. props: ['title', 'space'],
  68. data() {
  69. return {
  70. }
  71. },
  72. components: {
  73. uEchart
  74. },
  75. }
  76. </script>
  77. <style lang="scss">
  78. .meter-index {
  79. padding: 30rpx;
  80. .meter-box {
  81. background: #fff;
  82. padding: 30rpx;
  83. border-radius: 16rpx;
  84. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  85. .title {
  86. font-size: 40rpx;
  87. font-weight: 500;
  88. }
  89. .sub-title {
  90. font-size: 24rpx;
  91. color: $uni-secondary-color;
  92. font-weight: 200;
  93. }
  94. .meter-box-content {
  95. display: flex;
  96. align-items: center;
  97. padding: 80rpx 0 40rpx 0;
  98. }
  99. .meter-box-list {
  100. flex: 1;
  101. width: 0;
  102. overflow: hidden;
  103. }
  104. .content-item {
  105. margin-bottom: 20rpx;
  106. }
  107. .content-item-title {
  108. display: flex;
  109. align-items: center;
  110. .content-item-icon {
  111. width: 60rpx;
  112. height: 60rpx;
  113. text-align: center;
  114. line-height: 60rpx;
  115. }
  116. .label {
  117. font-size: 24rpx;
  118. font-weight: 300;
  119. margin-left: 10rpx;
  120. }
  121. }
  122. .content-item-article {
  123. display: flex;
  124. align-items: flex-end;
  125. padding-left: 70rpx;
  126. padding-top: 10rpx;
  127. .number {
  128. font-size: 40rpx;
  129. line-height: 40rpx;
  130. }
  131. .unit {
  132. color: $uni-secondary-color;
  133. margin-left: 8rpx;
  134. font-size: 24rpx;
  135. }
  136. }
  137. .meter-image {
  138. width: 200rpx;
  139. height: 200rpx;
  140. margin-right: 40rpx;
  141. }
  142. }
  143. .meter-charts {
  144. margin-top: 30rpx;
  145. background: #fff;
  146. padding: 30rpx;
  147. border-radius: 16rpx;
  148. box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
  149. .meter-chart-title {
  150. padding-bottom: 30rpx;
  151. font-size: 32rpx;
  152. font-weight: 500;
  153. }
  154. .meter-chart-box {
  155. width: 100%;
  156. height: 300rpx;
  157. }
  158. }
  159. }
  160. </style>