Commit b2b479ae by 姜雷

扫码进入后先释放蓝牙

parent 3a7c1ac7
...@@ -214,9 +214,18 @@ class Pay extends Component { ...@@ -214,9 +214,18 @@ class Pay extends Component {
} }
checkBluetoothAndWs() { checkBluetoothAndWs() {
if (this.checkIsShower()) { if (this.checkIsShower()) {
console.log('打开蓝牙和WebSocket'); this.closeBluetooth()
this.openBluetooth(); .then(() => {
this.connectDeviceSocket(); console.log('打开蓝牙和WebSocket');
this.openBluetooth();
this.connectDeviceSocket();
})
.catch(err => {
console.log(err);
console.log(err, '打开蓝牙和WebSocket');
this.openBluetooth();
this.connectDeviceSocket();
});
} }
} }
...@@ -271,7 +280,7 @@ class Pay extends Component { ...@@ -271,7 +280,7 @@ class Pay extends Component {
} }
closeBluetooth() { closeBluetooth() {
Taro.closeBluetoothAdapter(); return Taro.closeBluetoothAdapter();
} }
warnBluetoothOpen() { warnBluetoothOpen() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment