jiazhipeng 4 months ago
parent
commit
f091450d8c
  1. 7
      components/CustomTabBar.vue
  2. 16
      pages/map/map.vue
  3. 5
      store/modules/user.js

7
components/CustomTabBar.vue

@ -89,7 +89,12 @@ export default {
switchTab(index) { switchTab(index) {
if (this.currentTab === index) return; if (this.currentTab === index) return;
uni.switchTab({ uni.switchTab({
url: '/' + this.tabBar.list[index].pagePath url: '/' + this.tabBar.list[index].pagePath,
success: () => {
if (index == 0) {
this.$store.commit("changeInMap",true);
}
}
}); });
} }
} }

16
pages/map/map.vue

@ -1,6 +1,5 @@
<template> <template>
<view class="bg bg-padding"> <view class="bg bg-padding">
<web-view :src="url"></web-view>
<CustomTabBar :currentTab="0" /> <CustomTabBar :currentTab="0" />
</view> </view>
</template> </template>
@ -18,6 +17,21 @@
}, },
onLoad() { 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: { methods: {

5
store/modules/user.js

@ -24,6 +24,8 @@ export default {
people: null, //预定人信息 people: null, //预定人信息
}, // 会议预定信息 }, // 会议预定信息
lineInfo: "", // 线路下单 lineInfo: "", // 线路下单
inMap: false,
}, },
// 类似 vue 里的 mothods(同步方法) // 类似 vue 里的 mothods(同步方法)
mutations: { mutations: {
@ -92,5 +94,8 @@ export default {
changeHotelOrderList(state, data){ changeHotelOrderList(state, data){
state.hotelOrderList = data state.hotelOrderList = data
}, },
changeInMap (state,data) {
state.inMap = data
},
} }
} }

Loading…
Cancel
Save