Commit 0d58c631 authored by GuanHua's avatar GuanHua

fix: 进货单商品推荐问题

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