Fix:5536 【商城小程序】订单详情点击商品图片区域之前是可以进入商品详情的,现在点击无法进入商品详情页

(cherry picked from commit 3cd6f29e32)
This commit is contained in:
linxi
2026-07-24 11:37:47 +08:00
committed by lifizer
parent 01c400bb7e
commit 6ab3d5cc75
+47 -7
View File
@@ -254,22 +254,22 @@
<image
v-if="cart.combinationId === 0 && cart.bargainId === 0 &&cart.seckillId === 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 1, { id: cart.productInfo.id })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.combinationId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 2, { id: cart.combinationId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.bargainId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 3, { id: cart.bargainId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
<image
v-else-if="cart.seckillId > 0"
:src="cart.productInfo.image"
@click.stop="gotoGoodDetail(cart, 4, { id: cart.seckillId })"
@click.stop="gotoGoodDetail(orderListIndex, cartInfoIndex)"
/>
</view>
<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-存在
const isProductStillExist = cart.isProductStillExist || 0
const isProductStillExist = Number(cart.isProductStillExist || 0)
if (isProductStillExist === 0) {
this.$dialog.toast({ mes: '商品已下架' })
return
@@ -1321,7 +1351,17 @@ export default {
path = '/pages/activity/SeckillDetails/index'
break
}
this.$yrouter.push({ path, query })
if (!path) {
uni.showToast({
title: '未找到商品详情页',
icon: 'none'
})
return
}
this.$yrouter.push({
path,
query: { id }
})
},
getOrderData() {
getOrderData().then(res => {