Commit 20cdb407 authored by GuanHua's avatar GuanHua

fix: 渠道商品获取库存传参问题

parent 37562e6a
......@@ -351,6 +351,9 @@ const CommodityDetail = (props) => {
}, [selectAttrVal, commodityDetail])
/**
* 获取商品价格区间
*/
const getCommodityPriceRange = () => {
if (commodityDetail?.unitPricePicList) {
for (const item of commodityDetail?.unitPricePicList) {
......@@ -366,13 +369,20 @@ const CommodityDetail = (props) => {
setSelectCommodityUnitPriceId(item.commodityUnitPriceAndPicId)
setCurrentPriceRange(sortUnitPrice(item.unitPrice))
setAttrAndValList(item)
getStockCountByProductId(item.id)
let productId: number = item.id
if (layoutType === LAYOUT_TYPE.channel || layoutType === LAYOUT_TYPE.ichannel) {
productId = item.commodityUnitPriceAndPicId
}
getStockCountByProductId(productId)
}
}
}
}
/**
* 根据商品skuid获取商品库存数量
* @param productId
*/
const getStockCountByProductId = (productId: number) => {
const param: any = {
productId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment