Browse Source

- 更新内容

- U 修改保存WIFIBSSID信息接口参数
        - A 增加 根据WifiInfo中frequency字段过滤非2.4GHZ的WIFI信息
feat
JinxChen 1 year ago
parent
commit
2ac20338ae
6 changed files with 24 additions and 13 deletions
  1. +1
    -1
      miniprogram/model/index.js
  2. +10
    -7
      miniprogram/pages/home/home.js
  3. +2
    -2
      miniprogram/pages/home/home.wxml
  4. +2
    -1
      miniprogram/project.config.json
  5. +3
    -2
      miniprogram/project.private.config.json
  6. +6
    -0
      miniprogram/readme.md

+ 1
- 1
miniprogram/model/index.js View File

@@ -1 +1 @@
export const VersionModel = '2.0.1F';
export const VersionModel = '2.0.2F';

+ 10
- 7
miniprogram/pages/home/home.js View File

@@ -8,7 +8,9 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
wlanList: [], //当前wlan列表
wlanList: [
/* {SSID: '测试', BSSID: 'dc:fe:18:85:a5:7c', frequency: 5259} */
], //当前wlan列表
isConnectWlan: null, //是否已经连接上WLAN isConnectWlan: null, //是否已经连接上WLAN
connectWlanBssid: '', //当前连接WLAN的BSSID connectWlanBssid: '', //当前连接WLAN的BSSID
imei: '', //设备imei imei: '', //设备imei
@@ -148,8 +150,8 @@ Page({
let that = this; let that = this;
wx.getConnectedWifi({ wx.getConnectedWifi({
success(res) { success(res) {
if(res) {
// 如果已经连接上WLAN
if(res && (res.wifi.frequency / 1000) < 2.5) {
// 如果已经连接上WLAN 并且是2.4G频段
that.setData({ that.setData({
isConnectWlan: true, isConnectWlan: true,
connectWlanBssid: res.wifi.BSSID, connectWlanBssid: res.wifi.BSSID,
@@ -198,6 +200,7 @@ Page({
let reqBody = { let reqBody = {
imei: this.data.imei, imei: this.data.imei,
fenceId: this.data.fenceId, fenceId: this.data.fenceId,
wifiName: currentWlanInfo.SSID,
wifiInfo: currentWlanInfo.BSSID wifiInfo: currentWlanInfo.BSSID
}; };
// 请求url分为:基础url + 接口Url // 请求url分为:基础url + 接口Url
@@ -218,10 +221,6 @@ Page({
showCancel: false showCancel: false
}) })
}) })
} else {
wx.setClipboardData({
data: `${currentWlanInfo.BSSID}`,
})
} }
} }
}) })
@@ -245,7 +244,11 @@ Page({
// 筛选wifi名称为空的数据 // 筛选wifi名称为空的数据
let wifiList = result.wifiList.filter(item => { let wifiList = result.wifiList.filter(item => {
return item.SSID !== ''; return item.SSID !== '';
}).filter(item => {
// 筛选 2.4GHZ的wifi
return item.frequency ? ( item.frequency / 1000 ) < 2.5 : item;
}); });
console.log("可用的wifi列表", wifiList);
// ,如果有已连接的wifi则将已连接的wifi移动到第一位,否则不做任何操作 // ,如果有已连接的wifi则将已连接的wifi移动到第一位,否则不做任何操作
if(that.data.connectWlanBssid !== '') { if(that.data.connectWlanBssid !== '') {
//let newWifiList = that.data.wlanList; //let newWifiList = that.data.wlanList;


+ 2
- 2
miniprogram/pages/home/home.wxml View File

@@ -1,7 +1,7 @@
<view class="home-container"> <view class="home-container">
<!--header --> <!--header -->
<view class="header"> <view class="header">
<text>设备不支持5G类型以及机场,酒店等热点WLAN。如未获取到,请打开WIFI和GPS后刷新页面。点击WLAN即可查看对应的WlAN信息。</text>
<text>设备不支持5G类型以及机场,酒店等热点WLAN。如未获取到,请打开WIFI和GPS后刷新页面。点击WLAN即可查看对应的WLAN信息。</text>
</view> </view>
<!-- list --> <!-- list -->
<view class="disable-wlan"> <view class="disable-wlan">
@@ -13,8 +13,8 @@
<view class="wlan-list" wx:if="{{wlanList.length > 0}}"> <view class="wlan-list" wx:if="{{wlanList.length > 0}}">
<view class="wlan-item" wx:for="{{wlanList}}" wx:key="index"> <view class="wlan-item" wx:for="{{wlanList}}" wx:key="index">
<view bindtap="onSave" data-name="{{wlanList[index]}}" class="{{ index === 0 && isConnectWlan ? 'isConnect' : ''}}"> <view bindtap="onSave" data-name="{{wlanList[index]}}" class="{{ index === 0 && isConnectWlan ? 'isConnect' : ''}}">
<text class="wlan-item-text" wx:if="{{index === 0 && isConnectWlan}}">(当前手机连接网络)</text>
{{wlanList[index].SSID}} {{wlanList[index].SSID}}
<text class="wlan-item-text" wx:if="{{index === 0 && isConnectWlan}}">(当前手机连接网络)</text>
</view> </view>
</view> </view>
</view> </view>


+ 2
- 1
miniprogram/project.config.json View File

@@ -18,7 +18,8 @@
"ignore": [], "ignore": [],
"disablePlugins": [], "disablePlugins": [],
"outputPath": "" "outputPath": ""
}
},
"uglifyFileName": true
}, },
"condition": {}, "condition": {},
"editorSetting": { "editorSetting": {


+ 3
- 2
miniprogram/project.private.config.json View File

@@ -11,11 +11,12 @@
{ {
"name": "", "name": "",
"pathName": "pages/home/home", "pathName": "pages/home/home",
"query": "imei=861281060007642&fenceId=a29c0f2d-9943-4e70-9a0e-efc00dc87d07&appType=0&env=test",
"query": "imei=864002050137844&fenceId=09bc40aa-24f8-4903-9e1f-0f6c08f57eda&appType=0&env=test",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
} }
] ]
} }
}
},
"libVersion": "2.28.1"
} }

+ 6
- 0
miniprogram/readme.md View File

@@ -11,3 +11,9 @@
- 更新内容 - 更新内容
- A 增加获取授权和保存WIFIBSSID信息接口 - A 增加获取授权和保存WIFIBSSID信息接口


- 2.0.2
- 2022.12.29
## 功能更新
- 更新内容
- U 修改保存WIFIBSSID信息接口参数
- A 增加 根据WifiInfo中frequency字段过滤非2.4GHZ的WIFI信息

Loading…
Cancel
Save