fix:修复bug
This commit is contained in:
@@ -93,7 +93,7 @@ function appMarketActivityList() {
|
||||
}
|
||||
|
||||
// 滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)
|
||||
const appMerchantLabelList = ref([])
|
||||
const appMerchantLabelList = ref<any>([])
|
||||
function getAppMerchantLabelList() {
|
||||
appRecipeCategoryListGet({}).then(res => {
|
||||
console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res)
|
||||
@@ -167,6 +167,20 @@ function getList(pageNum: number, pageSize: number) {
|
||||
})
|
||||
}
|
||||
|
||||
// 回到顶部
|
||||
const showBackToTop = ref(false)
|
||||
function scrollToTop() {
|
||||
if (paging.value) {
|
||||
paging.value.scrollToTop()
|
||||
}
|
||||
}
|
||||
|
||||
// 监听页面滚动
|
||||
function onPageScroll(e: any) {
|
||||
// 滚动距离大于60时显示,小于等于60时隐藏
|
||||
showBackToTop.value = e.detail.scrollTop > 120
|
||||
}
|
||||
|
||||
// 点击头部分类
|
||||
const merchantLabelId = ref('')
|
||||
function handleItemClick(e) {
|
||||
@@ -186,7 +200,7 @@ const isShowMerchant = computed(()=> {
|
||||
if(!selfPickup.value && !discount.value && !props.scoreRange && !props.price && !currentCategory.value) {
|
||||
return true // 没有筛选条件时显示
|
||||
} else {
|
||||
return false // 有筛选条件时隐藏
|
||||
return true // 有筛选条件时隐藏
|
||||
}
|
||||
})
|
||||
|
||||
@@ -249,7 +263,7 @@ const debouncedEmit = debounce(1300, (isCollected: boolean, id: string, type: Co
|
||||
},
|
||||
]"
|
||||
>
|
||||
<z-paging @onRefresh="onRefresh" ref="paging" v-model="dataList" :auto="false" @query="queryList" :refresher-enabled="true" :auto-show-back-to-top="false">
|
||||
<z-paging @onRefresh="onRefresh" ref="paging" v-model="dataList" :auto="false" @query="queryList" @scroll="onPageScroll" :refresher-enabled="true" :auto-show-back-to-top="false">
|
||||
<template #top>
|
||||
<status-bar />
|
||||
<view class="flex items-center pt-18rpx px-30rpx pb-20rpx">
|
||||
@@ -402,6 +416,11 @@ const debouncedEmit = debounce(1300, (isCollected: boolean, id: string, type: Co
|
||||
<view class="w-8rpx h-8rpx rounded-50% bg-white mx-8rpx"></view>
|
||||
<text>{{ userStore.userCartAllData[0]?.merchantCartVoList?.length || 0 }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 回到顶部按钮 -->
|
||||
<view v-if="showBackToTop" @click="scrollToTop" class="back-to-top-btn">
|
||||
<image src="@img/chef/119.png" class="w-40rpx h-40rpx shrink-0 rotate-180"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -426,4 +445,19 @@ const debouncedEmit = debounce(1300, (isCollected: boolean, id: string, type: Co
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.back-to-top-btn {
|
||||
position: fixed;
|
||||
bottom: 148rpx;
|
||||
left: 30rpx;
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
background-color: #14181B;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
|
||||
z-index: 998;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user