文件
xionggeshop/xgsc.gynhc.com_wx/components/shopro-page-layout/shopro-page-layout.vue
2026-09-14 17:24:53 +08:00

95 行
1.7 KiB
Vue

<template>
<view class="shopro-page-layout brand-page">
<shopro-navbar
v-if="showNavbar"
:isBack="isBack"
:variant="navbarVariant"
:backText="navbarTitle"
:backIconColor="navbarIconColor"
:backTextStyle="{ color: navbarTextColor, fontWeight: '500' }"
>
<template v-slot:content>
<slot name="navbar-content"></slot>
</template>
<template v-slot:right>
<slot name="navbar-right"></slot>
</template>
</shopro-navbar>
<view class="shopro-page-layout__body" :class="{ 'has-footer': hasFooter }">
<slot></slot>
</view>
<view v-if="hasFooter" class="shopro-page-layout__footer brand-subpage-footer">
<slot name="footer"></slot>
</view>
</view>
</template>
<script>
import theme from '@/shopro/config/theme.js';
export default {
name: 'shopro-page-layout',
props: {
showNavbar: {
type: Boolean,
default: false
},
isBack: {
type: Boolean,
default: true
},
navbarVariant: {
type: String,
default: 'white'
},
navbarTitle: {
type: String,
default: ''
},
hasFooter: {
type: Boolean,
default: false
}
},
computed: {
navbarIconColor() {
return theme.text;
},
navbarTextColor() {
return theme.text;
}
}
};
</script>
<style lang="scss" scoped>
.shopro-page-layout {
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
box-sizing: border-box;
&__body {
flex: 1;
width: 100%;
box-sizing: border-box;
padding: 0 $brand-page-gutter;
&.has-footer {
padding-bottom: 120rpx;
}
}
&__footer {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 99;
background: $brand-card-bg;
box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.04);
}
}
</style>