|
@@ -316,6 +316,14 @@ class bleManager {
|
|
|
|
|
|
///做搜索蓝牙适配器权限
|
|
|
const permission_util = require('../utils/permission_util');
|
|
|
+ // var location = await permission_util.getSetting()
|
|
|
+ // if (!location) {
|
|
|
+ // if (boolean != null) {
|
|
|
+ // boolean(false);
|
|
|
+ // console.log("没有定位权限")
|
|
|
+ // }
|
|
|
+ // return
|
|
|
+ // }
|
|
|
var available = await permission_util.openBluetoothAdapter();
|
|
|
that.isAvailable = available;
|
|
|
if (!available) {
|
|
@@ -397,9 +405,14 @@ class bleManager {
|
|
|
that.compareList = [];
|
|
|
},
|
|
|
fail(err) {
|
|
|
- console.log("开始搜索设备失败", res);
|
|
|
+ console.log("开始搜索设备失败", err);
|
|
|
that.doStartScaning = false;
|
|
|
that.requestBlueTime = time_util.getCurrentMills();
|
|
|
+ if (err.errMsg.indexOf("location") >= 0) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '搜索失败,请检查下手机设置的微信定位权限是否开启',
|
|
|
+ })
|
|
|
+ }
|
|
|
if (boolean != null) {
|
|
|
boolean(false);
|
|
|
}
|