diff --git a/src/App.vue b/src/App.vue
index 1da4333..47664c5 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -2,8 +2,8 @@
-
-
+
+
{{ tab.title }}
@@ -25,6 +25,7 @@ export default {
minHeight: 0,
tabbar,
tabHeight: 0,
+ // actionRoute: 0
};
},
provide() {
@@ -56,22 +57,33 @@ export default {
}
},
mounted(){
- console.log('launch', this.$route.query)
this.$store.commit('SET_LAUNCH', this.$route.query)
-
- console.log( safeAreaInsets.bottom)
setTimeout(() => {
- console.log( safeAreaInsets.bottom)
this.minHeight = window.innerHeight - safeAreaInsets.bottom;
}, 30)
},
+ methods: {
+ onNavigation(tab){
+ const { path } = this.$route;
+ if(path === tab.path) return;
+ this.$router.push({ path: tab.path, query: { temple_id: this.$route.query.temple_id}})
+ }
+ },
computed: {
+ actionRoute: {
+ get(){
+ const { tabbar } = this;
+ return tabbar.map(tab => tab.name).indexOf(this.$route.name)
+ },
+ set(){ }
+ },
showTabbar() {
const path = tabbar.map(tab => tab.path);
- const { name, query: { temple_id } } = this.$route;
+ const { name, query: { temple_id, hideTab } } = this.$route;
// 等于寺庙功德箱时隐藏底部导航
- if(name === 'merit-box' && temple_id !== '1'){
+ console.log(name, temple_id !== '1')
+ if(name === 'merit-box' || (name === 'temple-list' && hideTab === '1')){
return false
}
diff --git a/src/pages/merit-box/index.vue b/src/pages/merit-box/index.vue
index a251ed2..875e897 100644
--- a/src/pages/merit-box/index.vue
+++ b/src/pages/merit-box/index.vue
@@ -90,7 +90,11 @@ export default {
},
methods: {
back(){
- this.$router.push({ name: 'home', query: { temple_id: this.query.temple_id } })
+ if(this.query.fromPathName){
+ this.$router.replace({ name: this.query.fromPathName,query: { temple_id: this.query.temple_id } })
+ return;
+ }
+ this.$router.replace({ name: 'home', query: { temple_id: this.query.temple_id }});
},
openBox(){
this.randVisible = true
diff --git a/src/pages/temple-home/index.vue b/src/pages/temple-home/index.vue
index 203c96c..f3f4a1a 100644
--- a/src/pages/temple-home/index.vue
+++ b/src/pages/temple-home/index.vue
@@ -124,6 +124,7 @@
+
@@ -148,7 +149,7 @@ export default {
openBox(){
this.$router.push({
name: 'merit-box',
- query: { temple_id : this.query.temple_id, open_box: 1 }
+ query: { temple_id : this.query.temple_id, open_box: 1, fromPathName: this.$route.name }
})
},
locationTo(nav) {
@@ -197,6 +198,12 @@ export default {
}
},
onPushForRouteName(routeName){
+ if(routeName === 'merit-box'){
+ return this.openBox();
+ }
+ if(routeName === 'temple-list'){
+ return this.$router.push({ name: routeName, query: { hideTab: '1'}})
+ }
this.$router.push({ name: routeName })
},
async getUserData(){
diff --git a/src/pages/temple-list/index.vue b/src/pages/temple-list/index.vue
index b489e60..6ccbcbb 100644
--- a/src/pages/temple-list/index.vue
+++ b/src/pages/temple-list/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -73,11 +73,13 @@ export default {
}
},
mounted(){
- console.log(this.parentHeight)
- this.$nextTick(() => {
- console.log(this.$refs.topbar.offsetHeight)
- this.containerHeight = this.parentHeight - this.$refs.topbar.offsetHeight - 100;
- })
+ setTimeout(() => {
+ if(this.query.hideTab === '1'){
+ this.containerHeight = this.root.minHeight - this.$refs.topbar.offsetHeight;
+ } else {
+ this.containerHeight = this.root.minHeight - this.$refs.topbar.offsetHeight - 100;
+ }
+ }, 50)
if(this.query.search){
this.keyword = this.query.search;
diff --git a/wap/index.html b/wap/index.html
index 9327c29..98903e1 100644
--- a/wap/index.html
+++ b/wap/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file