HomeDocs
跳到主要内容

getWifiList

简介

请求获取 wifi 列表 (高 Android 版本前台应用 2 分钟内只能使用 4 次)

入参

示例代码

Page({
data: {
wifiStatus: '',
getWifiListStatus: '',
},
onReady() {
this.startWifi().then(() => {
this.getWifiList();
});
},
startWifi() {
const _that = this;
return new Promise((resolve, reject) => {
dlt.startWifi({
success: function (res) {
console.log('startWifi success', res);
_that.setData({
wifiStatus: 'startWifi',
});
resolve(res);
},
complete: function (res) {
console.log('startWifi complete', res);
},
fail: function (res) {
console.log('startWifi fail', res);
reject(res);
},
});
});
},
getWifiList() {
const _that = this;
dlt.getWifiList({
success: function (res) {
console.log('getWifiList success', res);
_that.setData({
getWifiListStatus: res,
});
},
complete: function (res) {
console.log('getWifiList complete', res);
},
fail: function (res) {
console.log('getWifiList fail', res);
_that.setData({
getWifiListStatus: res,
});
},
});
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.