Step 1: Open the wifi interface, and hang up the interface to get the wifi list after success
wx.startWifi({
success:
function
(res) {
wx.getWifiList({
})
}
})
Step 2: Listen to the event (wx.getWifiList) when the Wi-Fi list data is obtained, and the wifiList data will be returned in the callback
wx.onGetWifiList(
function
(CALLBACK){
var
a = CALLBACK.wifiList;
var
showlist = that.data.showlist;
that.setData({
showlist:a
})
console.log(a);
});