Files
bodyWeight/components/replaceNetwork_1/replaceNetwork_1.js
T
2025-05-29 14:43:32 +08:00

42 lines
904 B
JavaScript

const app = getApp();
Component({
data: {
wifiList: []
},
// 生命周期方法
lifetimes: {
attached() {
},
detached() {
}
},
// 组件的方法
methods: {
getWiFiList() {
wx.showLoading({
title: "正在获取Wi-Fi列表...",
mask: true
});
app.globalData.ppScale.activeProtocol.dataFindSurroundDevice((res) => {
console.log("connectedDevice ===》dataFindSurroundDevice", res);
wx.hideLoading();
this.setData({
wifiList: res
})
})
},
selectDevice(e) {
this.triggerEvent('wifiEvent', {
status: true,
data: e.currentTarget.dataset.item
});
}
}
});