|
|
@@ -67,7 +67,10 @@
|
|
|
<view class="tit">
|
|
|
实时数据
|
|
|
</view>
|
|
|
- <view class="newState">
|
|
|
+ <view class="newtishi" v-if="!newtishitf">
|
|
|
+ 暂无数据
|
|
|
+ </view>
|
|
|
+ <view class="newState" v-else>
|
|
|
<view class="item" v-for="item in curState">
|
|
|
<image :src="item.icon" mode="widthFix"></image>
|
|
|
<view class="info-con">
|
|
|
@@ -157,7 +160,8 @@
|
|
|
culErr: '',
|
|
|
yxShow: false, //诱芯弹框
|
|
|
xyErr: '',
|
|
|
- decoy: ''
|
|
|
+ decoy: '',
|
|
|
+ newtishitf:false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -193,22 +197,22 @@
|
|
|
return [{
|
|
|
icon: '/static/image/cb/icon02.png',
|
|
|
txt: '在线状态',
|
|
|
- value: this.equipInfo.is_online == 1 ? '在线' : '离线',
|
|
|
+ value: Number(this.device_status) == 1 ? '在线' : '离线',
|
|
|
},
|
|
|
{
|
|
|
icon: '/static/image/cb/icon05.png',
|
|
|
txt: '开关状态',
|
|
|
- value: this.newState.ds == 1 ? '关机' : '开机'
|
|
|
+ value: Number(this.newState.ds) == 1 ? '开机' : '关机'
|
|
|
},
|
|
|
{
|
|
|
icon: '/static/image/cb/icon13.png',
|
|
|
txt: '通道状态',
|
|
|
- value: this.newState.upds == 1 ? '落虫' : '排水'
|
|
|
+ value: Number(this.newState.upds) == 1 ? '落虫' : '排水'
|
|
|
},
|
|
|
{
|
|
|
icon: '/static/image/cb/icon10.png',
|
|
|
txt: '加热状态',
|
|
|
- value: this.newState.hs == 1 ? '加热' : '正常'
|
|
|
+ value: Number(this.newState.hs) == 1 ? '加热' : '正常'
|
|
|
}, {
|
|
|
icon: '/static/image/cb/icon08.png',
|
|
|
txt: '环境温度(℃)',
|
|
|
@@ -229,15 +233,15 @@
|
|
|
{
|
|
|
icon: '/static/image/cb/icon17.png',
|
|
|
txt: '雨控状态',
|
|
|
- value: this.newState.rps == 1 ? "雨控" : '正常'
|
|
|
+ value: Number(this.newState.rps) == 1 ? "雨控" : '正常'
|
|
|
}, {
|
|
|
icon: '/static/image/cb/icon14.png',
|
|
|
txt: '温控状态',
|
|
|
- value: this.newState.tps == 1 ? "温控" : '正常'
|
|
|
+ value: Number(this.newState.tps) == 1 ? "温控" : '正常'
|
|
|
}, {
|
|
|
icon: '/static/image/cb/icon06.png',
|
|
|
txt: '光控状态',
|
|
|
- value: this.newState.lps == 1 ? "光控" : '正常'
|
|
|
+ value: Number(this.newState.lps) == 1 ? "光控" : '正常'
|
|
|
}, {
|
|
|
icon: '/static/image/cb/icon01.png',
|
|
|
txt: '灯管状态',
|
|
|
@@ -245,23 +249,23 @@
|
|
|
}, {
|
|
|
icon: '/static/image/cb/icon11.png',
|
|
|
txt: '上仓门',
|
|
|
- value: this.newState.upds == 1 ? "打开" : '关闭'
|
|
|
+ value: Number(this.newState.upds) == 1 ? "打开" : '关闭'
|
|
|
}, {
|
|
|
icon: '/static/image/cb/icon15.png',
|
|
|
txt: '下仓门',
|
|
|
- value: this.newState.dnds == 1 ? "打开" : '关闭'
|
|
|
+ value: Number(this.newState.dnds) == 1 ? "打开" : '关闭'
|
|
|
}
|
|
|
]
|
|
|
case 7:
|
|
|
return [{
|
|
|
icon: '/static/image/cb/icon02.png',
|
|
|
txt: '在线状态',
|
|
|
- value: this.device_status == 1 ? '在线' : '离线',
|
|
|
+ value: Number(this.device_status) == 1 ? '在线' : '离线',
|
|
|
},
|
|
|
{
|
|
|
icon: '/static/image/cb/icon05.png',
|
|
|
txt: '设备开关',
|
|
|
- value: this.newState.on_off == 1 ? '开启' : '关闭'
|
|
|
+ value: Number(this.newState.ds) == 1 ? '开启' : '关闭'
|
|
|
},
|
|
|
{
|
|
|
icon: '/static/image/cb/bzy/3.png',
|
|
|
@@ -314,7 +318,7 @@
|
|
|
return [{
|
|
|
icon: '/static/image/cb/icon02.png',
|
|
|
txt: '在线状态',
|
|
|
- value: this.device_status == 1 ? '在线' : '离线',
|
|
|
+ value: Number(this.device_status) == 1 ? '在线' : '离线',
|
|
|
},
|
|
|
{
|
|
|
icon: '/static/image/cb/icon05.png',
|
|
|
@@ -359,7 +363,7 @@
|
|
|
{
|
|
|
icon: '/static/image/cb/xy/9.png',
|
|
|
txt: '充电状态',
|
|
|
- value: this.newState.cs == 1 ? '充电' : '正常'
|
|
|
+ value: Number(this.newState.cs) == 1 ? '充电' : '正常'
|
|
|
},
|
|
|
{
|
|
|
icon: '/static/image/cb//xy/10.png',
|
|
|
@@ -404,7 +408,7 @@
|
|
|
onLoad(option) {
|
|
|
this.equipInfo = JSON.parse(option.info)
|
|
|
this.type = Number(this.equipInfo.type)
|
|
|
- this.device_status = this.equipInfo.device_status
|
|
|
+ this.device_status = this.equipInfo.is_online
|
|
|
this.getState()
|
|
|
console.log(this.equipInfo)
|
|
|
this.selectaddress(this.lat,this.lng)
|
|
|
@@ -420,7 +424,12 @@
|
|
|
page_size: 1,
|
|
|
}
|
|
|
})
|
|
|
- this.newState = res.data[0].d_h_t
|
|
|
+ if(res.counts!=0){
|
|
|
+ this.newState = res.data[0].d_h_t
|
|
|
+ this.newtishitf = true
|
|
|
+ }else{
|
|
|
+ this.newtishitf = false
|
|
|
+ }
|
|
|
},
|
|
|
partClick(path) {
|
|
|
uni.navigateTo({
|
|
|
@@ -578,7 +587,13 @@
|
|
|
font-size: 30rpx;
|
|
|
margin-bottom: 20rpx;
|
|
|
}
|
|
|
-
|
|
|
+ .newtishi{
|
|
|
+ width: 90%;
|
|
|
+ margin: 0 auto;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 40rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
.newState {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|