Commit 0d58c631 authored by GuanHua's avatar GuanHua

fix: 进货单商品推荐问题

parent 957a1049
......@@ -219,13 +219,31 @@ const RecommendCommodity: React.FC<BannerPropsType> = (props) => {
setModalVisible(true)
}
const fetchCategoryByCommodityId = (idList: number[]) => {
return new Promise((resolve) => {
const param = {
idList
}
PublicApi.postSearchMobileShopStoreGetCategoryByCommodityId(param).then((res) => {
if (res.code === 1000) {
resolve(res.data)
}
})
})
}
// const changeData = (dataList) => {
// }
const handleModalOk = async () => {
const selectResult = productRowCtl.selectRow
if (!selectResult || isEmpty(selectResult)) {
message.info("请选择")
return null
}
console.log(productRowCtl.selectedRowKeys, "productRowCtl.selectedRowKeys")
fetchCategoryByCommodityId(productRowCtl.selectedRowKeys)
// const newList = [...list]
// newList.map(item => {
// if (item.sort === currentInfo?.sort) {
......
......@@ -64,7 +64,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
const param: any = {
current: 1,
pageSize: 5,
categoryId
customerCategoryId: categoryId,
}
let headers = {}
let getListFn
......@@ -84,7 +84,7 @@ const Recommand: React.FC<RecommandPropsType> = (props) => {
getListFn = PublicApi.postSearchShopChannelGetCommodityList
break
default:
getListFn = PublicApi.postSearchShopStoreGetCommodityList
getListFn = PublicApi.postSearchShopEnterpriseGetCommodityList
break
}
getListFn && getListFn(param, { headers }).then(res => {
......
......@@ -198,8 +198,6 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
const shopInfo = await fetchShopInfo()
mobileShopHeaderNav[mobileShopHeaderNav.key].props.shopInfo = shopInfo
mobileShopCommodityList[mobileShopCommodityList.key].props.storeId = shopInfo.id
if(appConfig?.backdropBO) {
mobileShopHeaderNav[mobileShopHeaderNav.key].props.backdrop = appConfig?.backdropBO.backdrop
}
......@@ -214,10 +212,12 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = (props) => {
if(appConfig?.productBO) {
mobileShopCommodityList[mobileShopCommodityList.key].props = {
storeId: shopInfo.id,
title: appConfig.productBO.title,
productIdList: appConfig.productBO.productIdList
}
} else {
mobileShopCommodityList[mobileShopCommodityList.key].props.storeId = shopInfo.id
mobileShopCommodityList[mobileShopCommodityList.key].props.title = '热销商品'
}
......
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