更换WIFI
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
const app = getApp();
|
||||
|
||||
Component({
|
||||
data: {
|
||||
wifiList: []
|
||||
},
|
||||
|
||||
// 生命周期方法
|
||||
lifetimes: {
|
||||
attached() {
|
||||
|
||||
},
|
||||
detached() {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
// 组件的方法
|
||||
methods: {
|
||||
getWiFiList() {
|
||||
app.globalData.ppScale.activeProtocol.dataFindSurroundDevice((res) => {
|
||||
console.log("connectedDevice ===》dataFindSurroundDevice", res);
|
||||
|
||||
this.setData({
|
||||
wifiList: res
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
selectDevice(e) {
|
||||
this.triggerEvent('wifiEvent', {
|
||||
status: true,
|
||||
data: e.currentTarget.dataset.item
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<view class="replaceNetwork1">
|
||||
<view class="title">
|
||||
<view>可用Wi-Fi</view>
|
||||
<view>网络列表(设备暂不支持5GWi-Fi网络)</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<scroll-view class="scrollView" scroll-y>
|
||||
<view class="scrollViewContent">
|
||||
<block wx:for="{{wifiList}}" wx:key="index">
|
||||
<view data-item="{{item}}" bind:tap="selectDevice" class="~arrowAfter">
|
||||
<view>
|
||||
<image src="/images/replaceNetwork/wifi.png" />
|
||||
</view>
|
||||
<view>{{item.ssid}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,71 @@
|
||||
.replaceNetwork1 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-top: 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
padding: 0 60rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.title>view:nth-of-type(1) {
|
||||
color: #252535;
|
||||
width: 100%;
|
||||
height: 48rpx;
|
||||
font-size: 48rpx;
|
||||
font-weight: bold;
|
||||
line-height: 48rpx;
|
||||
margin-bottom: 48rpx;
|
||||
}
|
||||
|
||||
.title>view:nth-of-type(2) {
|
||||
color: #B6B6B6;
|
||||
width: 100%;
|
||||
height: 30rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
height: calc(100% - 166rpx);
|
||||
}
|
||||
|
||||
.scrollView {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.scrollViewContent {
|
||||
width: 100%;
|
||||
padding: 0 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.scrollViewContent>view {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.scrollViewContent>view>view:nth-of-type(1) {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.scrollViewContent>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