index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view>
  3. <view style="position: fixed;z-index: 100;">
  4. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="防治系统" right-icon="search" size="16"></uni-nav-bar>
  5. </view>
  6. <image src="../../static/image/prevention/1.png" mode="" class="image"></image>
  7. <view class="prevents">
  8. <view class="prevents_item" v-for="item,index in eqlistdata" :key="index">
  9. <image :src="item.device_status==1?'../../static/image/prevention/6.png':'../../static/image/prevention/7.png'" mode="" class="prevents_item_img"></image>
  10. <view class="prevents_item_top">
  11. <p>设备 ID:{{item.device_id}}</p>
  12. <p :class="item.device_status==1?'green':'red'" v-text="item.device_status==1?'在线':'离线'"></p>
  13. </view>
  14. <view class="prevents_item_bot">
  15. 最新上报时间:{{item.status_time|timeFormat()}}
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. page:1,
  26. size:10,
  27. eqlistdata:[]
  28. }
  29. },
  30. methods: {
  31. async eqlist() { //设备列表
  32. const res = await this.$myRequest({
  33. url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
  34. data: {
  35. device_type_id: 2,
  36. page:this.page,
  37. size:this.size,
  38. }
  39. })
  40. this.eqlistdata=this.eqlistdata.concat(res.data)
  41. console.log(this.eqlistdata)
  42. },
  43. clickLeft(){
  44. uni.switchTab({
  45. url:"../index/index"
  46. })
  47. }
  48. },
  49. onLoad(){
  50. this.eqlist()
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. /deep/.uni-icons{
  56. font-size: 40rpx !important;
  57. }
  58. .image{
  59. position: fixed;
  60. top: 44px;
  61. width: 100%;
  62. height: 140rpx;
  63. z-index: 555;
  64. }
  65. .prevents{
  66. width: 100%;
  67. position: absolute;
  68. top: 244rpx;
  69. .prevents_item{
  70. width: 95%;
  71. margin: 0 auto 30rpx;
  72. border-radius: 10rpx;
  73. box-shadow: 0 0 10rpx #bcb9ca;
  74. padding: 20rpx 40rpx 20rpx 80rpx;
  75. position: relative;
  76. .prevents_item_img{
  77. width: 30rpx;
  78. height: 50rpx;
  79. position: absolute;
  80. top: -4rpx;
  81. left: 30rpx;
  82. }
  83. .prevents_item_top{
  84. display: flex;
  85. justify-content: space-between;
  86. height: 60rpx;
  87. border-bottom: 2rpx solid #F4F4F4;
  88. line-height: 60rpx;
  89. font-size: 26rpx;
  90. .red{
  91. color: #ff0000;
  92. }
  93. .green{
  94. color: #7DBB91;
  95. }
  96. }
  97. .prevents_item_bot{
  98. margin-top: 20rpx;
  99. font-size: 26rpx;
  100. color: #BDBDBD;
  101. }
  102. }
  103. }
  104. </style>