Fix(订单):[#1358]下架商品从订单列表点击商品图,需提示:商品已下架

This commit is contained in:
lifizer
2024-04-29 14:22:54 +08:00
parent 9c68817612
commit 62a53ad6d1
+44 -18
View File
@@ -35,24 +35,26 @@
<view class="item-info acea-row row-between row-top" v-for="(cart,cartInfoIndex) in order.cartInfo" <view class="item-info acea-row row-between row-top" v-for="(cart,cartInfoIndex) in order.cartInfo"
:key="cartInfoIndex"> :key="cartInfoIndex">
<view class="pictrue"> <view class="pictrue">
<image :src="cart.productInfo.image" @click.stop=" <image
$yrouter.push({ path: '/pages/shop/GoodsCon/index',query:{id:cart.productInfo.id} }) v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"
" v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"/> :src="cart.productInfo.image"
<image :src="cart.productInfo.image" @click.stop=" @click.stop="gotoGoodDetail(cart, 1, { id: cart.productInfo.id })"
$yrouter.push({ />
path: '/pages/activity/GroupDetails/index',query:{id:cart.combinationId} <image
}) v-else-if="cart.combinationId > 0"
" v-else-if="cart.combinationId > 0"/> :src="cart.productInfo.image"
<image :src="cart.productInfo.image" @click.stop=" @click.stop="gotoGoodDetail(cart, 2, { id: cart.combinationId })"
$yrouter.push({ />
path: '/pages/activity/DargainDetails/index',query:{id:cart.bargainId} <image
}) v-else-if="cart.bargainId > 0"
" v-else-if="cart.bargainId > 0"/> :src="cart.productInfo.image"
<image :src="cart.productInfo.image" @click.stop=" @click.stop="gotoGoodDetail(cart, 3, { id: cart.bargainId })"
$yrouter.push({ />
path: '/pages/activity/SeckillDetails/index',query:{id:cart.seckillId} <image
}) v-else-if="cart.seckillId > 0"
" v-else-if="cart.seckillId > 0"/> :src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
/>
</view> </view>
<view class="text"> <view class="text">
<view class="acea-row name-wrap"> <view class="acea-row name-wrap">
@@ -238,6 +240,30 @@ export default {
} }
} }
}, },
gotoGoodDetail(cart, type, query){
// isProductStillExist:0-不存在,1-存在
const isProductStillExist = cart.isProductStillExist || 0
if (isProductStillExist === 0) {
this.$dialog.toast({ mes: '商品已下架' })
return
}
let path = ''
switch(type) {
case 1:
path = '/pages/shop/GoodsCon/index'
break
case 2:
path = '/pages/activity/GroupDetails/index'
break
case 3:
path = '/pages/activity/DargainDetails/index'
break
case 4:
path = '/pages/activity/SeckillDetails/index'
break
}
this.$yrouter.push({ path, query })
},
getOrderData() { getOrderData() {
getOrderData().then(res => { getOrderData().then(res => {
this.orderData = res.data; this.orderData = res.data;