|
@@ -58,18 +58,17 @@ App({
|
|
|
///显示界面
|
|
|
wx.onAppShow(() => {
|
|
|
if (that.globalData.userInfo !== null) {
|
|
|
- if (that.globalData.client) {
|
|
|
- that.globalData.client.end(true);
|
|
|
+ if (!(that.globalData.client && that.globalData.client.connected)) {
|
|
|
+ that.connect();
|
|
|
}
|
|
|
- that.connect();
|
|
|
- };
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
///界面后台化
|
|
|
wx.onAppHide(() => {
|
|
|
- if (that.globalData.client && that.globalData.client.connected) {
|
|
|
- that.globalData.client.end(true);
|
|
|
- };
|
|
|
+ // if (that.globalData.client && that.globalData.client.connected) {
|
|
|
+ // that.globalData.client.end(true);
|
|
|
+ // };
|
|
|
});
|
|
|
|
|
|
// that.getBluetoothStatus();
|