mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
feat(商品详情): 增加商品参数初始化和详细信息获取的参数检查
This commit is contained in:
@@ -121,13 +121,23 @@ export default {
|
||||
// })
|
||||
// },
|
||||
getGoodsDetail () {
|
||||
if(this.toUser.storeFlag){
|
||||
ServeGetGoodsDetail(this.goodsParams).then(res => {
|
||||
if (res.success) {
|
||||
this.goodsDetail = res.result.data
|
||||
}
|
||||
})
|
||||
// 检查必要参数是否存在
|
||||
if (!this.toUser.storeFlag) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.goodsParams || !this.goodsParams.goodsId) {
|
||||
console.warn('getGoodsDetail: goodsParams 或 goodsId 参数缺失')
|
||||
return
|
||||
}
|
||||
|
||||
ServeGetGoodsDetail(this.goodsParams).then(res => {
|
||||
if (res.success) {
|
||||
this.goodsDetail = res.result.data
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取商品详情失败:', error)
|
||||
})
|
||||
},
|
||||
getFootPrint() {
|
||||
if (this.toUser.storeFlag) {
|
||||
@@ -284,4 +294,4 @@ export default {
|
||||
/deep/ .el-tabs__header{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user