微信小程式條件渲染
- 在小程式app,json中添加
- 需要先獲取位置資訊
"permission": {
"scope.userLocation": {
"desc": "你的位置資訊將用于小程式位置介面的效果展示"
}
},
- 才可以獲取wifi資訊
wx.startWifi({ //初始化wifi
success: function(res) {
console.log(res.errMsg + "11654");
wx.getWifiList({ //成功后,就可以獲取串列了
success: function(res) {
console.log(res);
//串列獲取成功后,要到事件里提取
wx.onGetWifiList(function(res) {
console.log("獲取wifi串列");
console.log(res.wifiList); //在這里提取串列資料
that.wifiList = res.wifiList
})
}
});
}
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/235375.html
標籤:其他
上一篇:簡潔404頁面原始碼 | 自適應404頁面HTML好看的404原始碼下載
下一篇:浮動
