diff --git a/miniprogram/model/index.js b/miniprogram/model/index.js index 6be31f8..5187cda 100644 --- a/miniprogram/model/index.js +++ b/miniprogram/model/index.js @@ -1 +1 @@ -export const VersionModel = '2.0.1F'; \ No newline at end of file +export const VersionModel = '2.0.2F'; \ No newline at end of file diff --git a/miniprogram/pages/home/home.js b/miniprogram/pages/home/home.js index 71dd454..cdd9a51 100644 --- a/miniprogram/pages/home/home.js +++ b/miniprogram/pages/home/home.js @@ -8,7 +8,9 @@ Page({ * 页面的初始数据 */ data: { - wlanList: [], //当前wlan列表 + wlanList: [ + /* {SSID: '测试', BSSID: 'dc:fe:18:85:a5:7c', frequency: 5259} */ + ], //当前wlan列表 isConnectWlan: null, //是否已经连接上WLAN connectWlanBssid: '', //当前连接WLAN的BSSID imei: '', //设备imei @@ -148,8 +150,8 @@ Page({ let that = this; wx.getConnectedWifi({ success(res) { - if(res) { - // 如果已经连接上WLAN + if(res && (res.wifi.frequency / 1000) < 2.5) { + // 如果已经连接上WLAN 并且是2.4G频段 that.setData({ isConnectWlan: true, connectWlanBssid: res.wifi.BSSID, @@ -198,6 +200,7 @@ Page({ let reqBody = { imei: this.data.imei, fenceId: this.data.fenceId, + wifiName: currentWlanInfo.SSID, wifiInfo: currentWlanInfo.BSSID }; // 请求url分为:基础url + 接口Url @@ -218,10 +221,6 @@ Page({ showCancel: false }) }) - } else { - wx.setClipboardData({ - data: `${currentWlanInfo.BSSID}`, - }) } } }) @@ -245,7 +244,11 @@ Page({ // 筛选wifi名称为空的数据 let wifiList = result.wifiList.filter(item => { return item.SSID !== ''; + }).filter(item => { + // 筛选 2.4GHZ的wifi + return item.frequency ? ( item.frequency / 1000 ) < 2.5 : item; }); + console.log("可用的wifi列表", wifiList); // ,如果有已连接的wifi则将已连接的wifi移动到第一位,否则不做任何操作 if(that.data.connectWlanBssid !== '') { //let newWifiList = that.data.wlanList; diff --git a/miniprogram/pages/home/home.wxml b/miniprogram/pages/home/home.wxml index 6a11b37..09fef15 100644 --- a/miniprogram/pages/home/home.wxml +++ b/miniprogram/pages/home/home.wxml @@ -1,7 +1,7 @@ - 设备不支持5G类型以及机场,酒店等热点WLAN。如未获取到,请打开WIFI和GPS后刷新页面。点击WLAN即可查看对应的WlAN信息。 + 设备不支持5G类型以及机场,酒店等热点WLAN。如未获取到,请打开WIFI和GPS后刷新页面。点击WLAN即可查看对应的WLAN信息。 @@ -13,8 +13,8 @@ - (当前手机连接网络) {{wlanList[index].SSID}} + (当前手机连接网络) diff --git a/miniprogram/project.config.json b/miniprogram/project.config.json index b2b834d..3599d39 100644 --- a/miniprogram/project.config.json +++ b/miniprogram/project.config.json @@ -18,7 +18,8 @@ "ignore": [], "disablePlugins": [], "outputPath": "" - } + }, + "uglifyFileName": true }, "condition": {}, "editorSetting": { diff --git a/miniprogram/project.private.config.json b/miniprogram/project.private.config.json index b6ff74b..0a9e27b 100644 --- a/miniprogram/project.private.config.json +++ b/miniprogram/project.private.config.json @@ -11,11 +11,12 @@ { "name": "", "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", "scene": null } ] } - } + }, + "libVersion": "2.28.1" } \ No newline at end of file diff --git a/miniprogram/readme.md b/miniprogram/readme.md index 423b254..d35a1a8 100644 --- a/miniprogram/readme.md +++ b/miniprogram/readme.md @@ -11,3 +11,9 @@ - 更新内容 - A 增加获取授权和保存WIFIBSSID信息接口 +- 2.0.2 + - 2022.12.29 + ## 功能更新 + - 更新内容 + - U 修改保存WIFIBSSID信息接口参数 + - A 增加 根据WifiInfo中frequency字段过滤非2.4GHZ的WIFI信息 \ No newline at end of file