wx.openBluetoothAdapter({
success: function (res) {
//检测蓝牙是否打开
wx.getBluetoothAdapterState({
success: function (res) {
//页面日志显示
if (res.available) {
callback();
} else {
console.log('打开蓝牙,操作更快');
}
},
fail: function (res) {}
});
},
fail: function (res) {
console.log('打开蓝牙,操作更快');
}
});