|
|
@@ -107,7 +107,6 @@ async function getProductList() {
|
|
|
},
|
|
|
})
|
|
|
productList.value = res.data
|
|
|
- console.log(isTopLoading.value, '=====================')
|
|
|
if (!res.data.length) {
|
|
|
scrollTop.value = undefined
|
|
|
nextTick(() => {
|
|
|
@@ -115,17 +114,15 @@ async function getProductList() {
|
|
|
})
|
|
|
}
|
|
|
if (!isTopLoading.value) {
|
|
|
- goodsInTo.value = null
|
|
|
+ scrollTop.value = undefined
|
|
|
nextTick(() => {
|
|
|
- goodsInTo.value = res.data.length > 3 ? res.data[0].prodId : null
|
|
|
+ scrollTop.value = 0
|
|
|
})
|
|
|
}
|
|
|
else {
|
|
|
goodsInTo.value = null
|
|
|
-
|
|
|
nextTick(() => {
|
|
|
goodsInTo.value = res.data.length > 4 ? res.data[res.data.length - 4].prodId : null
|
|
|
- console.log(goodsInTo.value, 'goodsInTo.value=============')
|
|
|
})
|
|
|
}
|
|
|
goodsLoading.value = 'finished'
|
|
|
@@ -464,92 +461,94 @@ function handlePay() {
|
|
|
<wd-sort-button v-model="sortClassBtn" :line="false" title="价格" />
|
|
|
</view>
|
|
|
</view>
|
|
|
- <scroll-view
|
|
|
- :lower-threshold="100"
|
|
|
- :refresher-triggered="isTopLoading" :scroll-top="scrollTop"
|
|
|
- :style="{ height: `calc(100vh - ${navHeight} - 700rpx)` }" enable-passive scroll-y scroll-anchoring refresher-enabled :throttle="false"
|
|
|
- :scroll-into-view="`class${goodsInTo}`"
|
|
|
- class="relative"
|
|
|
- @refresherrefresh="handleSrollTop"
|
|
|
- @scrolltolower="handlScrollBottom"
|
|
|
- >
|
|
|
- <view v-if="productList.length" class="p20rpx">
|
|
|
- <view v-for="item in productList" :id="`class${item.prodId}`" :key="item.id" class="relative">
|
|
|
- <view class="flex" @click="handleGo(item)">
|
|
|
- <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>
|
|
|
- <view class="flex-1">
|
|
|
- <view class="text-left text-28rpx font-semibold">
|
|
|
- <!-- <view v-for="i in 2" :key="i" class="mr5px inline-block">
|
|
|
+ <view class="relative">
|
|
|
+ <scroll-view
|
|
|
+ :lower-threshold="100"
|
|
|
+ :refresher-triggered="isTopLoading" :scroll-top="scrollTop"
|
|
|
+ :style="{ height: `calc(100vh - ${navHeight} - 700rpx)` }" enable-passive scroll-y scroll-anchoring refresher-enabled :throttle="false"
|
|
|
+ :scroll-into-view="`class${goodsInTo}`"
|
|
|
+
|
|
|
+ @refresherrefresh="handleSrollTop"
|
|
|
+ @scrolltolower="handlScrollBottom"
|
|
|
+ >
|
|
|
+ <view v-if="productList.length" class="p20rpx">
|
|
|
+ <view v-for="item in productList" :id="`class${item.prodId}`" :key="item.id" class="relative">
|
|
|
+ <view class="flex" @click="handleGo(item)">
|
|
|
+ <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>
|
|
|
+ <view class="flex-1">
|
|
|
+ <view class="text-left text-28rpx font-semibold">
|
|
|
+ <!-- <view v-for="i in 2" :key="i" class="mr5px inline-block">
|
|
|
<wd-tag type="primary">
|
|
|
新品{{ i }}
|
|
|
</wd-tag>
|
|
|
</view> -->
|
|
|
- {{ item.prodName }}
|
|
|
- </view>
|
|
|
- <view class="text-22rpx text-#AAAAAA">
|
|
|
- <view class="mt10rpx flex items-center">
|
|
|
- <view>{{ item.spec }}</view>
|
|
|
- </view>
|
|
|
- <view class="mt6rpx">
|
|
|
- 已售 {{ item.soldNum }}+
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="flex items-center justify-between">
|
|
|
- <view class="text-#FF4D3A font-semibold">
|
|
|
- <text class="text-24rpx">
|
|
|
- ¥
|
|
|
- </text> <text class="text-36rpx">
|
|
|
- {{ item.channelProdPrice }}
|
|
|
- </text>
|
|
|
+ {{ item.prodName }}
|
|
|
</view>
|
|
|
- <view v-if="!item.num">
|
|
|
- <view v-if="item.spuStock" @click.stop="handleAddCart($event, item)">
|
|
|
- <image :src="`${StaticUrl}/cart-yes.png`" class="h52rpx w52rpx" />
|
|
|
+ <view class="text-22rpx text-#AAAAAA">
|
|
|
+ <view class="mt10rpx flex items-center">
|
|
|
+ <view>{{ item.spec }}</view>
|
|
|
</view>
|
|
|
- <view v-else>
|
|
|
- <image :src="`${StaticUrl}/cart-no.png`" class="h52rpx w52rpx" />
|
|
|
+ <view class="mt6rpx">
|
|
|
+ 已售 {{ item.soldNum }}+
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-else>
|
|
|
- <view class="flex items-center">
|
|
|
- <image
|
|
|
- :src="` ${StaticUrl}/sub-cart.png`"
|
|
|
- class="h44rpx w44rpx"
|
|
|
- @click.stop="handleSubCart($event, item)"
|
|
|
- />
|
|
|
- <view class="box-border h44rpx w84rpx flex items-center justify-center border border-#F0F0F0 border-solid text-24rpx text-#AAAAAA">
|
|
|
- {{ item.num }}
|
|
|
+ <view class="flex items-center justify-between">
|
|
|
+ <view class="text-#FF4D3A font-semibold">
|
|
|
+ <text class="text-24rpx">
|
|
|
+ ¥
|
|
|
+ </text> <text class="text-36rpx">
|
|
|
+ {{ item.channelProdPrice }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view v-if="!item.num">
|
|
|
+ <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 v-else>
|
|
|
+ <view class="flex items-center">
|
|
|
+ <image
|
|
|
+ :src="` ${StaticUrl}/sub-cart.png`"
|
|
|
+ class="h44rpx w44rpx"
|
|
|
+ @click.stop="handleSubCart($event, item)"
|
|
|
+ />
|
|
|
+ <view class="box-border h44rpx w84rpx flex items-center justify-center border border-#F0F0F0 border-solid text-24rpx text-#AAAAAA">
|
|
|
+ {{ item.num }}
|
|
|
+ </view>
|
|
|
+ <image
|
|
|
+ :src="` ${StaticUrl}/add-cart.png`"
|
|
|
+ class="h44rpx w44rpx"
|
|
|
+ @click.stop="handleAddCart($event, item)"
|
|
|
+ />
|
|
|
</view>
|
|
|
- <image
|
|
|
- :src="` ${StaticUrl}/add-cart.png`"
|
|
|
- class="h44rpx w44rpx"
|
|
|
- @click.stop="handleAddCart($event, item)"
|
|
|
- />
|
|
|
</view>
|
|
|
</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 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>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <wd-status-tip v-else image="content" tip="暂无内容" />
|
|
|
- <view v-if="goodsLoading == 'finished' || isTopLoading" class="h-30vh" />
|
|
|
+ <wd-status-tip v-else image="content" tip="暂无内容" />
|
|
|
+ <view v-if="goodsLoading == 'finished' || isTopLoading" class="h-30vh" />
|
|
|
+ </scroll-view>
|
|
|
<view v-if="goodsLoading == 'loading' || isTopLoading" class="absolute left-0 top-0 z-10 h-full w-full flex items-center justify-center bg-white">
|
|
|
<wd-loading color="#9ED605" :size="20" />
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view
|