

<!--横向均分  -->
<view style='background-color:#fff'>
<!--
<view class="layout_horizontal">
  <button class="button_sp"hover-class="button_sp2"style="flex:1"bindtap='gotosetuuid'>设置UUID</button>
  <view class="div" style='background-color:white'></view>
  <button class="button_sp"hover-class="button_sp2"style="flex:1" bindtap='gotoabout'>关于我们</button>
</view>
-->

<button loading="{{misScanding}}" class="button_sp" hover-class="button_sp2"bindtap="openBluetoothAdapter" >{{scandbutName}}</button>
<button style='display:none' bindtap="stopBluetoothDevicesDiscovery">停止扫描</button>
<button style='display:none' bindtap="closeBluetoothAdapter">结束流程</button>
</view>
<view style='background-color: #fff;height: 10px;width: 100%;'></view>

<view class="devices_summary">已发现 {{devices.length}} 个BLE设备：</view>
<scroll-view class="device_list" scroll-y scroll-with-animation>
  <view wx:for="{{devices}}" wx:key="index"
   data-device-id="{{item.deviceId}}"
   data-name="{{item.name || item.localName}}"
   bindtap="goto_Comm" 
   class="device_item"
   hover-class="device_item_hover">
    <view style="font-size: 16px; color: #111;">{{item.name}}</view>
    <view style="font-size: 12px;color: #555;">RSSI: {{item.RSSI}}dBm</view>
    <view style="font-size: 12px;color: #555;">{{item.deviceId}}</view>
  </view>
</scroll-view>

<view style='display:none' class="connected_info" wx:if="{{connected}}">
  <view>
    <text>已连接到 {{name}}</text>
    <view class="operation">
    <button wx:if="{{canWrite}}" size="mini" bindtap="writeBLECharacteristicValue">写数据</button>
    <button size="mini" bindtap="closeBLEConnection">断开连接</button>
    </view>
  </view>
  <view wx:for="{{chs}}" wx:key="index" style="font-size: 12px; margin-top: 10px;">
    <view>特性UUID: {{item.uuid}}</view>
    <view>特性值: {{item.value}}</view>
  </view>
</view>