|
@@ -1,17 +1,18 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view>
|
|
<view>
|
|
|
<view :class="['info',equipInfo.is_online==1?'on':'off']">
|
|
<view :class="['info',equipInfo.is_online==1?'on':'off']">
|
|
|
- <view class="">
|
|
|
|
|
- 设备ID:{{equipInfo.imei}}
|
|
|
|
|
|
|
+ <view class="" @click="copy(equipInfo)">
|
|
|
|
|
+ 设备ID:{{equipInfo.imei||equipInfo.device_id}}
|
|
|
|
|
+ <image src="http://static.yfpyx.com/bigdata_app/image/environment/fuzhi.png" mode="" class="tishi"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="">
|
|
<view class="">
|
|
|
设备名称:{{equipInfo.device_name}}
|
|
设备名称:{{equipInfo.device_name}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="">
|
|
<view class="">
|
|
|
- 设备类型:{{equipInfo.type|equipType}}
|
|
|
|
|
|
|
+ 设备类型:{{equipInfo.type|equipType}}{{equipInfo.type_name}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="">
|
|
<view class="">
|
|
|
- 最新上报时间:{{equipInfo.addtime | timeFormat}}
|
|
|
|
|
|
|
+ 最新上报时间:{{equipInfo.addtime||equipInfo.uptime | timeFormat}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="">
|
|
<view class="">
|
|
|
设备地址:{{equipInfo.address?equipInfo.address:"--"}}
|
|
设备地址:{{equipInfo.address?equipInfo.address:"--"}}
|
|
@@ -55,7 +56,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-else>
|
|
|
|
|
|
|
+ <template v-else-if="equipInfo.type==3">
|
|
|
<view class="item2" v-for="item in curEquip" v-if="item.tf" @click="partClick(item.path)">
|
|
<view class="item2" v-for="item in curEquip" v-if="item.tf" @click="partClick(item.path)">
|
|
|
<image :src="'http://static.yfpyx.com/bigdata_app'+item.icon" mode="widthFix"></image>
|
|
<image :src="'http://static.yfpyx.com/bigdata_app'+item.icon" mode="widthFix"></image>
|
|
|
<view class="">
|
|
<view class="">
|
|
@@ -63,9 +64,18 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <view class="item3" v-for="item in curEquip" v-if="item.tf" @click="partClick(item.path)">
|
|
|
|
|
+ <image :src="'http://static.yfpyx.com/bigdata_app'+item.icon" mode="widthFix"></image>
|
|
|
|
|
+ <view class="">
|
|
|
|
|
+ {{item.tex}}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </template>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="tit">
|
|
<view class="tit">
|
|
|
- 实时数据
|
|
|
|
|
|
|
+ <p>实时数据</p>
|
|
|
|
|
+ <p class="span" @click="partClicks">历史数据>>></p>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="newtishi" v-if="!newtishitf">
|
|
<view class="newtishi" v-if="!newtishitf">
|
|
|
暂无数据
|
|
暂无数据
|
|
@@ -100,12 +110,14 @@
|
|
|
tex: '查看图片',
|
|
tex: '查看图片',
|
|
|
path: '/pages/cb/cbd/equip-set/imgpage',
|
|
path: '/pages/cb/cbd/equip-set/imgpage',
|
|
|
tf:false
|
|
tf:false
|
|
|
- }, {
|
|
|
|
|
- icon: '/image/cb/2.png',
|
|
|
|
|
- tex: '历史数据',
|
|
|
|
|
- path: '/pages/cb/cbd/equip-set/historyfile',
|
|
|
|
|
- tf:false
|
|
|
|
|
- }, {
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // icon: '/image/cb/2.png',
|
|
|
|
|
+ // tex: '历史数据',
|
|
|
|
|
+ // path: '/pages/cb/cbd/equip-set/historyfile',
|
|
|
|
|
+ // tf:false
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
icon: '/image/cb/3.png',
|
|
icon: '/image/cb/3.png',
|
|
|
tex: '害虫统计',
|
|
tex: '害虫统计',
|
|
|
path: '/pages/cb/cbd/equip-set/statistics',
|
|
path: '/pages/cb/cbd/equip-set/statistics',
|
|
@@ -124,7 +136,12 @@
|
|
|
icon: '/image/cb/6.png',
|
|
icon: '/image/cb/6.png',
|
|
|
tex: 'sim卡详情',
|
|
tex: 'sim卡详情',
|
|
|
path: '/pages/cb/sim/sim',
|
|
path: '/pages/cb/sim/sim',
|
|
|
- tf:false
|
|
|
|
|
|
|
+ tf:true
|
|
|
|
|
+ },{
|
|
|
|
|
+ icon: '/image/environment/7.png',
|
|
|
|
|
+ tex: '一键报修',
|
|
|
|
|
+ path: '/pages/afterSale/addafter',
|
|
|
|
|
+ tf:true
|
|
|
}],
|
|
}],
|
|
|
bzy: [{
|
|
bzy: [{
|
|
|
icon: '/image/cb/4.png',
|
|
icon: '/image/cb/4.png',
|
|
@@ -136,16 +153,23 @@
|
|
|
tex: '查看图片',
|
|
tex: '查看图片',
|
|
|
path: '/pages/cb/cbd/equip-set/imgpage',
|
|
path: '/pages/cb/cbd/equip-set/imgpage',
|
|
|
tf:false
|
|
tf:false
|
|
|
- }, {
|
|
|
|
|
- icon: '/image/cb/2.png',
|
|
|
|
|
- tex: '历史数据',
|
|
|
|
|
- path: '/pages/cb/bzy/equip-set/bzyhistoryile',
|
|
|
|
|
- tf:false
|
|
|
|
|
- }, {
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // icon: '/image/cb/2.png',
|
|
|
|
|
+ // tex: '历史数据',
|
|
|
|
|
+ // path: '/pages/cb/bzy/equip-set/bzyhistoryile',
|
|
|
|
|
+ // tf:false
|
|
|
|
|
+ // },
|
|
|
|
|
+ {
|
|
|
icon: '/image/cb/6.png',
|
|
icon: '/image/cb/6.png',
|
|
|
tex: 'sim卡详情',
|
|
tex: 'sim卡详情',
|
|
|
path: '/pages/cb/sim/sim',
|
|
path: '/pages/cb/sim/sim',
|
|
|
tf:false
|
|
tf:false
|
|
|
|
|
+ },{
|
|
|
|
|
+ icon: '/image/environment/7.png',
|
|
|
|
|
+ tex: '一键报修',
|
|
|
|
|
+ path: '/pages/afterSale/addafter',
|
|
|
|
|
+ tf:true
|
|
|
}],
|
|
}],
|
|
|
xy: [{
|
|
xy: [{
|
|
|
icon: '/image/cb/4.png',
|
|
icon: '/image/cb/4.png',
|
|
@@ -162,6 +186,11 @@
|
|
|
tex: '历史数据',
|
|
tex: '历史数据',
|
|
|
path: '/pages/cb/xy/equip-set/xyhistoryile',
|
|
path: '/pages/cb/xy/equip-set/xyhistoryile',
|
|
|
tf:false
|
|
tf:false
|
|
|
|
|
+ },{
|
|
|
|
|
+ icon: '/image/environment/7.png',
|
|
|
|
|
+ tex: '一键报修',
|
|
|
|
|
+ path: '/pages/afterSale/addafter',
|
|
|
|
|
+ tf:true
|
|
|
}],
|
|
}],
|
|
|
newState: {}, //设备最新状态
|
|
newState: {}, //设备最新状态
|
|
|
setTimeShow: false,
|
|
setTimeShow: false,
|
|
@@ -174,7 +203,7 @@
|
|
|
yxShow: false, //诱芯弹框
|
|
yxShow: false, //诱芯弹框
|
|
|
xyErr: '',
|
|
xyErr: '',
|
|
|
decoy: '',
|
|
decoy: '',
|
|
|
- newtishitf:false
|
|
|
|
|
|
|
+ newtishitf:false,
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -229,11 +258,11 @@
|
|
|
}, {
|
|
}, {
|
|
|
icon: '/image/cb/icon08.png',
|
|
icon: '/image/cb/icon08.png',
|
|
|
txt: '环境温度(℃)',
|
|
txt: '环境温度(℃)',
|
|
|
- value: this.newState.at
|
|
|
|
|
|
|
+ value: this.newState.at=="2.5"||this.newState.at=="25"||this.newState.at==""?this.newState.new_tem:this.newState.at
|
|
|
}, {
|
|
}, {
|
|
|
icon: '/image/cb/icon07.png',
|
|
icon: '/image/cb/icon07.png',
|
|
|
txt: '环境湿度(%)',
|
|
txt: '环境湿度(%)',
|
|
|
- value: this.newState.ah
|
|
|
|
|
|
|
+ value:this.newState.ah=="30"||this.newState.ah=="3.0"||this.newState.ah==""?this.newState.new_hum:this.newState.ah
|
|
|
}, {
|
|
}, {
|
|
|
icon: '/image/cb/icon16.png',
|
|
icon: '/image/cb/icon16.png',
|
|
|
txt: '信号强度',
|
|
txt: '信号强度',
|
|
@@ -292,11 +321,11 @@
|
|
|
}, {
|
|
}, {
|
|
|
icon: '/image/cb/icon08.png',
|
|
icon: '/image/cb/icon08.png',
|
|
|
txt: '环境温度(℃)',
|
|
txt: '环境温度(℃)',
|
|
|
- value: this.newState.at
|
|
|
|
|
|
|
+ value: this.newState.at=="2.5"||this.newState.at=="25"||this.newState.at==""?this.newState.new_tem:this.newState.at
|
|
|
}, {
|
|
}, {
|
|
|
icon: '/image/prevention/66.png',
|
|
icon: '/image/prevention/66.png',
|
|
|
txt: '环境湿度(%)',
|
|
txt: '环境湿度(%)',
|
|
|
- value: this.newState.ah
|
|
|
|
|
|
|
+ value:this.newState.ah=="30"||this.newState.ah=="3.0"||this.newState.ah==""?this.newState.new_hum:this.newState.ah
|
|
|
}, {
|
|
}, {
|
|
|
icon: '/image/cb/icon16.png',
|
|
icon: '/image/cb/icon16.png',
|
|
|
txt: '信号强度',
|
|
txt: '信号强度',
|
|
@@ -317,15 +346,7 @@
|
|
|
icon: '/image/cb/icon08.png',
|
|
icon: '/image/cb/icon08.png',
|
|
|
txt: '保温仓设定温度',
|
|
txt: '保温仓设定温度',
|
|
|
value: this.newState.set_temp
|
|
value: this.newState.set_temp
|
|
|
- }, {
|
|
|
|
|
- icon: '/image/prevention/107.png',
|
|
|
|
|
- txt: '经度',
|
|
|
|
|
- value: this.newState.lng
|
|
|
|
|
- }, {
|
|
|
|
|
- icon: '/image/prevention/108.png',
|
|
|
|
|
- txt: '纬度',
|
|
|
|
|
- value: this.newState.lat
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
];
|
|
];
|
|
|
case 4:
|
|
case 4:
|
|
|
return [{
|
|
return [{
|
|
@@ -344,14 +365,19 @@
|
|
|
value: this.newState.ws == 1 ? '工作' : ' 待机'
|
|
value: this.newState.ws == 1 ? '工作' : ' 待机'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
|
|
+ icon: '/image/cb/icon12.png',
|
|
|
|
|
+ txt: '设备版本',
|
|
|
|
|
+ value: this.newState.dver
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
icon: '/image/cb/icon08.png',
|
|
icon: '/image/cb/icon08.png',
|
|
|
txt: '环境温度(℃)',
|
|
txt: '环境温度(℃)',
|
|
|
- value: this.newState.at
|
|
|
|
|
|
|
+ value: this.newState.at=="2.5"||this.newState.at=="25"||this.newState.at==""?this.newState.new_tem:this.newState.at
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
icon: '/image/cb/icon07.png',
|
|
icon: '/image/cb/icon07.png',
|
|
|
txt: '环境湿度(%)',
|
|
txt: '环境湿度(%)',
|
|
|
- value: this.newState.ah
|
|
|
|
|
|
|
+ value:this.newState.ah=="30"||this.newState.ah=="3.0"||this.newState.ah==""?this.newState.new_hum:this.newState.ah
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
icon: '/image/prevention/105.png',
|
|
icon: '/image/prevention/105.png',
|
|
@@ -369,11 +395,6 @@
|
|
|
value: this.newState.csq
|
|
value: this.newState.csq
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- icon: '/image/cb/icon12.png',
|
|
|
|
|
- txt: '设备版本',
|
|
|
|
|
- value: this.newState.dver
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
icon: '/image/cb/xy/9.png',
|
|
icon: '/image/cb/xy/9.png',
|
|
|
txt: '充电状态',
|
|
txt: '充电状态',
|
|
|
value: Number(this.newState.cs) == 1 ? '充电' : '正常'
|
|
value: Number(this.newState.cs) == 1 ? '充电' : '正常'
|
|
@@ -420,7 +441,7 @@
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
this.equipInfo = JSON.parse(option.info)
|
|
this.equipInfo = JSON.parse(option.info)
|
|
|
- this.type = Number(this.equipInfo.type)
|
|
|
|
|
|
|
+ this.type = Number(this.equipInfo.type) || Number(this.equipInfo.equip_type)
|
|
|
this.device_status = this.equipInfo.is_online
|
|
this.device_status = this.equipInfo.is_online
|
|
|
this.getState()
|
|
this.getState()
|
|
|
console.log(this.equipInfo)
|
|
console.log(this.equipInfo)
|
|
@@ -455,7 +476,6 @@
|
|
|
break
|
|
break
|
|
|
case "设备控制":
|
|
case "设备控制":
|
|
|
this.cbd[3].tf = true
|
|
this.cbd[3].tf = true
|
|
|
-
|
|
|
|
|
break
|
|
break
|
|
|
case "害虫统计":
|
|
case "害虫统计":
|
|
|
this.cbd[2].tf = true
|
|
this.cbd[2].tf = true
|
|
@@ -507,12 +527,14 @@
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=forecast.worm_lamp.device_history_data',
|
|
url: '/api/api_gateway?method=forecast.worm_lamp.device_history_data',
|
|
|
data: {
|
|
data: {
|
|
|
- device_type_id: this.equipInfo.type,
|
|
|
|
|
- device_id: this.equipInfo.imei,
|
|
|
|
|
|
|
+ device_type_id: this.equipInfo.type || this.equipInfo.equip_type,
|
|
|
|
|
+ device_id: this.equipInfo.imei || this.equipInfo.device_id,
|
|
|
page: 1,
|
|
page: 1,
|
|
|
page_size: 1,
|
|
page_size: 1,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ console.log(1222)
|
|
|
if(res.counts!=0){
|
|
if(res.counts!=0){
|
|
|
this.newState = res.data[0].d_h_t
|
|
this.newState = res.data[0].d_h_t
|
|
|
this.newtishitf = true
|
|
this.newtishitf = true
|
|
@@ -523,7 +545,18 @@
|
|
|
partClick(path) {
|
|
partClick(path) {
|
|
|
console.log(path)
|
|
console.log(path)
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + this.equipInfo.imei
|
|
|
|
|
|
|
+ url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + this.equipInfo.imei + "&device_type="+this.type
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ partClicks(){
|
|
|
|
|
+ var path = ""
|
|
|
|
|
+ if(this.type==3){
|
|
|
|
|
+ path="/pages/cb/cbd/equip-set/historyfile"
|
|
|
|
|
+ }else if(this.type == 7){
|
|
|
|
|
+ path="/pages/cb/bzy/equip-set/bzyhistoryile"
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + this.equipInfo.imei + "&device_type="+this.type
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
async setTime(d_id) {
|
|
async setTime(d_id) {
|
|
@@ -617,6 +650,15 @@
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ copy(item){
|
|
|
|
|
+ console.log(item)
|
|
|
|
|
+ uni.setClipboardData({
|
|
|
|
|
+ data: item.imei||item.device_id,
|
|
|
|
|
+ success: function () {
|
|
|
|
|
+ console.log('success');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -636,6 +678,11 @@
|
|
|
background-position: top left;
|
|
background-position: top left;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
|
|
+ .tishi{
|
|
|
|
|
+ width: 28rpx;
|
|
|
|
|
+ height: 28rpx;
|
|
|
|
|
+ margin: 0rpx 0 0 20rpx;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.on {
|
|
.on {
|
|
@@ -658,24 +705,38 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.item1 {
|
|
.item1 {
|
|
|
- padding: 20rpx 10rpx;
|
|
|
|
|
|
|
+ padding: 20rpx 0;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
flex-basis: 25%;
|
|
flex-basis: 25%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.item2 {
|
|
.item2 {
|
|
|
- padding: 20rpx;
|
|
|
|
|
|
|
+ padding: 20rpx 10rpx;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
flex-basis: 33%;
|
|
flex-basis: 33%;
|
|
|
/* flex-grow: 1; */
|
|
/* flex-grow: 1; */
|
|
|
}
|
|
}
|
|
|
|
|
+ .item3{
|
|
|
|
|
+ padding: 20rpx 0;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ flex-basis: 25%;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.tit {
|
|
.tit {
|
|
|
font-weight: 800;
|
|
font-weight: 800;
|
|
|
- line-height: 50rpx;
|
|
|
|
|
|
|
+ height: 50rpx;
|
|
|
font-size: 30rpx;
|
|
font-size: 30rpx;
|
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ .span{
|
|
|
|
|
+ color: #6e6c76;
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ /* margin-top: 12rpx; */
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
.newtishi{
|
|
.newtishi{
|
|
|
width: 90%;
|
|
width: 90%;
|