1、第一次進入 調用 wx.openBluetoothAdapter 正常
2、用 <navigator class=“leave-btn” open-type=“exit” target=“miniProgram” @tap=“alreadyLeave”>已離場</navigator> 退出小程序
3、再次打開進入 卡死了, 無法 調用 this.initBluetooth() 裡面的 wx.openBluetoothAdapter
onShow() {
this.getAppAuth()
console.log('start up on show ', moment().format(‘YYYY-MM-DD HH:mm:ss’))
if (this.init === false) {
// 預防進入兩次,小程序機制bug
this.init = true
const value = wx.getStorageSync(‘WXOpenId’)
console.log('value ', value)
if (value) {
globalStore.wxOpenId = value
}
if (globalStore.wxOpenId === ‘’){
getToken(this.loginWX(), this.getTokenSuccess, this.getTokenFail);
}
else{
wx.getSystemInfo({
success: res => {
console.log(‘model:’ + res.model)
console.log(‘pixelRatio:’ + res.pixelRatio)
console.log(‘windowWidth:’ + res.windowWidth)
console.log(‘windowHeight:’ + res.windowHeight)
console.log(‘language:’ + res.language)
console.log(‘version:’ + res.version)
console.log(‘platform:’ + res.platform)
globalStore.phoneSystem = res.platform
globalStore.phoneSystemVersion = res.version
if(globalStore.phoneSystem === ‘devtools’){
globalStore.devParkType === ‘1’ ? this.isMarkLocation() : wx.redirectTo({ url: ‘confirm-info’ })
}
else{
this.initBluetooth()
}
},
fail: res => {
// curThis.bleError = res.errCode + ’ ’ + res.errMsg;
}
})
}
}
}
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)