|
@@ -28,13 +28,13 @@ Page({
|
|
wx.offAppShow(this.getSetting);
|
|
wx.offAppShow(this.getSetting);
|
|
wx.onAppShow(this.getSetting);
|
|
wx.onAppShow(this.getSetting);
|
|
this.getSetting();
|
|
this.getSetting();
|
|
- if(options.isLognlink) {
|
|
|
|
|
|
+ if (options.isLognlink) {
|
|
this.setData({
|
|
this.setData({
|
|
isNotruter: true,
|
|
isNotruter: true,
|
|
nvabarData: {
|
|
nvabarData: {
|
|
showCapsule: 1,
|
|
showCapsule: 1,
|
|
title: '连接配网',
|
|
title: '连接配网',
|
|
- callback: ()=> {
|
|
|
|
|
|
+ callback: () => {
|
|
wx.switchTab({
|
|
wx.switchTab({
|
|
url: "./../index/index"
|
|
url: "./../index/index"
|
|
})
|
|
})
|
|
@@ -51,34 +51,32 @@ Page({
|
|
getSetting() {
|
|
getSetting() {
|
|
const _this = this;
|
|
const _this = this;
|
|
wx.getSetting({
|
|
wx.getSetting({
|
|
- success (res) {
|
|
|
|
- if(res.authSetting["scope.userFuzzyLocation"]) {
|
|
|
|
|
|
+ success(res) {
|
|
|
|
+ if (res.authSetting["scope.userFuzzyLocation"]) {
|
|
// 成功
|
|
// 成功
|
|
app.getBluetoothStatus();
|
|
app.getBluetoothStatus();
|
|
_this.setData({
|
|
_this.setData({
|
|
userFuzzyLocation: true,
|
|
userFuzzyLocation: true,
|
|
});
|
|
});
|
|
- } else if(res.authSetting["scope.userFuzzyLocation"] === undefined) {
|
|
|
|
- _this.setData({
|
|
|
|
- userFuzzyLocation: false,
|
|
|
|
- });
|
|
|
|
- wx.authorize({
|
|
|
|
|
|
+ } else if (res.authSetting["scope.userFuzzyLocation"] === undefined) {
|
|
|
|
+
|
|
|
|
+ wx.authorize({
|
|
scope: "scope.userFuzzyLocation",
|
|
scope: "scope.userFuzzyLocation",
|
|
- success () {
|
|
|
|
|
|
+ success() {
|
|
_this.getSetting();
|
|
_this.getSetting();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
_this.setData({
|
|
_this.setData({
|
|
userFuzzyLocation: false,
|
|
userFuzzyLocation: false,
|
|
});
|
|
});
|
|
wx.showModal({
|
|
wx.showModal({
|
|
title: '请打开系统位置获取',
|
|
title: '请打开系统位置获取',
|
|
- success (res) {
|
|
|
|
|
|
+ success(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
console.log('用户点击确定')
|
|
console.log('用户点击确定')
|
|
wx.openSetting({
|
|
wx.openSetting({
|
|
- complete () {
|
|
|
|
|
|
+ complete() {
|
|
// _this.getSetting();
|
|
// _this.getSetting();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -91,18 +89,18 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- next(){
|
|
|
|
|
|
+ next() {
|
|
const _this = this;
|
|
const _this = this;
|
|
wx.openBluetoothAdapter({
|
|
wx.openBluetoothAdapter({
|
|
- success (res) {
|
|
|
|
- if(_this.data.scopeBluetooth && _this.data.userFuzzyLocation){
|
|
|
|
|
|
+ success(res) {
|
|
|
|
+ if (_this.data.scopeBluetooth && _this.data.userFuzzyLocation) {
|
|
wx.navigateTo({
|
|
wx.navigateTo({
|
|
url: './../deviceConnect1/deviceConnect1',
|
|
url: './../deviceConnect1/deviceConnect1',
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
fail(res) {
|
|
fail(res) {
|
|
- if(res.errCode === 10001) {
|
|
|
|
|
|
+ if (res.errCode === 10001) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '蓝牙未打开',
|
|
title: '蓝牙未打开',
|
|
icon: "none",
|
|
icon: "none",
|
|
@@ -112,22 +110,22 @@ Page({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- setBluetooth(){
|
|
|
|
|
|
+ setBluetooth() {
|
|
wx.openSetting({
|
|
wx.openSetting({
|
|
- complete () {
|
|
|
|
|
|
+ complete() {
|
|
// app.getBluetoothStatus();
|
|
// app.getBluetoothStatus();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- setUserFuzzyLocation(){
|
|
|
|
|
|
+ setUserFuzzyLocation() {
|
|
const _this = this;
|
|
const _this = this;
|
|
wx.openSetting({
|
|
wx.openSetting({
|
|
- complete () {
|
|
|
|
|
|
+ complete() {
|
|
// _this.getSetting();
|
|
// _this.getSetting();
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- notRoter(){
|
|
|
|
|
|
+ notRoter() {
|
|
getCurrentPages()[0].onLoad();
|
|
getCurrentPages()[0].onLoad();
|
|
wx.switchTab({
|
|
wx.switchTab({
|
|
url: "./../index/index"
|
|
url: "./../index/index"
|