From 2ac20338ae7d4b918584fcba63a755706c7fa91e Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Thu, 29 Dec 2022 17:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=20-=20=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20-=20U=20=E4=BF=AE=E6=94=B9=E4=BF=9D?= =?UTF-8?q?=E5=AD=98WIFIBSSID=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20=20=20=20=20=20=20=20=20-=20A=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20=E6=A0=B9=E6=8D=AEWifiInfo=E4=B8=ADfrequency=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=BF=87=E6=BB=A4=E9=9D=9E2.4GHZ=E7=9A=84WIFI?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/model/index.js | 2 +- miniprogram/pages/home/home.js | 17 ++++++++++------- miniprogram/pages/home/home.wxml | 4 ++-- miniprogram/project.config.json | 3 ++- miniprogram/project.private.config.json | 5 +++-- miniprogram/readme.md | 6 ++++++ 6 files changed, 24 insertions(+), 13 deletions(-) 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