index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 - '+(mt+65)+'px)'" marginTop="65px"></page-empty>
  25. </template>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data(){
  31. return {
  32. list:[
  33. {
  34. name:'B座13楼生产车间电表A',
  35. place:'电商园四期B座-13层',
  36. deviceno:'A32445',
  37. readnum:'281kwh',
  38. status:1
  39. },
  40. {
  41. name:'B座13楼生产车间电表B',
  42. place:'电商园四期B座-13层',
  43. deviceno:'A32446',
  44. readnum:'285kwh',
  45. status:2
  46. }
  47. ]
  48. }
  49. },
  50. methods:{
  51. }
  52. }
  53. </script>
  54. <style scoped lang="less">
  55. .page{
  56. padding: 0 24rpx 20rpx;
  57. box-sizing: border-box;
  58. background: #F4F8FB;
  59. .nums{
  60. width: 100%;
  61. background: #FFFFFF;
  62. border-radius: 16rpx;
  63. padding: 37rpx 24rpx;
  64. box-sizing: border-box;
  65. display: flex;
  66. margin-top: 20rpx;
  67. .pre{
  68. width: calc(100% / 3);
  69. font-family: PingFangSC, PingFang SC;
  70. font-weight: 400;
  71. font-size: 30rpx;
  72. color: #4E5969;
  73. line-height: 36rpx;
  74. text-align: left;
  75. span{
  76. font-family: PingFang-SC, PingFang-SC;
  77. font-weight: bold;
  78. font-size: 32rpx;
  79. line-height: 36rpx;
  80. text-align: left;
  81. &.mr{
  82. color: #1D2129;
  83. }
  84. &.zc{
  85. color: #14CC8C;
  86. }
  87. &.lx{
  88. color: #F95050;
  89. }
  90. }
  91. }
  92. }
  93. .boxs{
  94. .box{
  95. background: #FFFFFF;
  96. border-radius: 16rpx;
  97. margin-top: 20rpx;
  98. padding: 36rpx 24rpx;
  99. position: relative;
  100. .name{
  101. font-family: PingFang-SC, PingFang-SC;
  102. font-weight: bold;
  103. font-size: 32rpx;
  104. color: #1D2129;
  105. line-height: 36rpx;
  106. text-align: left;
  107. overflow: hidden;
  108. white-space: nowrap;
  109. text-overflow: ellipsis;
  110. }
  111. .tip{
  112. margin-top: 20rpx;
  113. font-family: PingFangSC, PingFang SC;
  114. font-weight: 400;
  115. font-size: 24rpx;
  116. color: #4E5969;
  117. line-height: 36rpx;
  118. text-align: left;
  119. span{
  120. color: #1D2129;
  121. padding-left: 48rpx;
  122. }
  123. }
  124. .status{
  125. width: 90rpx;
  126. height: 48rpx;
  127. border-radius: 0rpx 16rpx 0rpx 16rpx;
  128. font-family: PingFangSC, PingFang SC;
  129. font-weight: 400;
  130. font-size: 26rpx;
  131. color: #FFFFFF;
  132. line-height: 48rpx;
  133. text-align: center;
  134. position: absolute;
  135. top: 0;
  136. right: 0;
  137. &.on{
  138. background: #14CC8C;
  139. }
  140. &.off{
  141. background: #B9C0C8;
  142. }
  143. &.mr{
  144. background: #666666;
  145. }
  146. }
  147. .btn{
  148. width: 114rpx;
  149. height: 64rpx;
  150. background: #198CFF;
  151. border-radius: 32rpx;
  152. font-family: PingFang-SC, PingFang-SC;
  153. font-weight: bold;
  154. font-size: 28rpx;
  155. color: #FFFFFF;
  156. line-height: 64rpx;
  157. text-align: center;
  158. letter-spacing: 2rpx;
  159. position: absolute;
  160. right: 24rpx;
  161. bottom: 36rpx;
  162. }
  163. }
  164. }
  165. }
  166. </style>