refactor(promotion pages): 统一分销和商品分类页的底部适配逻辑

重构了全局配置里的底部边距计算方式,替换原有tabBarPaddingStyleValue为tabBarPagePaddingStyle,同时调整了tabBarHeight的取值逻辑,适配是否显示tabBar的场景,移除冗余的计算属性
This commit is contained in:
2026-06-16 14:29:09 +08:00
parent 6fb0e264b8
commit c0e64437f0
3 changed files with 5 additions and 17 deletions

View File

@@ -65,14 +65,10 @@ export default {
}, },
tabBarPagePaddingStyle() { tabBarPagePaddingStyle() {
return this.$util.objToStyle({ 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() { siteInfo() {
return this.$store.state.siteInfo; return this.$store.state.siteInfo;
}, },
@@ -132,7 +128,7 @@ export default {
return this.$store.state.diySeckillInterval; return this.$store.state.diySeckillInterval;
}, },
tabBarHeight() { tabBarHeight() {
return this.$store.state.tabBarHeight; return this.shouldShowTabBar ? this.$store.state.tabBarHeight : '0rpx';
}, },
mapConfig() { mapConfig() {
return this.$store.state.mapConfig; return this.$store.state.mapConfig;

View File

@@ -581,7 +581,7 @@ export default {
}, },
fenxiaoIndexPageStyle() { fenxiaoIndexPageStyle() {
const style = { const style = {
...this.tabBarPaddingStyleValue ...this.tabBarPagePaddingStyle
}; };
if (this.$util && this.$util.img) { if (this.$util && this.$util.img) {
style.background = 'url(' + this.$util.img('public/uniapp/fenxiao/index/commissionFission-background.png') + ')'; style.background = 'url(' + this.$util.img('public/uniapp/fenxiao/index/commissionFission-background.png') + ')';

View File

@@ -1,6 +1,6 @@
<template> <template>
<view :style="themeColor"> <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-box" @click="$util.redirectTo('/pages_tool/goods/search')">
<view class="search-content"> <view class="search-content">
@@ -94,14 +94,6 @@
user_type:uni.getStorageSync('user_type') user_type:uni.getStorageSync('user_type')
}; };
}, },
computed: {
categoryPageStyle() {
return this.$util.objToStyle({
height: 'calc(100vh - 56px)',
...this.tabBarPaddingStyleValue
});
}
},
onLoad() { onLoad() {
uni.hideTabBar() uni.hideTabBar()
this.getCategory() this.getCategory()