export function startWifi() { return new Promise((resolve, reject) => { uni.startWifi({ success: () => { console.log('startWifi success'); resolve() }, fail: () => { console.log('startWifi fail'); reject() } }) }) } export function stopWifi() { return new Promise((resolve, reject) => { uni.stopWifi({ success: () => { console.log('stopWifi success'); resolve() }, fail: () => { console.log('stopWifi fail'); reject() } }) }) } export function onGetWifiListAfter() { return new Promise((resolve, reject) => { uni.getWifiList({ success() { setTimeout(resolve, 500) }, fail: reject, complete() { stopWifi() } }) }) }