Fix:2983 【商城小程序】被下架的商品在购物车中消失(改为前端数据保留,点击时提醒商品已下架或被删除)
This commit is contained in:
+20
-6
@@ -146,20 +146,20 @@
|
|||||||
:src="good['productInfo']['attrInfo']['image']"
|
:src="good['productInfo']['attrInfo']['image']"
|
||||||
class="good-cover flex-0 v12-radius-16"
|
class="good-cover flex-0 v12-radius-16"
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
@click="navToGood(good)"
|
@click="navToGood(good, item)"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-else
|
v-else
|
||||||
:src="good['productInfo']['image']"
|
:src="good['productInfo']['image']"
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
class="good-cover flex-0"
|
class="good-cover flex-0"
|
||||||
@click="navToGood(good)"
|
@click="navToGood(good, item)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view style="width: 100%">
|
<view style="width: 100%">
|
||||||
<view
|
<view
|
||||||
class="one-t v12-font-28"
|
class="one-t v12-font-28"
|
||||||
@click="navToGood(good)"
|
@click="navToGood(good, item)"
|
||||||
>{{ good['productInfo']['storeName'] }}</view>
|
>{{ good['productInfo']['storeName'] }}</view>
|
||||||
<view
|
<view
|
||||||
class="sku ai-center"
|
class="sku ai-center"
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
class="v12-font-bold v12-primary-text"
|
class="v12-font-bold v12-primary-text"
|
||||||
@click="navToGood(good)"
|
@click="navToGood(good, item)"
|
||||||
>
|
>
|
||||||
<text class="bold v12-font-22">¥</text>
|
<text class="bold v12-font-22">¥</text>
|
||||||
<text class="v12-font-36">{{ good['truePrice'] }}</text>
|
<text class="v12-font-36">{{ good['truePrice'] }}</text>
|
||||||
@@ -500,7 +500,13 @@ export default {
|
|||||||
const res = await getCartGroup()
|
const res = await getCartGroup()
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.isLoad = true
|
this.isLoad = true
|
||||||
this.list = res.data['valid'].concat(res.data['invalid'])
|
const invalid = res.data['invalid'].map(e => {
|
||||||
|
return {
|
||||||
|
...e,
|
||||||
|
isInvalid: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.list = res.data['valid'].concat(invalid)
|
||||||
this.handleAll(false)
|
this.handleAll(false)
|
||||||
const _res = await getUserLike()
|
const _res = await getUserLike()
|
||||||
this.userLikeList = _res.data
|
this.userLikeList = _res.data
|
||||||
@@ -751,7 +757,15 @@ export default {
|
|||||||
this.currGood = {}
|
this.currGood = {}
|
||||||
this.showAttr = false
|
this.showAttr = false
|
||||||
},
|
},
|
||||||
navToGood(good) {
|
navToGood(good, item) {
|
||||||
|
if(item.isInvalid) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '商品已下架',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
const query = {
|
const query = {
|
||||||
id: good.productId
|
id: good.productId
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user