Fix:5536 【商城小程序】订单详情点击商品图片区域之前是可以进入商品详情的,现在点击无法进入商品详情页
This commit is contained in:
@@ -254,22 +254,22 @@
|
|||||||
<image
|
<image
|
||||||
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"
|
:src="cart.productInfo.image"
|
||||||
@click.stop="gotoGoodDetail(cart, 1, { id: cart.productInfo.id })"
|
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-else-if="cart.combinationId > 0"
|
v-else-if="cart.combinationId > 0"
|
||||||
:src="cart.productInfo.image"
|
:src="cart.productInfo.image"
|
||||||
@click.stop="gotoGoodDetail(cart, 2, { id: cart.combinationId })"
|
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-else-if="cart.bargainId > 0"
|
v-else-if="cart.bargainId > 0"
|
||||||
:src="cart.productInfo.image"
|
:src="cart.productInfo.image"
|
||||||
@click.stop="gotoGoodDetail(cart, 3, { id: cart.bargainId })"
|
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
|
||||||
/>
|
/>
|
||||||
<image
|
<image
|
||||||
v-else-if="cart.seckillId > 0"
|
v-else-if="cart.seckillId > 0"
|
||||||
:src="cart.productInfo.image"
|
:src="cart.productInfo.image"
|
||||||
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
|
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="text" style="margin-top: 0 !important;">
|
<view class="text" style="margin-top: 0 !important;">
|
||||||
@@ -1299,9 +1299,39 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
gotoGoodDetail(cart, type, query){
|
gotoGoodDetail(orderOrIndex, cartOrIndex) {
|
||||||
|
const order = this.getOrderByIndex(orderOrIndex)
|
||||||
|
const cartList = Array.isArray(order && order.cartInfo) ? order.cartInfo : []
|
||||||
|
const cart = typeof cartOrIndex === 'number' ? cartList[cartOrIndex] : cartOrIndex
|
||||||
|
if (!cart) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未获取到商品信息',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const productInfo = cart.productInfo || {}
|
||||||
|
let type = 1
|
||||||
|
let id = productInfo.id || cart.productId || ''
|
||||||
|
if (Number(cart.combinationId) > 0) {
|
||||||
|
type = 2
|
||||||
|
id = cart.combinationId
|
||||||
|
} else if (Number(cart.bargainId) > 0) {
|
||||||
|
type = 3
|
||||||
|
id = cart.bargainId
|
||||||
|
} else if (Number(cart.seckillId) > 0) {
|
||||||
|
type = 4
|
||||||
|
id = cart.seckillId
|
||||||
|
}
|
||||||
|
if (!id) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未获取到商品详情参数',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
// isProductStillExist:0-不存在,1-存在
|
// isProductStillExist:0-不存在,1-存在
|
||||||
const isProductStillExist = cart.isProductStillExist || 0
|
const isProductStillExist = Number(cart.isProductStillExist || 0)
|
||||||
if (isProductStillExist === 0) {
|
if (isProductStillExist === 0) {
|
||||||
this.$dialog.toast({ mes: '商品已下架' })
|
this.$dialog.toast({ mes: '商品已下架' })
|
||||||
return
|
return
|
||||||
@@ -1321,7 +1351,17 @@ export default {
|
|||||||
path = '/pages/activity/SeckillDetails/index'
|
path = '/pages/activity/SeckillDetails/index'
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
this.$yrouter.push({ path, query })
|
if (!path) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '未找到商品详情页',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$yrouter.push({
|
||||||
|
path,
|
||||||
|
query: { id }
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getOrderData() {
|
getOrderData() {
|
||||||
getOrderData().then(res => {
|
getOrderData().then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user