index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='电表'></cus-header>
  4. <div class="nums">
  5. <div class="pre">电表:<span class="mr">{{2}}</span></div>
  6. <div class="pre">正常:<span class="zc">{{20}}</span></div>
  7. <div class="pre">离线:<span class="lx">{{1}}</span></div>
  8. </div>
  9. <div class="boxs" v-if="list.length">
  10. <div class="box" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
  11. <div class="name">{{item.name}}</div>
  12. <div class="tip">安装位置<span>{{item.place}}</span></div>
  13. <div class="tip">设备编号<span>{{item.deviceno}}</span></div>
  14. <div class="tip">实时读数<span>{{item.readnum}}</span></div>
  15. <div class="status" :class="item.status==1?'on':(item.status==2?'off':'mr')">
  16. {{item.status==1?'在线':(item.status==2?'离线':'异常')}}
  17. </div>
  18. <div class="btn">
  19. {{item.status==1?'断闸':(item.status==2?'合闸':'异常')}}
  20. </div>
  21. </div>
  22. </div>
  23. <template v-else>
  24. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  25. </template>
  26. </view>
  27. </template>
  28. <script>
  29. import pageEmpty from '@/components/pageEmpty/index.vue'
  30. export default {
  31. components:{
  32. pageEmpty
  33. },
  34. data(){
  35. return {
  36. list:[
  37. {
  38. name:'B座13楼生产车间电表A',
  39. place:'电商园四期B座-13层',
  40. deviceno:'A32445',
  41. readnum:'281kwh',
  42. status:1
  43. },
  44. {
  45. name:'B座13楼生产车间电表B',
  46. place:'电商园四期B座-13层',
  47. deviceno:'A32446',
  48. readnum:'285kwh',
  49. status:2
  50. }
  51. ]
  52. }
  53. },
  54. methods:{
  55. }
  56. }
  57. </script>
  58. <style scoped lang="less">
  59. .page{
  60. padding: 0 24rpx 20rpx;
  61. box-sizing: border-box;
  62. background: #F4F8FB;
  63. .nums{
  64. width: 100%;
  65. background: #FFFFFF;
  66. border-radius: 16rpx;
  67. padding: 37rpx 24rpx;
  68. box-sizing: border-box;
  69. display: flex;
  70. margin-top: 20rpx;
  71. .pre{
  72. width: calc(100% / 3);
  73. font-family: PingFangSC, PingFang SC;
  74. font-weight: 400;
  75. font-size: 30rpx;
  76. color: #4E5969;
  77. line-height: 36rpx;
  78. text-align: left;
  79. span{
  80. font-family: PingFang-SC, PingFang-SC;
  81. font-weight: bold;
  82. font-size: 32rpx;
  83. line-height: 36rpx;
  84. text-align: left;
  85. &.mr{
  86. color: #1D2129;
  87. }
  88. &.zc{
  89. color: #14CC8C;
  90. }
  91. &.lx{
  92. color: #F95050;
  93. }
  94. }
  95. }
  96. }
  97. .boxs{
  98. .box{
  99. background: #FFFFFF;
  100. border-radius: 16rpx;
  101. margin-top: 20rpx;
  102. padding: 36rpx 24rpx;
  103. position: relative;
  104. .name{
  105. font-family: PingFang-SC, PingFang-SC;
  106. font-weight: bold;
  107. font-size: 32rpx;
  108. color: #1D2129;
  109. line-height: 36rpx;
  110. text-align: left;
  111. overflow: hidden;
  112. white-space: nowrap;
  113. text-overflow: ellipsis;
  114. }
  115. .tip{
  116. margin-top: 20rpx;
  117. font-family: PingFangSC, PingFang SC;
  118. font-weight: 400;
  119. font-size: 24rpx;
  120. color: #4E5969;
  121. line-height: 36rpx;
  122. text-align: left;
  123. span{
  124. color: #1D2129;
  125. padding-left: 48rpx;
  126. }
  127. }
  128. .status{
  129. width: 90rpx;
  130. height: 48rpx;
  131. border-radius: 0rpx 16rpx 0rpx 16rpx;
  132. font-family: PingFangSC, PingFang SC;
  133. font-weight: 400;
  134. font-size: 26rpx;
  135. color: #FFFFFF;
  136. line-height: 48rpx;
  137. text-align: center;
  138. position: absolute;
  139. top: 0;
  140. right: 0;
  141. &.on{
  142. background: #14CC8C;
  143. }
  144. &.off{
  145. background: #B9C0C8;
  146. }
  147. &.mr{
  148. background: #666666;
  149. }
  150. }
  151. .btn{
  152. width: 114rpx;
  153. height: 64rpx;
  154. background: #198CFF;
  155. border-radius: 32rpx;
  156. font-family: PingFang-SC, PingFang-SC;
  157. font-weight: bold;
  158. font-size: 28rpx;
  159. color: #FFFFFF;
  160. line-height: 64rpx;
  161. text-align: center;
  162. letter-spacing: 2rpx;
  163. position: absolute;
  164. right: 24rpx;
  165. bottom: 36rpx;
  166. }
  167. }
  168. }
  169. }
  170. </style>