Fix:2984 【商城小程序】我的收藏--被下架的商品在商品收藏中消失(改为前端数据保留,点击时提醒商品已下架或被删除)

This commit is contained in:
modendeveloper
2025-01-08 19:42:25 +08:00
parent 3ea76f4081
commit 09b677d593
+13 -6
View File
@@ -77,16 +77,16 @@
:src="item['image']" :src="item['image']"
mode="scaleToFill" mode="scaleToFill"
class="cover flex-0" class="cover flex-0"
@click="navToGoods(item['productId'])" @click="navToGoods(item)"
/> />
<view style="width: 100%"> <view style="width: 100%">
<view <view
class="more-t bold" class="more-t bold"
@click="navToGoods(item['productId'])" @click="navToGoods(item)"
>{{ item['storeName'] }}</view> >{{ item['storeName'] }}</view>
<view class="sub" @click="navToGoods(item['productId'])">规格:{{ item['sku'] }}</view> <view class="sub" @click="navToGoods(item)">规格:{{ item['sku'] }}</view>
<view class="flex jc-between ai-end"> <view class="flex jc-between ai-end">
<view class="price flex ai-end" @click="navToGoods(item['productId'])"> <view class="price flex ai-end" @click="navToGoods(item)">
<text style="color:#E92727">¥</text> <text style="color:#E92727">¥</text>
<text style="color:#E92727;font-size: 32rpx;line-height: 48rpx">{{ item['price'] }}</text> <text style="color:#E92727;font-size: 32rpx;line-height: 48rpx">{{ item['price'] }}</text>
<text style="margin-left: 10rpx;text-decoration:line-through">¥{{ item['otPrice'] }}</text> <text style="margin-left: 10rpx;text-decoration:line-through">¥{{ item['otPrice'] }}</text>
@@ -347,9 +347,16 @@ export default {
this.fetchProduct() this.fetchProduct()
}, },
methods: { methods: {
navToGoods(id) { navToGoods(item) {
if(item.isInvalid) {
uni.showToast({
title: '商品已下架',
icon: 'none'
})
return
}
uni.navigateTo({ uni.navigateTo({
url: "/pages/shop/GoodsCon/index?id=" + id url: "/pages/shop/GoodsCon/index?id=" + item.productId
}) })
}, },
changeTabs(index) { changeTabs(index) {