| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <page>
- <wxs module="utils">
- module.exports.max = function (n1, n2) {
- return Math.max(n1, n2)
- }
- module.exports.len = function (arr) {
- arr = arr || []
- return arr.length
- }
- </wxs>
- <view class="page-bluebooth-list" style="display:{{scanBtn}}">
- <view class="body-toolBar">
- <image class="bltImg" src="/images/blt-link.png"></image>
- <view style="display: flex;flex-direction: row;justify-content: center;">
- <button class="scanBtn" loading="{{isFinding}}" bindtap="scanBluetoothDevicesHandle">{{btnName}}</button>
- <view bindtap="onStartQr" style="margin-top: 25rpx;margin-left: 40rpx;width:50rpx;height:50rpx;background-color: white;border-radius: 50%;box-shadow:0 0 10rpx 10rpx white;">
- <image src='/images/scan.png' style="width:50rpx;height:50rpx;" > </image>
- </view>
- </view>
- </view>
- <view class="body-content">
- <view class="device-list-box">
- <scroll-view class="device_list" scroll-y scroll-with-animation>
- <view class="devices_summary">
- <text>扫描到的新设备: </text><text style="color:#FD7400;">{{devices.length}}</text>
- </view>
- <view class="devicesBox">
- <view wx:for="{{devices}}" wx:key="index" data-device-id="{{item.deviceId}}" data-name="{{item.name || item.localName}}" class="device_item">
- <view class="bluetooth-status-box">
- <view class="bluebooth-status-line">
- <view class="bluebooth-status-image-view">
- <image id="{{item.icon}}" src='/images/bluebooth.png'></image>
- </view>
- <view class="bluebooth-status-name-view">
- <text>{{item.name}}</text>
- </view>
- </view>
- <view class="bluebooth-status-info-sub">
- <text>信号强度: {{item.RSSI}}dBm ({{utils.max(0, item.RSSI + 100)}}%)</text>
- </view>
- <view class="bluebooth-status-info-sub">
- <text>UUID: {{item.deviceId}}</text>
- </view>
- </view>
- <view class="bluebooth-process-box">
- <view class="bluebooth-process-btn">
- <button style="margin-right: 10px;" hover-class='blue-icon-button-hover' size="mini" data-device-id="{{item.deviceId}}" data-name="{{item.name || item.localName}}" bindtouchend="onBLEConnectionHandle">连接设备</button>
- </view>
- </view>
- </view>
- </view>
- <view class="devices_summary">
- <text>最近连接的设备: </text>
- </view>
- <view class="devicesBox">
- <view wx:for="{{alreadyConnectDevices}}" wx:key="index" data-device-id="{{item.deviceId}}" data-name="{{item.name || item.localName}}" class="device_item">
- <view class="bluetooth-status-box">
- <view class="bluebooth-status-line">
- <view class="bluebooth-status-image-view">
- <image id="{{item.icon}}" src='/images/bluebooth.png'></image>
- </view>
- <view class="bluebooth-status-name-view">
- <text>{{item.name}}</text>
- </view>
- </view>
- <!-- <view class="bluebooth-status-info-sub">
- <text>信号强度: {{item.RSSI}}dBm ({{utils.max(0, item.RSSI + 100)}}%)</text>
- </view> -->
- <view class="bluebooth-status-info-sub">
- <text>UUID: {{item.deviceId}}</text>
- </view>
- </view>
- <view class="bluebooth-process-box">
- <view class="bluebooth-process-btn">
- <button style="margin-right: 10px;" hover-class='blue-icon-button-hover' size="mini" data-device-id="{{item.deviceId}}" data-name="{{item.name || item.localName}}" bindtouchend="onBLEConnectionHandle">连接设备</button>
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </view>
- <mp-dialog title="操作提示" show="{{showBleOpenFailDig}}" bindbuttontap="bluetoothOpenEvent" buttons="{{[ {text: '取消'}, {text: '重试'}]}}">
- <view>当前蓝牙不可用,请检查手机蓝牙是否已打开后再试!</view>
- </mp-dialog>
- <mp-dialog title="操作提示" show="{{showBleOtherErrorDig}}" bindbuttontap="bluetoothOtherErrorEvent" buttons="{{[ {text: '确定'}]}}">
- <view>{{bleOtherErrorReeponseMsg}}</view>
- </mp-dialog>
- <!-- <view class="qrbtn">
- <button type="primary" bindtouchend="onStartQr">扫码连接</button>
- </view> -->
- <loading hidden="{{loadingHidden}}"></loading>
- </page>
|