更改功德箱未显示完
This commit is contained in:
+20
-8
@@ -2,8 +2,8 @@
|
|||||||
<div class="app-safe-area" :style="{minHeight: minHeight + 'px'}">
|
<div class="app-safe-area" :style="{minHeight: minHeight + 'px'}">
|
||||||
<div id="app" :data-height="minHeight - tabHeight" :style="{ minHeight: minHeight - tabHeight + 'px', paddingBottom: tabHeight + 'px'}">
|
<div id="app" :data-height="minHeight - tabHeight" :style="{ minHeight: minHeight - tabHeight + 'px', paddingBottom: tabHeight + 'px'}">
|
||||||
<router-view />
|
<router-view />
|
||||||
<van-tabbar v-if="showTabbar" class="tabbar" ref="tabbar" route active-color="#CF9E3B" inactive-color="#999">
|
<van-tabbar v-if="showTabbar" class="tabbar" v-model="actionRoute" ref="tabbar" active-color="#CF9E3B" inactive-color="#999">
|
||||||
<van-tabbar-item replace name v-for="(tab, index) in tabbar" :key="index" :to="tab.path">
|
<van-tabbar-item replace name v-for="(tab, index) in tabbar" :key="index" @click="onNavigation(tab)">
|
||||||
<span>{{ tab.title }}</span>
|
<span>{{ tab.title }}</span>
|
||||||
<template #icon="props">
|
<template #icon="props">
|
||||||
<img :src="props.active ? tab.active: tab.inactive" alt="">
|
<img :src="props.active ? tab.active: tab.inactive" alt="">
|
||||||
@@ -25,6 +25,7 @@ export default {
|
|||||||
minHeight: 0,
|
minHeight: 0,
|
||||||
tabbar,
|
tabbar,
|
||||||
tabHeight: 0,
|
tabHeight: 0,
|
||||||
|
// actionRoute: 0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
provide() {
|
provide() {
|
||||||
@@ -56,22 +57,33 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
console.log('launch', this.$route.query)
|
|
||||||
this.$store.commit('SET_LAUNCH', this.$route.query)
|
this.$store.commit('SET_LAUNCH', this.$route.query)
|
||||||
|
|
||||||
console.log( safeAreaInsets.bottom)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log( safeAreaInsets.bottom)
|
|
||||||
this.minHeight = window.innerHeight - safeAreaInsets.bottom;
|
this.minHeight = window.innerHeight - safeAreaInsets.bottom;
|
||||||
}, 30)
|
}, 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: {
|
computed: {
|
||||||
|
actionRoute: {
|
||||||
|
get(){
|
||||||
|
const { tabbar } = this;
|
||||||
|
return tabbar.map(tab => tab.name).indexOf(this.$route.name)
|
||||||
|
},
|
||||||
|
set(){ }
|
||||||
|
},
|
||||||
showTabbar() {
|
showTabbar() {
|
||||||
const path = tabbar.map(tab => tab.path);
|
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
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
back(){
|
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(){
|
openBox(){
|
||||||
this.randVisible = true
|
this.randVisible = true
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</van-popup>
|
</van-popup>
|
||||||
|
|
||||||
|
<!-- 功德箱-->
|
||||||
<img src="@/assets/img/gongdexiang.png" class="gongdexiang" @click="openBox"/>
|
<img src="@/assets/img/gongdexiang.png" class="gongdexiang" @click="openBox"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -148,7 +149,7 @@ export default {
|
|||||||
openBox(){
|
openBox(){
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'merit-box',
|
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) {
|
locationTo(nav) {
|
||||||
@@ -197,6 +198,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPushForRouteName(routeName){
|
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 })
|
this.$router.push({ name: routeName })
|
||||||
},
|
},
|
||||||
async getUserData(){
|
async getUserData(){
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="temple-list" :style="{height: root.minHeight - root.tabHeight + 'px'}">
|
<div class="temple-list" :style="{height: root.minHeight + 'px'}">
|
||||||
<div class="topbar" ref="topbar">
|
<div class="topbar" ref="topbar">
|
||||||
<van-nav-bar left-arrow :title="$route.meta.title" v-if="$route.meta.showNavBar" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
|
<van-nav-bar left-arrow :title="$route.meta.title" v-if="$route.meta.showNavBar" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
|
||||||
<van-search v-model="keyword" show-action action-text="搜索" placeholder="请输入寺院、方丈、监院名称" @search="onSearch" @cancel="onCancel">
|
<van-search v-model="keyword" show-action action-text="搜索" placeholder="请输入寺院、方丈、监院名称" @search="onSearch" @cancel="onCancel">
|
||||||
@@ -73,11 +73,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
console.log(this.parentHeight)
|
setTimeout(() => {
|
||||||
this.$nextTick(() => {
|
if(this.query.hideTab === '1'){
|
||||||
console.log(this.$refs.topbar.offsetHeight)
|
this.containerHeight = this.root.minHeight - this.$refs.topbar.offsetHeight;
|
||||||
this.containerHeight = this.parentHeight - this.$refs.topbar.offsetHeight - 100;
|
} else {
|
||||||
})
|
this.containerHeight = this.root.minHeight - this.$refs.topbar.offsetHeight - 100;
|
||||||
|
}
|
||||||
|
}, 50)
|
||||||
|
|
||||||
if(this.query.search){
|
if(this.query.search){
|
||||||
this.keyword = this.query.search;
|
this.keyword = this.query.search;
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user