From f091450d8c7b979bb25d0c5673ae32822fbda5a1 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Mon, 30 Jun 2025 10:25:55 +0800 Subject: [PATCH] 1 --- components/CustomTabBar.vue | 7 ++++++- pages/map/map.vue | 16 +++++++++++++++- store/modules/user.js | 5 +++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/components/CustomTabBar.vue b/components/CustomTabBar.vue index 89f871b..9a2d155 100644 --- a/components/CustomTabBar.vue +++ b/components/CustomTabBar.vue @@ -89,7 +89,12 @@ export default { switchTab(index) { if (this.currentTab === index) return; uni.switchTab({ - url: '/' + this.tabBar.list[index].pagePath + url: '/' + this.tabBar.list[index].pagePath, + success: () => { + if (index == 0) { + this.$store.commit("changeInMap",true); + } + } }); } } diff --git a/pages/map/map.vue b/pages/map/map.vue index 47da729..76174dc 100644 --- a/pages/map/map.vue +++ b/pages/map/map.vue @@ -1,6 +1,5 @@ @@ -18,6 +17,21 @@ }, onLoad() { + }, + onShow() { + let inMap = this.$store.state.user.inMap + if (inMap) { + uni.switchTab({ + url:"/pages/index/index", + success: () => { + this.$store.commit("changeInMap",false); + } + }) + } else { + uni.navigateTo({ + url:"/subPackages/webPage/webPage?url=https://www.hwh5.cn/hwcm/lRCqyP0p" + }) + } }, methods: { diff --git a/store/modules/user.js b/store/modules/user.js index 863cf3f..0215178 100644 --- a/store/modules/user.js +++ b/store/modules/user.js @@ -24,6 +24,8 @@ export default { people: null, //预定人信息 }, // 会议预定信息 lineInfo: "", // 线路下单 + + inMap: false, }, // 类似 vue 里的 mothods(同步方法) mutations: { @@ -92,5 +94,8 @@ export default { changeHotelOrderList(state, data){ state.hotelOrderList = data }, + changeInMap (state,data) { + state.inMap = data + }, } }