Browse Source

feature: 解决路由跳转indexRoot不统一的问题

332777428@qq.com 4 months ago
parent
commit
91f5e7447b

+ 4 - 3
devices/ble_manager.js

@@ -340,9 +340,10 @@ class bleManager {
     }
 
     const routeUtil = require('../utils/routeUtil');
-    const routePath = require('../utils/routePath');
-    const indexRoot = routePath.indexRoot;
-    const connectBleRoot = routePath.connectBleRoot;
+    const routeRoot = require('../utils/routeRoot');
+
+    const indexRoot = routeRoot.indexRoot;
+    const connectBleRoot = routeRoot.connectBleRoot;
     var lastPageRoute = routeUtil.getLastPageRoute();
     if (lastPageRoute != indexRoot && lastPageRoute != connectBleRoot) {
       console.log("搜索蓝牙设备失败,请返回首页0");

+ 3 - 2
pages/deviceConnect0/deviceConnect0.js

@@ -2,6 +2,7 @@ const app = getApp();
 import strings from '../../utils/strings.js';
 import routUtil from '../../utils/routUtil.js';
 import routePath from '../../utils/routePath.js'
+import routeRoot from '../../utils/routeRoot.js'
 
 Page({
   data: {
@@ -46,7 +47,7 @@ Page({
           showCapsule: 1,
           title: '连接配网',
           callback: () => {
-            routUtil.goBackRoute(routePath.indexRoot);
+            routUtil.goBackRoute(routeRoot.indexRoot);
           }
         },
       })
@@ -144,7 +145,7 @@ Page({
 
   ///返回到首页
   notRoter() {
-    routUtil.goBackRoute(routePath.indexRoot);
+    routUtil.goBackRoute(routeRoot.indexRoot);
   },
 
   onUnload() {

+ 3 - 1
pages/deviceConnect3/deviceConnect3.js

@@ -4,6 +4,8 @@ let xBlufi = require("../../utils/blufi/xBlufi.js");
 import strings from '../../utils/strings.js';
 import routUtil from '../../utils/routUtil.js';
 import routePath from '../../utils/routePath.js'
+import routeRoot from '../../utils/routeRoot.js'
+
 let percentIn = null;
 let errTi = null;
 
@@ -206,7 +208,7 @@ Page({
   },
 
   goIndex() {
-    routUtil.goBackRoute(routePath.indexRoot);
+    routUtil.goBackRoute(routeRoot.indexRoot);
   },
 
   onUnload: function () {

+ 3 - 1
pages/deviceConnect4/deviceConnect4.js

@@ -2,6 +2,8 @@ const app = getApp();
 import strings from '../../utils/strings.js';
 import routUtil from '../../utils/routUtil.js';
 import routePath from '../../utils/routePath.js'
+import routeRoot from '../../utils/routeRoot.js'
+
 const {
   BleUtil
 } = require('../../utils/blue_ble/util');
@@ -123,6 +125,6 @@ Page({
   },
 
   goIndex() {
-    routUtil.goBackRoute(routePath.indexRoot);
+    routUtil.goBackRoute(routeRoot.indexRoot);
   },
 })