第一版
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
wifiList: []
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.initWifi();
|
||||
},
|
||||
|
||||
initWifi() {
|
||||
wx.showLoading({
|
||||
title: "正在获取Wi-Fi列表...",
|
||||
mask: true
|
||||
});
|
||||
app.globalData.ppScale.activeProtocol.dataFindSurroundDevice((res) => {
|
||||
wx.hideLoading();
|
||||
console.log("wifiList", res);
|
||||
this.setData({
|
||||
wifiList: res
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
openSetWifiPassword(e) {
|
||||
let item = JSON.stringify(e.currentTarget.dataset.item);
|
||||
wx.navigateTo({
|
||||
url: "/pages/setWifiPassword/setWifiPassword?item=" + item
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"disableScroll": true
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<view class="title">
|
||||
<view>可用Wi-Fi</view>
|
||||
<view>网络列表(设备暂不支持5GWi-Fi网络)</view>
|
||||
</view>
|
||||
|
||||
<view class="wifi">
|
||||
<scroll-view class="scrollView" scroll-y>
|
||||
<view class="content">
|
||||
<block wx:for="{{wifiList}}" wx:key="index">
|
||||
<view class="arrowAfter" data-item="{{item}}" bind:tap="openSetWifiPassword">
|
||||
<view>
|
||||
<image src="/images/getWifiList/icon.png" />
|
||||
</view>
|
||||
<view>{{item.ssid}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@@ -0,0 +1,64 @@
|
||||
page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
padding: 50rpx 55rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.title>view:first-of-type {
|
||||
color: #252535;
|
||||
width: 100%;
|
||||
height: 48rpx;
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
line-height: 48rpx;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.title>view:last-of-type {
|
||||
color: #B6B6B6;
|
||||
width: 100%;
|
||||
height: 30rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.wifi {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
padding: 0 55rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content>view {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
margin: 30rpx 0;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.content>view>view:nth-of-type(1) {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.content>view>view:nth-of-type(2) {
|
||||
color: #252535;
|
||||
flex: 1;
|
||||
width: 0;
|
||||
height: 80rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user