fix: wear-check page stuck spinning in vendor_33 mode

- vendor_33 mode skips BLE wear detection (protocol doesn't support it)
  and passes check immediately if device is connected
- Show error message if device is not connected
- Retry button navigates back if disconnected instead of re-checking
这个提交包含在:
Guoguo
2026-05-12 06:34:52 -07:00
父节点 f69da211ab
当前提交 4149c35a0a
@@ -38,6 +38,17 @@ Page({
var self = this var self = this
self.setData({ checking: true, result: null, error: '' }) self.setData({ checking: true, result: null, error: '' })
if (!ble.isConnected()) {
self.setData({ checking: false, result: 'fail', error: '设备未连接,请返回重新连接' })
return
}
var protocol = require('../../services/ble/protocol')
if (protocol.PROTOCOL_MODE === 'vendor_33') {
self.setData({ checking: false, result: 'ok', connected: true })
return
}
if (this._onStatus) ble.off('status', this._onStatus) if (this._onStatus) ble.off('status', this._onStatus)
this._onStatus = function (status) { this._onStatus = function (status) {
self.setData({ checking: false }) self.setData({ checking: false })
@@ -66,6 +77,10 @@ Page({
}, },
onRetry: function () { onRetry: function () {
if (!ble.isConnected()) {
wx.navigateBack()
return
}
this.checkWearing() this.checkWearing()
}, },