更新页面显示效果

This commit is contained in:
qianlile
2021-09-06 11:54:30 +08:00
parent 7b673421ad
commit c708b0f16f
18 changed files with 433 additions and 140 deletions

View File

@@ -9,7 +9,7 @@ Page({
data: {
weather:{}, //天气信息
products:[],
DeviceList:null,
DeviceList:[],
onlineList:[],
unlineList:[]
},
@@ -59,7 +59,7 @@ Page({
}
})
break;
case 2:
case 4:
wx.navigateTo({
url: '/pages/4Gswitch/index',
success:(res)=>{
@@ -67,14 +67,14 @@ Page({
}
})
break;
case 4:
wx.navigateTo({
url: '/pages/someData/index',
success:(res)=>{
res.eventChannel.emit('getDeviceInfo',e.currentTarget.dataset.deviceId)
}
})
break;
// case 4:
// wx.navigateTo({
// url: '/pages/someData/index',
// success:(res)=>{
// res.eventChannel.emit('getDeviceInfo',e.currentTarget.dataset.deviceId)
// }
// })
// break;
case 5:
wx.navigateTo({

View File

@@ -8,9 +8,9 @@
</view>
<view class='top_small_info'>
<view>
<text class='humidity'>湿度: {{ weather.humidity.data }}</text>
<text class='weather'>天气: {{ weather.weather.data }}</text>
</view>
<text class='humidity'>湿度: {{ weather.humidity.data }}</text>
<text class='weather'>天气: {{ weather.weather.data }}</text>
</view>
<text class='winddirection'>风向: {{ weather.winddirection.data }}</text>
<text class='windpower'>风力: {{ weather.windpower.data }}</text>
</view>
@@ -23,97 +23,70 @@
</view>
<view class='devices'>
<view class='devices_tab'>全部 ({{ DeviceList.length }})</view>
<van-tabs swipeable animated>
<van-tab title="在线设备({{ onlineList.length }})">
<scroll-view scroll-y>
<view class="devices_list">
<block wx:if="{{ onlineList.length !== 0 }}">
<view wx:for='{{ onlineList }}' wx:key='index' class='border'>
<!-- <block wx:if="{{ item.isOnline === 2 }}">
<view class='devices_item' style="background-color:rgba(0,0,0,.05)" bindtap='deviceNone' data-info='{{item}}'>
<view class="info">
<view class='img'>
<image src='/icons/4g.png' />
</view>
<view class="_right">
<view style="color:#bfbfbf" class="status">未激活</view>
<view style="font-size:24rpx;color:#666">{{ item.categoryName }}</view>
</view>
</view>
<view class='name'>{{ item.deviceName }}</view>
</view>
</block> -->
<block wx:if="{{ item.isOnline === 1 }}">
<view class='devices_item' bindtap='goToDeviceControl' data-info='{{item}}'>
<view class="info">
<view class='img'>
<image src='/icons/4g.png' />
</view>
<view class="_right">
<view style="color:green" class="status">在线</view>
<view style="font-size:24rpx;color:#666">{{ item.categoryName }}</view>
</view>
</view>
<view class='name'>
<view>
{{ item.deviceName }}
</view>
<view>
<text style="color:#ff0000;font-size:24rpx;font-weight:600">NO.</text>
<text style="color:#ff0000;font-size:22rpx;">{{ item.deviceNum }}</text>
</view>
</view>
</view>
</block>
<block wx:if="{{ item.isOnline === 0 }}">
<view style="background-color:rgba(0,0,0,.05)" class='devices_item' bindtap='goToDeviceControl' data-info='{{item}}'>
<view class="info">
<view class='img'>
<image src='/icons/4g.png' />
</view>
<view class="_right">
<view style="color:#ff0000" class="status">离线</view>
<view style="font-size:24rpx;color:#666">{{ item.categoryName }}</view>
</view>
</view>
<view class='name'>
<view>
{{ item.deviceName }}
</view>
<view>
<text style="color:#ff0000;font-size:24rpx; font-weight:600">NO.</text>
<text style="color:#ff0000;font-size:22rpx;">{{ item.deviceNum }}</text>
</view>
</view>
</view>
</block>
<!-- <van-tabs swipeable animated>
<van-tab title="在线设备({{ onlineList.length }})"> -->
<scroll-view scroll-y>
<view class="devices_list">
<block wx:if="{{ DeviceList.length !== 0 }}">
<view wx:for='{{ onlineList }}' wx:key='index' class='border'>
<block wx:if="{{ item.isOnline === 1 }}">
<view class='devices_item' bindtap='goToDeviceControl' data-info='{{item}}'>
<view class="info">
<view class='img'>
<image src='/icons/4g.png' />
</view>
<view class="_right">
<view style="color:green" class="status">在线</view>
<view style="font-size:24rpx;color:#666">{{ item.categoryName }}</view>
</view>
</view>
<view class='name'>
<view>
{{ item.deviceName }}
</view>
<view>
<text style="color:#ff0000;font-size:24rpx;font-weight:600">NO.</text>
<text style="color:#ff0000;font-size:22rpx;">{{ item.deviceNum }}</text>
</view>
</view>
</view>
</block>
<block wx:if="{{ item.isOnline === 0 }}">
<view style="background-color:rgba(0,0,0,.05)" class='devices_item' bindtap='goToDeviceControl'
data-info='{{item}}'>
<view class="info">
<view class='img'>
<image src='/icons/4g.png' />
</view>
<view class="_right">
<view style="color:#ff0000" class="status">离线</view>
<view style="font-size:24rpx;color:#666">{{ item.categoryName }}</view>
</view>
</view>
<view class='name'>
<view>
{{ item.deviceName }}
</view>
<view>
<text style="color:#ff0000;font-size:24rpx; font-weight:600">NO.</text>
<text style="color:#ff0000;font-size:22rpx;">{{ item.deviceNum }}</text>
</view>
</view>
</view>
</block>
<block wx:elif='{{ onlineList.length === 0 }}'>
<view class='noDevice'> 暂无设备,请添加。 </view>
</block>
</view>
</scroll-view>
</van-tab>
<van-tab title="离线设备({{ unlineList.length }})">
</block>
<block wx:elif='{{ DeviceList.length === 0 }}'>
<view class='noDevice'> 暂无设备,请添加。 </view>
</block>
</view>
</scroll-view>
<!-- </van-tab> -->
<!-- <van-tab title="离线设备({{ unlineList.length }})">
<scroll-view scroll-y>
<view class="devices_list">
<block wx:if="{{ unlineList.length !== 0 }}">
<view wx:for='{{ unlineList }}' wx:key='index' class='border'>
<!-- <block wx:if="{{ item.isOnline === 2 }}">
<view class='devices_item' style="background-color:rgba(0,0,0,.05)" bindtap='deviceNone' data-info='{{item}}'>
<view class="info">
<view class='img'>
<image src='/icons/4g2.png' />
</view>
<view class="_right">
<view style="color:#bfbfbf" class="status">未激活</view>
<view style="font-size:24rpx;color:#666">{{ item.categoryName }}</view>
</view>
</view>
<view class='name'>{{ item.deviceName }}</view>
</view>
</block> -->
<block wx:if="{{ item.isOnline === 1 }}">
<view class='devices_item' bindtap='goToDeviceControl' data-info='{{item}}'>
<view class="info">
@@ -166,6 +139,6 @@
</view>
</scroll-view>
</van-tab>
</van-tabs>
</van-tabs> -->
</view>
</view>
</view>