新增210管控页面,6170设备控制,订阅设备消息
This commit is contained in:
@ -41,8 +41,13 @@
|
||||
<view class="ID" v-if="item.communicationMode==0">ID:{{item.deviceImei}}
|
||||
</view>
|
||||
<view class="ID" v-else>ID:{{item.deviceMac}}</view>
|
||||
<view class="onlines" v-if="item.communicationMode==0">在线</view>
|
||||
<view>电量:90%</view>
|
||||
<!-- 在线状态 -->
|
||||
<view class="onlines"
|
||||
v-if="item.communicationMode==0 && item.onlineStatus==1">在线</view>
|
||||
<!-- 离线状态 -->
|
||||
<view class="offlines"
|
||||
v-if="item.communicationMode==0 && item.onlineStatus==0">离线</view>
|
||||
<view>电量:{{item.battery || '0'}}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -423,7 +428,7 @@
|
||||
handleFile(item) {
|
||||
//console.log('item' + JSON.stringify(item));
|
||||
// communicationMode 0是4G 1是蓝牙
|
||||
if (item.communicationMode == 0) {
|
||||
if (item.typeName == 'BJQ6170') {
|
||||
uni.navigateTo({
|
||||
url: "/pages/6170/deviceControl/index",
|
||||
events: {
|
||||
@ -437,6 +442,19 @@
|
||||
});
|
||||
}
|
||||
})
|
||||
} else if (item.typeName == 'HBY210') {
|
||||
uni.navigateTo({
|
||||
url: "/pages/210/deviceControl/index",
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
// 页面跳转成功后的回调函数
|
||||
res.eventChannel.emit('deviceControl', {
|
||||
data: item,
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
if (item.typeName == '6155') {
|
||||
uni.navigateTo({
|
||||
@ -460,7 +478,7 @@
|
||||
updateDeviceStatus(data) {
|
||||
// 只更新 communicationMode == 0 的设备
|
||||
this.deviceList = this.deviceList.map(item => {
|
||||
console.log(item,'item2222');
|
||||
console.log(item, 'item2222');
|
||||
if (item.communicationMode === 0) {
|
||||
// 这里根据消息内容更新设备状态
|
||||
// 示例:如果消息包含特定字段,则更新设备状态
|
||||
@ -703,6 +721,19 @@
|
||||
top: 20rpx;
|
||||
left: -20rpx
|
||||
}
|
||||
.offlines{
|
||||
position: relative;
|
||||
}
|
||||
.offlines::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border-radius: 50%;
|
||||
top: 20rpx;
|
||||
left: -20rpx
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 2rpx;
|
||||
|
Reference in New Issue
Block a user