|
|
@@ -5,7 +5,7 @@ import router from '@/router'
|
|
|
|
|
|
const props = defineProps<{ categoryList: Api.xsbCategories[], hotText: Api.xsbSearchTerm[] }>()
|
|
|
const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
|
|
|
-const { topNavActive, leftActive } = storeToRefs(useSysXsbStore())
|
|
|
+const { topNavActive, leftActive, SelectShopInfo } = storeToRefs(useSysXsbStore())
|
|
|
const classfiylist = computed(() => props.categoryList)
|
|
|
const sortClassBtn = ref(1)
|
|
|
const show = ref(false)
|
|
|
@@ -67,7 +67,8 @@ async function getProductList() {
|
|
|
const res = await Apis.xsb.getCategoryProductList({
|
|
|
data: {
|
|
|
categoryId: Number(categoriesId.value),
|
|
|
- shopId: 1,
|
|
|
+ shopId: Number(SelectShopInfo.value?.shopId) || 1,
|
|
|
+ channelId: 1,
|
|
|
},
|
|
|
})
|
|
|
productList.value = res
|
|
|
@@ -161,7 +162,7 @@ onMounted(() => {
|
|
|
:style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }"
|
|
|
>
|
|
|
<scroll-view
|
|
|
- scroll-x :scroll-into-view-offset="-150" scroll-with-animation enable-passive
|
|
|
+ :scroll-into-view-offset="-150" scroll-x enable-passive scroll-with-animation
|
|
|
class="scrollx w-90% flex-shrink-0 whitespace-nowrap" :scroll-into-view="`id${topScrollView}`"
|
|
|
>
|
|
|
<view class="flex items-end pb10rpx">
|
|
|
@@ -251,8 +252,8 @@ onMounted(() => {
|
|
|
@refresherrefresh="handleSrollTop" @scrolltolower="handlScrollBottom"
|
|
|
>
|
|
|
<view v-if="productList.length" class="p20rpx">
|
|
|
- <view v-for="item in productList" :key="item.id" @click="router.push({ name: 'xsb-goods', params: { id: String(item.id) } })">
|
|
|
- <view class="flex">
|
|
|
+ <view v-for="item in productList" :key="item.id" class="relative">
|
|
|
+ <view class="flex" @click="router.push({ name: 'xsb-goods', params: { id: String(item.id) } })">
|
|
|
<view class="mr20rpx h172rpx w172rpx flex-shrink-0 overflow-hidden rounded-16rpx bg-#F6F6F6">
|
|
|
<image :src="item.pic" lazy-load class="h-full w-full" />
|
|
|
</view>
|
|
|
@@ -281,15 +282,25 @@ onMounted(() => {
|
|
|
{{ item.channelProdPrice }}
|
|
|
</text>
|
|
|
</view>
|
|
|
- <view @click.stop="handleAddCart($event, item)">
|
|
|
+ <view v-if="item.spuStock" @click.stop="handleAddCart($event, item)">
|
|
|
<image :src="`${StaticUrl}/cart-yes.png`" class="h52rpx w52rpx" />
|
|
|
</view>
|
|
|
+ <view v-else>
|
|
|
+ <image :src="`${StaticUrl}/cart-no.png`" class="h52rpx w52rpx" />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="line">
|
|
|
<wd-divider color="#F0F0F0" />
|
|
|
</view>
|
|
|
+ <view v-if="!item.spuStock" class="absolute left-0 top-0 z-1 h-full w-full flex items-center bg-[rgba(255,255,255,.6)]">
|
|
|
+ <view class="h172rpx w172rpx flex items-center justify-center">
|
|
|
+ <view class="h36rpx w112rpx flex items-center justify-center rounded-16rpx bg-[rgba(0,0,0,.6)] text-28rpx text-white">
|
|
|
+ 已售罄
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<wd-loadmore :state="goodsLoading" />
|
|
|
</view>
|