feat : 小程序下隐藏applayout头部

This commit is contained in:
2025-12-24 16:33:59 +08:00
parent ebea520bca
commit a5ea613a7d
3 changed files with 12 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
> >
<!-- 顶部头部区域 --> <!-- 顶部头部区域 -->
<view <view
v-if="showHeader"
class="container-header" class="container-header"
:style="border ? { borderBottom: `2rpx solid ${borderColor}` } : { borderBottom: 'none' }" :style="border ? { borderBottom: `2rpx solid ${borderColor}` } : { borderBottom: 'none' }"
> >
@@ -20,6 +21,7 @@
<slot name="headerright"></slot> <slot name="headerright"></slot>
</view> </view>
</view> </view>
<!-- 主体不可滚动 headContent --> <!-- 主体不可滚动 headContent -->
<view class="container-headContent"> <view class="container-headContent">
@@ -43,6 +45,10 @@
</template> </template>
<script setup> <script setup>
import { computed } from "vue"
import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
const { isMiniProgram } = storeToRefs(useUserStore());
import img from '@/static/icon/background2.png'; import img from '@/static/icon/background2.png';
const emit = defineEmits(['onScrollBottom']); const emit = defineEmits(['onScrollBottom']);
defineProps({ defineProps({
@@ -84,6 +90,10 @@ defineProps({
}, },
}); });
const showHeader = computed(()=>{
return isMiniProgram.value
})
const handleScrollToLower = () => { const handleScrollToLower = () => {
emit('onScrollBottom'); emit('onScrollBottom');
}; };

View File

@@ -265,7 +265,7 @@ image {
display: flex; display: flex;
flex-direction: column flex-direction: column
.content-top{ .content-top{
padding: 0 28rpx 28rpx; padding:28rpx;
display: flex display: flex
flex-direction: row flex-direction: row
flex-wrap: nowrap flex-wrap: nowrap

View File

@@ -295,7 +295,7 @@ image {
display: flex; display: flex;
flex-direction: column flex-direction: column
.content-top{ .content-top{
padding: 0 28rpx 28rpx ; padding:28rpx;
display: flex display: flex
flex-direction: row flex-direction: row
flex-wrap: nowrap flex-wrap: nowrap