card.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view class="">
  3. <view class="data" v-for="(item, index) in list" :key="index">
  4. <view class="top">
  5. <view class="left">
  6. <view class="title">
  7. <text>IEMI:{{item.imei}}</text>
  8. <text @click.stop="copy(item.imei)" style="text-decoration: underline;" class="text-blue padding-left-20">复制</text>
  9. </view>
  10. </view>
  11. <view class="right">
  12. <view v-if="item.defenseStatus==1" class="radius sm cu-btn line-green">
  13. 已上线
  14. </view>
  15. <view v-if="item.defenseStatus==2" class="radius sm cu-btn line-red">
  16. 已下线
  17. </view>
  18. </view>
  19. </view>
  20. <view class="item">
  21. <view class="left">
  22. <view style="padding: 0 30rpx;">
  23. <view class="content flex">
  24. <u-icon size="36" name="http://139.9.103.171:1888/miniofile/xlyq/xiaofangshuang.png"></u-icon>
  25. <text class="text-bold padding-left-10">设备名称:</text>
  26. <text>{{item.deviceName}}</text>
  27. </view>
  28. <view class="content flex">
  29. <view class="flex">
  30. <u-icon size="36" name="http://139.9.103.171:1888/miniofile/xlyq/dianchi.png"></u-icon>
  31. <text class="text-bold padding-left-10">电池电量:</text>
  32. </view>
  33. <view class="striped active cu-progress round margin-top-sm " style="width: 60%;">
  34. <view :style="[{ width:loading?item.battery+'%':''}]" style="background-color: #16c60c;color: #FFFFFF;">
  35. {{item.battery?item.battery:0}}%
  36. </view>
  37. </view>
  38. </view>
  39. <view class="content flex">
  40. <view class="flex">
  41. <u-icon size="36" name="http://139.9.103.171:1888/miniofile/xlyq/wifi.png"></u-icon>
  42. <text class="text-bold padding-left-10">信号强弱:</text>
  43. </view>
  44. <view class="striped active cu-progress round margin-top-sm " style="width: 60%;">
  45. <view :style="[{ width:loading?item.signalIntensity+'%':''}]" style="background-color: #fc5f44;color: #FFFFFF;">
  46. {{item.signalIntensity?item.signalIntensity:0}}%
  47. </view>
  48. </view>
  49. </view>
  50. <view class="content flex">
  51. <u-icon size="36" name="http://139.9.103.171:1888/miniofile/xlyq/jiance.png"></u-icon>
  52. <text class="text-bold padding-left-10">监测值:</text>
  53. <text class="text-bold" v-text="item.monitorValue?item.monitorValue:'未知'" style="color: #1296db;"></text>
  54. </view>
  55. <view class="content flex">
  56. <u-icon size="36" name="http://139.9.103.171:1888/miniofile/xlyq/updateTime2.png"></u-icon>
  57. <text class="text-bold padding-left-10">更新时间:</text>
  58. <text v-text="item.lastUpdateTime?item.lastUpdateTime:'未知'"></text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="bottom flex" >
  64. <view @click="goDetail(item)" class="cu-btn sm round line-blue" >
  65. 查看详情
  66. </view>
  67. <view @click="goAlarm(item)" class="cu-btn sm round line-blue" style="margin: 0 20rpx;">
  68. 告警记录
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. export default {
  76. name: 'card',
  77. props:{
  78. list:{
  79. type:Array,
  80. default:()=>{
  81. []
  82. }
  83. }
  84. },
  85. data() {
  86. return {
  87. loading:false
  88. };
  89. },
  90. created() {
  91. let that = this;
  92. setTimeout(function() {
  93. that.loading = true
  94. }, 500)
  95. },
  96. methods:{
  97. copy(data){
  98. uni.setClipboardData({
  99. data:data
  100. })
  101. },
  102. goDetail(item){
  103. getApp().globalData.fireHydrantDetail=item
  104. uni.navigateTo({
  105. url:'/pages/index/fire/detail'
  106. })
  107. },
  108. goAlarm(item){
  109. uni.navigateTo({
  110. url:"/pages/index/fire/alarm-record?imei="+item.imei
  111. })
  112. }
  113. }
  114. };
  115. </script>
  116. <style lang="scss">
  117. .data {
  118. width: 710rpx;
  119. background-color: #ffffff;
  120. margin: 20rpx auto;
  121. border-radius: 6rpx;
  122. box-sizing: border-box;
  123. padding: 20rpx 10rpx;
  124. font-size: 28rpx;
  125. .top {
  126. display: flex;
  127. justify-content: space-between;
  128. padding-bottom: 20rpx;
  129. border-bottom: 1rpx solid $dt-border-color-sm;
  130. .left {
  131. display: flex;
  132. align-items: center;
  133. .title {
  134. margin: 0 10rpx;
  135. font-size: 30rpx;
  136. }
  137. }
  138. .right{
  139. margin-right: 10rpx;
  140. }
  141. }
  142. .item {
  143. margin: 5rpx 0 20rpx 0;
  144. .content {
  145. border-bottom: 1rpx dashed #DDDDDD;
  146. padding: 30rpx 0;
  147. }
  148. }
  149. .bottom {
  150. display: flex;
  151. margin-top: 30rpx;
  152. justify-content: flex-end;
  153. align-items: center;
  154. }
  155. }
  156. </style>