fix: BLE reconnect stuck on binding state
- onRetry clears bind_result listener before disconnect - Add 1s delay after closeBluetoothAdapter before re-scanning - Fix binding state text from '点击连接' to '正在配对...'
这个提交包含在:
@@ -92,8 +92,15 @@ Page({
|
||||
},
|
||||
|
||||
onRetry: function () {
|
||||
var self = this
|
||||
if (self._onBindResult) {
|
||||
ble.off('bind_result', self._onBindResult)
|
||||
self._onBindResult = null
|
||||
}
|
||||
ble.disconnect()
|
||||
this.startBleConnect()
|
||||
setTimeout(function () {
|
||||
self.startBleConnect()
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
onMockConnect: function () {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<view class="found-card" wx:if="{{state === 'binding'}}">
|
||||
<view class="found-icon">💆</view>
|
||||
<view class="found-name">光子美容仪-{{deviceId}}</view>
|
||||
<text class="status-badge status-badge-green">点击连接</text>
|
||||
<text class="status-badge status-badge-green">正在配对...</text>
|
||||
</view>
|
||||
|
||||
<view class="found-card" wx:if="{{state === 'error'}}">
|
||||
|
||||
在新工单中引用
屏蔽一个用户