<template>
<view >
<button @click="getWifiList">获取WiFi列表</button>
<scroll-view
:scroll-top="scrollTop"
scroll-y
class="content-pop"
>
<view
class="itemInfo"
v-for="(item, index) in wifiList"
:key="index"
>
<text>{
{ item.SSID }}</text>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
wifiList: [],
};
},
methods: {
getWifiList() {
// 获取手机型号
const sys = uni.getSystemInfoSync();
if (sys.platform == "android" && sys.parseInt(sys.system.substr(8) < 6) {
this.$tip.error("手机版本不支持");
return;
}
if (sys.platform == "ios" && sys.parseInt(sys.system.substr(4)) < 11.2) {
this.$tip.error("手机版本不支持");
return;
uniapp 小程序获取WiFi列表
于 2024-04-11 11:14:05 首次发布