|
|
@@ -25,7 +25,7 @@ definePage({
|
|
|
const { opcity, backTop, SelectShopInfo } = storeToRefs(useSysXsbStore())
|
|
|
const { userInfo } = storeToRefs(useUserStore())
|
|
|
const commonCategoryData = ref<Api.xsbCategories[]>([])
|
|
|
-const { data: goodsList, isLastPage, page, error, reload } = usePagination((pageNum, pageSize) =>
|
|
|
+const { data: goodsList, isLastPage, page, error, reload, refresh } = usePagination((pageNum, pageSize) =>
|
|
|
Apis.xsb.getSearchProductList({ data: { pageNum, pageSize, salesNum: 'DESC', shopId: Number(SelectShopInfo.value?.shopId) || 1, channelId: userInfo.value.channelId || 1 } }), {
|
|
|
data: resp => resp.data?.list,
|
|
|
initialData: [],
|
|
|
@@ -44,6 +44,7 @@ const tabbarName = ref('xsb-home')
|
|
|
const swiperList = ref<Api.xsbAdvertInfo[]>([])
|
|
|
const hotText = ref<Api.xsbSearchTerm[]>([])
|
|
|
const recommendText = ref<Api.xsbSearchTerm[]>([])
|
|
|
+const isShow = ref(true)
|
|
|
function handleTabbarChange({ value }: { value: string }) {
|
|
|
setTabbarItemActive(value)
|
|
|
tabbarName.value = value
|
|
|
@@ -91,11 +92,11 @@ onMounted(async () => {
|
|
|
// reload()
|
|
|
getCategories()
|
|
|
})
|
|
|
-onShow(() => reload())
|
|
|
+onShow(() => refresh())
|
|
|
|
|
|
watch(() => SelectShopInfo.value.shopId, () => {
|
|
|
getCategories()
|
|
|
- reload()
|
|
|
+ refresh()
|
|
|
})
|
|
|
|
|
|
onShareAppMessage(() => {
|
|
|
@@ -124,6 +125,15 @@ function handleChange(name: string) {
|
|
|
})
|
|
|
tabbarName.value = name
|
|
|
}
|
|
|
+function beforeleave() {
|
|
|
+ if (tabbarName.value === 'xsb-classfiy') {
|
|
|
+ isShow.value = false
|
|
|
+ handleChange('xsb-home')
|
|
|
+ nextTick(() => {
|
|
|
+ isShow.value = true
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -137,6 +147,9 @@ function handleChange(name: string) {
|
|
|
<cart v-if="tabbarName == 'xsb-cart'" @change-tab="handleChange('xsb-home')" />
|
|
|
<classfiy v-if="tabbarName == 'xsb-classfiy'" :category-list="commonCategoryData" :hot-text="hotText" />
|
|
|
<my v-if="tabbarName == 'xsb-my'" />
|
|
|
+ <view v-if="tabbarName == 'xsb-classfiy'">
|
|
|
+ <page-container :show="isShow" :overlay="false" @beforeleave="beforeleave" />
|
|
|
+ </view>
|
|
|
<wd-tabbar
|
|
|
v-model="tabbarName" safe-area-inset-bottom placeholder fixed :bordered="false" custom-class="custom-tab"
|
|
|
:custom-style="`box-shadow:${tabbarName == 'xsb-cart' || tabbarName == 'xsb-classfiy' ? '' : ' 0rpx -6rpx 12rpx 2rpx rgba(0, 0, 0, 0.09)'}`"
|