feat(square): differentiate scroll behavior for xinghe/xingbang/guangchang tabs

This commit is contained in:
zheng020 2026-06-11 12:37:30 +08:00
parent 71ee3795b9
commit 751bd68bf1

View File

@ -45,7 +45,7 @@
<!-- 内容区域 --> <!-- 内容区域 -->
<scroll-view <scroll-view
class="content-wrapper" class="content-wrapper"
scroll-y :scroll-y="activeContentTab === 'guangchang'"
:show-scrollbar="false" :show-scrollbar="false"
:bounce="false" :bounce="false"
@scroll="onScroll" @scroll="onScroll"
@ -92,7 +92,7 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted, onUnmounted } from "vue"; import { ref, watch, onMounted, onUnmounted } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app"; import { onLoad, onShow } from "@dcloudio/uni-app";
import { useStore } from "vuex"; import { useStore } from "vuex";
import Header from "../components/Header.vue"; import Header from "../components/Header.vue";
@ -121,6 +121,12 @@ const creationGridRef = ref(null);
const cardTapTimers = {}; const cardTapTimers = {};
const likingMap = ref({}); const likingMap = ref({});
// tab scroll-view scrollTop,
watch(activeContentTab, () => {
// / scroll-y=false, scrollTop
uni.pageScrollTo({ scrollTop: 0, duration: 0 });
});
// scroll CreationGrid fixed // scroll CreationGrid fixed
const onScroll = (e) => { const onScroll = (e) => {
const scrollTop = (e && e.detail && e.detail.scrollTop) || 0; const scrollTop = (e && e.detail && e.detail.scrollTop) || 0;
@ -348,7 +354,8 @@ onUnmounted(() => {
/* 热门分类区块 */ /* 热门分类区块 */
.hot-category-wrapper { .hot-category-wrapper {
position: relative; position: relative;
padding-bottom: 80rpx; /* 100vh - header(208rpx) - banner(360rpx) - tabs(88rpx) = 可用 body 高度 */
height: calc(100vh - 208rpx - 360rpx - 88rpx);
} }
/* 蒙层 */ /* 蒙层 */