Browse Source

bugfix relauch处理传参问题

谢杰标 2 years ago
parent
commit
b165fb516e
1 changed files with 16 additions and 7 deletions
  1. 16 7
      pages/index/index.vue

+ 16 - 7
pages/index/index.vue

@@ -612,15 +612,24 @@ export default {
         });
       } else if (swiper.jumpType == 3) {
         //内部接口
-        const { jumpUrl } = swiper
-        const map = ["pages/index/index", "pages/course/index", "pages/learn/index", "pages/questionBank/index"]
-        const isSwitch = map.find(e => jumpUrl.includes(e))
+        const { jumpUrl } = swiper;
+        const map = [
+          "pages/index/index",
+          "pages/course/index",
+          "pages/learn/index",
+          "pages/questionBank/index",
+        ];
+        const isSwitch = map.find((e) => jumpUrl.includes(e));
         // tab页
         if (isSwitch) {
-          uni.switchTab({
-            url: jumpUrl
-          })
-          return
+          // uni.switchTab({
+          //   url: jumpUrl,
+          // });
+          // 解决携带参数问题
+          uni.reLaunch({
+            url: jumpUrl,
+          });
+          return;
         }
         uni.navigateTo({
           url: jumpUrl,