Explorar el Código

feature: 适配君正wifi连接处理

332777428@qq.com hace 6 meses
padre
commit
896b90de8c

+ 5 - 1
pages/pageB/deviceConnect2/deviceConnect2.js

@@ -103,7 +103,11 @@ Page({
         // 搜索到蓝牙
         if (options.result) {
           var devicesList = options.data.filter((v) => {
-            return v.name.indexOf(lexin_devices.leXin) !== -1;
+            var isLeXin=v.name.indexOf(lexin_devices.leXin) !== -1;
+            var isJunZheng1=v.name.indexOf(lexin_devices.junZheng1) !== -1;
+            var isJunZheng2=v.name.indexOf(lexin_devices.junZheng2) !== -1;
+            var isJunZheng3=v.name.indexOf(lexin_devices.junZheng3) !== -1;
+            return isLeXin||(isJunZheng1&&!isJunZheng3)||(isJunZheng2&&!isJunZheng3);
           });
 
           if (!strings.isEmpty(devicesList)) {

+ 0 - 1
pages/pageC/deviceWake/deviceWake.js

@@ -348,7 +348,6 @@ Page({
       //     other: alarm_id_0
       //   });
       // }
-
       //   }
       // }, 500);
     } else {

+ 3 - 0
utils/lexin/devices.js

@@ -18,5 +18,8 @@ const clientTypes = ["MW-2AX(WIFI)", "MW-2AX(WIFI-N)", "MW-2AX(A)",
 
 module.exports = {
   leXin: leXin,
+  junZheng1: junZheng1,
+  junZheng2: junZheng2,
+  junZheng3: junZheng3,
   clientTypes: clientTypes,
 }

+ 19 - 5
utils/lexin/util.js

@@ -16,18 +16,32 @@ function getMacBySplitDeviceId(splitDeviceId) {
 
 function getMacByDeviceId(deviceId) {
   const lexin_devices = require('../lexin/devices');
-  var splitDeviceId = deviceId.split(lexin_devices.leXin);
-  if (splitDeviceId.length != 2) {
+  var deviceIdLeXin = deviceId.split(lexin_devices.leXin);
+  var deviceIdJunZheng1 = deviceId.split(lexin_devices.junZheng1);
+  var deviceIdJunZheng2 = deviceId.split(lexin_devices.junZheng2);
+  var deviceIdJunZheng3 = deviceId.split(lexin_devices.junZheng13);
+  var isLeXin = deviceIdLeXin.length == 2;
+  var isJunZheng1 = deviceIdJunZheng1.length == 2;
+  var isJunZheng2 = deviceIdJunZheng2.length == 2;
+  var isJunZheng3 = deviceIdJunZheng3.length == 2;
+  if (!isLeXin && !(isJunZheng1 && !isJunZheng3) && !(isJunZheng2 && !isJunZheng3)) {
     return "";
   }
-  return getMacBySplitDeviceId(splitDeviceId[1]);
+  return getMacBySplitDeviceId(deviceIdLeXin[1]);
 };
 
 ///获取设备mac相关
 function getDeviceMacId(deviceId) {
   const lexin_devices = require('../lexin/devices');
-  var splitDeviceId = deviceId.split(lexin_devices.leXin);
-  if (splitDeviceId.length != 2) {
+  var deviceIdLeXin = deviceId.split(lexin_devices.leXin);
+  var deviceIdJunZheng1 = deviceId.split(lexin_devices.junZheng1);
+  var deviceIdJunZheng2 = deviceId.split(lexin_devices.junZheng2);
+  var deviceIdJunZheng3 = deviceId.split(lexin_devices.junZheng13);
+  var isLeXin = deviceIdLeXin.length == 2;
+  var isJunZheng1 = deviceIdJunZheng1.length == 2;
+  var isJunZheng2 = deviceIdJunZheng2.length == 2;
+  var isJunZheng3 = deviceIdJunZheng3.length == 2;
+  if (!isLeXin && !(isJunZheng1 && !isJunZheng3) && !(isJunZheng2 && !isJunZheng3)) {
     return "";
   }
   var mac = getMacBySplitDeviceId(splitDeviceId[1]);