<!--index.wxml-->
<view class="content position-relative">
  <view class="position-fixed bg-fff pb-2">
    <!-- <van-search value="{{ searchValue }}" placeholder="请输入搜索关键词" /> -->
    <van-search value="{{ searchValue }}" placeholder="请输入搜索关键词" use-action-slot bind:change="onChange" bind:search="onSearch">
      <view slot="action" bind:tap="onClick">搜索</view>
    </van-search>
    <!-- <view bindtap="zh">测试</view>
    <view>转化前：{{ces}}--转换后：{{ces1}}--解析后：{{ces2}}</view> -->
    <view class="Statistics">
      <view class="qrcode" bindtap="qrcodefun" wx:if="{{userInfo.type < 2}}">
        <view class="qrimg">
          <image src="../../static/images/qrcode.png" mode="widthFix"></image>
        </view>
        <view class="text">
          <view class="title">扫一扫</view>
          <view class="content">扫描二维码 查看绑定门锁</view>
        </view>
      </view>
    </view>
    <view class="selectRoom" wx:if="{{userInfo.type < 2}}">
        <view class="picker" bindtap="bindroom">
          {{selectRoomName}}<view class="jt">▼</view>
        </view>
    </view>
  </view>
  <view wx:for="devices_list" wx:key="deviceId">
  <view> {{item.name}}</view>
  </view>
  <view class="roomlist mt-43">
    <view class="cu-item mb-4" bindtap="godetail" data-item="{{item}}" wx:for="{{list}}" wx:for-index="{{index}}" wx:for-item="item">
      <view class="d-flex justify-content-between pa-2 b-line align-center">
        <view class="d-flex align-center  w-100"><view class="iconfont icon-fangjianliebiao text-orange d-line {{item.deviceNum?'':'colorRed'}}"></view><view class="d-line ml-1 font-size-16 w-80 text-ellipsis">{{item.path}}</view></view>        
        <!-- <view><van-button round type="info" size="mini" data-select="{{item}}" catchtap="bluetoothUnlockingMethods">蓝牙开锁</van-button></view>      -->
      </view>
      <view class="content pa-2 d-flex justify-content-between">
        <view class="font-size-14 text-bold w-50 text-ellipsis">设备号：{{item.deviceNum?item.deviceNum:'无'}}</view>
        <view class="font-size-14 text-bold w-50  text-ellipsis">电量：<text class="{{item.battery<20?'color-red':item.battery<80?'color-orange':item.battery>80?'color-green':''}}">{{item.battery?item.battery:'无'}}</text></view>
        <view class="font-size-14 text-bold w-50  text-ellipsis">信号：<text class="{{item.rssi<15?'color-red':item.rssi<20?'color-orange':item.rssi>20?'color-green':''}}">{{item.rssi?item.rssi:'无'}}</text></view>
        <view class="font-size-14 colorhui w-50  text-ellipsis">联网：<text class="{{item.isOnline==0?'color-red':item.isOnline==1?'color-green':item.isOnline==2?'color-orange':''}}">{{item.isOnline===0?'离线':item.isOnline==1?'在线':item.isOnline==2?'异常':'无'}}</text></view>
        <!-- <view class="font-size-14 colorhui w-50  text-ellipsis" wx:if="item.count">入住人数：{{item.count}}</view> -->
      </view>
    </view>
  </view>
  <view class="bgaddbackground" hidden="addlockRoom" bindtap="bindRoom"></view>
  <van-popup show="{{ show }}" bind:close="onClose"  position="bottom" custom-style="height: 60%">
    <tree
    dataTree="{{dataList}}"
    selectKey="{{selectKey}}"
    bind:select="handleSelect"
    isSelectLastNode="true"
    isOpenAll="{{false}}"
  ></tree>
  </van-popup>
</view>
<!-- <loading></loading> -->