From c0c78d7abd46ddc33895a234b96832d648e56914 Mon Sep 17 00:00:00 2001 From: xuminyui <576362016@qq.com> Date: Thu, 24 Oct 2024 15:43:04 +0800 Subject: [PATCH] fix --- src/App.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/App.vue b/src/App.vue index 874dca4..8df83b7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,12 +10,7 @@ const state = reactive({ }); const loading = ref(false); export default { - onLaunch: function () {}, - onShow: function () { - console.log("2222222"); - // const token = window?.plus?.storage.getItem("token"); - // uni.setStorageSync("token", token); - // console.log("App Show", uni.getStorageSync("token")); + onLaunch: function () { const params = new URLSearchParams(window.location.search); //属性包含当前 URL 的查询字符串部分 state.id = params.get("id"); state.pid = params.get("pid"); @@ -34,7 +29,7 @@ export default { console.log("boxRelBucketStatus", state.boxRelBucketStatus); if (res.data.pbStatus == 1) { console.log("成功拉2"); - uni.navigateTo({ + uni.redirectTo({ url: "/pages/index/index?id=" + state.id + "&pid=" + state.pid, success: () => { loading.value = false; @@ -49,7 +44,7 @@ export default { res.data.boxRelBucketStatus == 3 && res.data.locateAddress == "公司内" ) { - uni.navigateTo({ + uni.redirectTo({ url: "/pages/painting/index?id=" + state.id + "&pid=" + state.pid, success: () => { loading.value = false; @@ -62,7 +57,7 @@ export default { } else { uni.setStorageSync("data", res.data); console.log(); - uni.navigateTo({ + uni.redirectTo({ url: "/pages/detail/index?id=" + state.id + @@ -95,6 +90,7 @@ export default { } }, 200); }, + onShow: function () {}, onHide: function () { console.log("App Hide"); },