refactor(promotion pages): 统一分销和商品分类页的底部适配逻辑
重构了全局配置里的底部边距计算方式,替换原有tabBarPaddingStyleValue为tabBarPagePaddingStyle,同时调整了tabBarHeight的取值逻辑,适配是否显示tabBar的场景,移除冗余的计算属性
This commit is contained in:
@@ -65,14 +65,10 @@ export default {
|
||||
},
|
||||
tabBarPagePaddingStyle() {
|
||||
return this.$util.objToStyle({
|
||||
paddingBottom: this.shouldShowTabBar ? '112rpx' : '0'
|
||||
height: `calc(100vh - ${this.tabBarHeight})`,
|
||||
paddingBottom: this.tabBarHeight
|
||||
});
|
||||
},
|
||||
tabBarPaddingStyleValue() {
|
||||
return {
|
||||
paddingBottom: this.shouldShowTabBar ? '112rpx' : '0'
|
||||
};
|
||||
},
|
||||
siteInfo() {
|
||||
return this.$store.state.siteInfo;
|
||||
},
|
||||
@@ -132,7 +128,7 @@ export default {
|
||||
return this.$store.state.diySeckillInterval;
|
||||
},
|
||||
tabBarHeight() {
|
||||
return this.$store.state.tabBarHeight;
|
||||
return this.shouldShowTabBar ? this.$store.state.tabBarHeight : '0rpx';
|
||||
},
|
||||
mapConfig() {
|
||||
return this.$store.state.mapConfig;
|
||||
|
||||
@@ -581,7 +581,7 @@ export default {
|
||||
},
|
||||
fenxiaoIndexPageStyle() {
|
||||
const style = {
|
||||
...this.tabBarPaddingStyleValue
|
||||
...this.tabBarPagePaddingStyle
|
||||
};
|
||||
if (this.$util && this.$util.img) {
|
||||
style.background = 'url(' + this.$util.img('public/uniapp/fenxiao/index/commissionFission-background.png') + ')';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="category-page-wrap category-template-1" :style="categoryPageStyle">
|
||||
<view class="category-page-wrap category-template-1" :style="tabBarPagePaddingStyle">
|
||||
|
||||
<!-- <view class="search-box" @click="$util.redirectTo('/pages_tool/goods/search')">
|
||||
<view class="search-content">
|
||||
@@ -94,14 +94,6 @@
|
||||
user_type:uni.getStorageSync('user_type')
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
categoryPageStyle() {
|
||||
return this.$util.objToStyle({
|
||||
height: 'calc(100vh - 56px)',
|
||||
...this.tabBarPaddingStyleValue
|
||||
});
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.hideTabBar()
|
||||
this.getCategory()
|
||||
|
||||
Reference in New Issue
Block a user