|
@@ -214,13 +214,17 @@ Page({
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ that.gotoProvision()
|
|
|
|
|
+ },
|
|
|
|
|
+// 获取Wifi
|
|
|
|
|
+ getWifiInfo: function () {
|
|
|
wx.startWifi({
|
|
wx.startWifi({
|
|
|
success(res) {
|
|
success(res) {
|
|
|
//console.log(' ================== startWifi ================== ');
|
|
//console.log(' ================== startWifi ================== ');
|
|
|
//console.log(res);
|
|
//console.log(res);
|
|
|
wx.getConnectedWifi({
|
|
wx.getConnectedWifi({
|
|
|
success(res) {
|
|
success(res) {
|
|
|
- that.getWifiInfo();
|
|
|
|
|
},
|
|
},
|
|
|
fail: function (err) {
|
|
fail: function (err) {
|
|
|
console.log(' ================== startWifi fail ================== ');
|
|
console.log(' ================== startWifi fail ================== ');
|
|
@@ -234,10 +238,6 @@ Page({
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- that.gotoProvision()
|
|
|
|
|
- },
|
|
|
|
|
-// 获取Wifi
|
|
|
|
|
- getWifiInfo: function () {
|
|
|
|
|
const self = this;
|
|
const self = this;
|
|
|
wx.startWifi({
|
|
wx.startWifi({
|
|
|
success(res) {
|
|
success(res) {
|
|
@@ -246,7 +246,8 @@ Page({
|
|
|
wx.getConnectedWifi({
|
|
wx.getConnectedWifi({
|
|
|
success(res) {
|
|
success(res) {
|
|
|
self.setData({
|
|
self.setData({
|
|
|
- wifiInfo: res.wifi
|
|
|
|
|
|
|
+ wifiInfo: res.wifi,
|
|
|
|
|
+ ssid: res.wifi.SSID
|
|
|
});
|
|
});
|
|
|
//console.log('== getConnectedWifi ==');
|
|
//console.log('== getConnectedWifi ==');
|
|
|
//console.log(res);
|
|
//console.log(res);
|
|
@@ -587,6 +588,7 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
*/
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
|
|
+ this.getWifiInfo();
|
|
|
if (options.type && options.type == "edit") {
|
|
if (options.type && options.type == "edit") {
|
|
|
wx.setNavigationBarTitle({
|
|
wx.setNavigationBarTitle({
|
|
|
title:"编辑床垫"
|
|
title:"编辑床垫"
|