小程序wifi接口获取列表数据

第一步:打开wifi接口,成功后吊起获取wifi列表的接口

wx.startWifi({

success: function (res) {
        wx.getWifiList({
        })
      }
})

第二步:监听在获取到 Wi-Fi 列表数据时的事件(wx.getWifiList),在回调中将返回 wifiList数据
wx.onGetWifiList( function (CALLBACK){
      var a = CALLBACK.wifiList;
      var showlist = that.data.showlist;
      that.setData({
        showlist:a
      })
      console.log(a);
    });

猜你喜欢

转载自blog.csdn.net/laoguile/article/details/80054190
今日推荐