Browse Source

feature: 调整设备连接状态的更新

332777428@qq.com 3 months ago
parent
commit
f0743e1172

+ 4 - 2
pages/pageB/deviceConnect2/deviceConnect2.js

@@ -149,7 +149,9 @@ Page({
               devicesList: [],
               isOnBluetooth: false,
             });
-            var param = 'deviceId=' + options.data.deviceId + '&name=' + options.data.name + "&param=" + param;
+
+            var p = JSON.stringify(that.data.connectDevice);
+            var param = '?deviceId=' + options.data.deviceId + '&name=' + options.data.name + "&param=" + p;
             routeUtil.redirectParam(routePath.deviceConnect3, param);
           }, 200);
         } else {
@@ -209,7 +211,7 @@ Page({
     var isJungzheng2 = junzhengUtil.isJungzheng2(name);
 
     if (isJungzheng1 || isJungzheng2) {
-      var param = 'deviceId=' + deviceId + '&name=' + name + "&param=" + JSON.stringify(that.data.connectDevice)
+      var param = '?deviceId=' + deviceId + '&name=' + name + "&param=" + JSON.stringify(that.data.connectDevice);
       routeUtil.redirectParam(routePath.deviceConnect4, param);
       return;
     }

+ 1 - 0
pages/pageB/deviceConnect3/deviceConnect3.js

@@ -29,6 +29,7 @@ Page({
   },
 
   onLoad: function (options) {
+    console.log("gadsfasdfqwerqwerq===000");
     var that = this;
     var param = options.param;
     if (!strings.isEmpty(param)) {

+ 6 - 6
utils/blue_ble/util.js

@@ -127,22 +127,22 @@ class BleUtil {
   }
 
   sendWiFiInfo(wifiName, pwd) {
-    const hex_util = require('../hex_util');
+    const hexUtil = require('../hexUtil');
     let result = [];
 
     // 字母*6 +
-    let wifiList = hex_util.string2ListInt(wifiName);
+    let wifiList = hexUtil.string2ListInt(wifiName);
 
     // 数字*3 +
-    let pwdList = hex_util.string2ListInt(pwd);
+    let pwdList = hexUtil.string2ListInt(pwd);
 
     // 16进制
     result.push(0x22);
-    result.push(parseInt(hex_util.int2Hex(wifiList.length + pwdList.length + 6), 16));
+    result.push(parseInt(hexUtil.int2Hex(wifiList.length + pwdList.length + 6), 16));
 
     // 账号
     result.push(0x33);
-    result.push(parseInt(hex_util.int2Hex(wifiList.length), 16));
+    result.push(parseInt(hexUtil.int2Hex(wifiList.length), 16));
 
     let p = result[3] + 4;
     let j = 0;
@@ -152,7 +152,7 @@ class BleUtil {
 
     // 密码
     result.splice(p, 0, 0x44);
-    result.splice(++p, 0, parseInt(hex_util.int2Hex(pwdList.length), 16));
+    result.splice(++p, 0, parseInt(hexUtil.int2Hex(pwdList.length), 16));
     p++;
     j = 0;
     for (let i = p; i < p + pwdList.length; i++) {