electricityConsumptionDetail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view>
  3. <u-navbar title="用电量明细 (度)" title-color="#101010"></u-navbar>
  4. <view class="dropdown">
  5. <view class="dropdown-item" @click="show1=true">
  6. <view class="text">
  7. {{electricMeter}}
  8. </view>
  9. <view class="item-icon">
  10. <u-icon name="arrow-down" color="#999999" v-if="show1==false"></u-icon>
  11. <u-icon name="arrow-up" color="#999999" v-else></u-icon>
  12. </view>
  13. </view>
  14. <view class="dropdown-item" @click="show2=true">
  15. <view class="text">
  16. {{month}}
  17. </view>
  18. <view class="icon">
  19. <u-icon name="arrow-down" color="#999999" v-if="show2==false"></u-icon>
  20. <u-icon name="arrow-up" color="#999999" v-else></u-icon>
  21. </view>
  22. </view>
  23. </view>
  24. <u-select v-model="show1" mode="single-column" :list="electricMeterList"></u-select>
  25. <u-select v-model="show2" mode="single-column" :list="monthList"></u-select>
  26. <view class="table-box">
  27. <table class="table1">
  28. <tr class="tr1">
  29. <td class="td1"></td>
  30. <td class="td2">起止码</td>
  31. <td class="td3">度数</td>
  32. </tr>
  33. <tr v-for="(item,i) in list" :key="i">
  34. <td class="td1">{{item.name}}</td>
  35. <td class="td2">
  36. {{item.startStop}}
  37. </td>
  38. <td class="td3">{{item.degrees}}度</td>
  39. </tr>
  40. <tr>
  41. <td class="td1" colspan="2">二级表合计用电</td>
  42. <td>60度</td>
  43. </tr>
  44. <tr style="font-weight: bold;">
  45. <td class="td1" colspan="2">扣除后用电量</td>
  46. <td>1.53度</td>
  47. </tr>
  48. </table>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. export default {
  54. data() {
  55. return {
  56. electricMeter: '11楼公摊电表',
  57. month: '上月',
  58. show1: false,
  59. show2: false,
  60. electricMeterList: [],
  61. monthList: [],
  62. list: [{
  63. name: '11楼公摊电表',
  64. startStop: '100-161.53',
  65. degrees: 61.53
  66. },
  67. {
  68. name: '二级表a',
  69. startStop: '0-10',
  70. degrees: 10
  71. },
  72. {
  73. name: '二级表b',
  74. startStop: '0-10',
  75. degrees: 10
  76. },
  77. {
  78. name: '二级表c',
  79. startStop: '0-10',
  80. degrees: 10
  81. },
  82. {
  83. name: '二级表d',
  84. startStop: '0-10',
  85. degrees: 10
  86. },
  87. {
  88. name: '二级表e',
  89. startStop: '0-10',
  90. degrees: 10
  91. },
  92. {
  93. name: '二级表f',
  94. startStop: '0-10',
  95. degrees: 10
  96. },
  97. ],
  98. }
  99. },
  100. methods: {
  101. }
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. page {
  106. background-color: #fff;
  107. }
  108. .dropdown {
  109. background-color: #fff;
  110. position: sticky;
  111. top: 88rpx;
  112. z-index: 999;
  113. padding: 18rpx 46rpx;
  114. display: flex;
  115. border-bottom: 1px solid rgba(245, 245, 245, 1);
  116. .dropdown-item {
  117. width: 50%;
  118. text-align: center;
  119. height: 60rpx;
  120. line-height: 60rpx;
  121. display: flex;
  122. align-items: center;
  123. justify-content: center;
  124. .text {
  125. max-width: 80%;
  126. white-space: nowrap;
  127. overflow: hidden;
  128. text-overflow: ellipsis;
  129. }
  130. }
  131. }
  132. .table-box {
  133. padding: 24rpx 32rpx;
  134. }
  135. .table1 {
  136. padding-bottom: 20rpx;
  137. width: 100%;
  138. border-collapse: collapse;
  139. td {
  140. border: 1px solid #e7e7e7;
  141. text-align: end;
  142. padding: 2px 8px;
  143. height: 60rpx;
  144. }
  145. .td1 {
  146. text-align: start;
  147. width: 264rpx;
  148. }
  149. .td2 {
  150. width: 240rpx;
  151. }
  152. .td3 {
  153. width: 180rpx;
  154. white-space: pre;
  155. }
  156. tr {
  157. background-color: #f5f5f6
  158. }
  159. .tr1 {
  160. text-align: end;
  161. font-weight: bold;
  162. }
  163. tr:nth-child(even) {
  164. background-color: #fff;
  165. }
  166. }
  167. </style>