Browse Source

feature: 处理多个参数错位的问题

332777428@qq.com 6 months atrás
parent
commit
a3043b1455

+ 9 - 9
pages/pageA/deviceList/deviceList.js

@@ -1,6 +1,6 @@
 const app = getApp()
 import dRequest from '../../../request/deviceListRequest'
-import routeUtil from '../../../utils/route_util'
+import route_util from '../../../utils/route_util'
 import route_constant from '../../../utils/route_constant.js'
 import strings from '../../../utils/strings.js';
 import store from '../../../utils/store.js';
@@ -23,7 +23,9 @@ Page({
     }
 
     ///数据请求
-    dRequest.deviceList({ unShowLoad: true }).then((res) => {
+    dRequest.deviceList({
+      unShowLoad: true
+    }).then((res) => {
       if (res) {
         that.setDeviceList(res, true);
       }
@@ -58,7 +60,7 @@ Page({
       that.setData({
         deviceList: devices
       });
-    } catch (e) { }
+    } catch (e) {}
   },
 
   deviceTap(e) {
@@ -71,17 +73,15 @@ Page({
 
     var clientTypes = lexin_devices.clientTypes;
     if (clientTypes.includes(device.clientType)) {
-      var param = JSON.stringify(device);
-      routeUtil.jumpParam(route_constant.deviceConnect0, param);
+      var param = '?param=' + JSON.stringify(device);
+      route_util.jumpParam(route_constant.deviceConnect0, param);
     } else if (device.clientType === "MW-S2" || device.clientType === "猫王妙播黑胶音箱(BLE)") {
-      let json = JSON.stringify(device)
-      routeUtil.jumpParam(route_constant.connectBle, json)
+      var param = '?param=' + JSON.stringify(device);
+      route_util.jumpParam(route_constant.connectBle, param)
     } else {
       wx.showToast({
         title: '暂不支持该设备',
       })
     }
-
   },
-
 })

+ 1 - 1
pages/pageB/deviceConnect0/deviceConnect0.js

@@ -107,7 +107,7 @@ Page({
     wx.openBluetoothAdapter({
       success(res) {
         if (that.data.scopeBluetooth && that.data.userFuzzyLocation) {
-          var param = JSON.stringify(that.data.connectDevice);
+          var param = '?param=' + JSON.stringify(that.data.connectDevice);
           route_util.jumpParam(route_constant.deviceConnect1, param);
         }
       },

+ 2 - 7
pages/pageC/deviceDetail/deviceDetail.js

@@ -54,16 +54,11 @@ Page({
       })
       return
     }
-    let param = {
+    let p = {
       "device": this.data.device,
       "otaData": this.data.updateData,
     }
-
-    // wx.navigateTo({
-    //   url: '/pages/ota/ota' + "?param=" + param
-    // });
-
-    var param = '?param=' + JSON.stringify(param);
+    var param = '?param=' + JSON.stringify(p);
     route_util.jumpParam('/pages/ota/ota', param);
   },
   powerTap(e) {