Commit d0be42d0 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

fix: 修改赠送商品的选择

parent 3cd07ef3
......@@ -6,7 +6,9 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
import { PublicApi } from '@/services/api';
export interface CollocationLayoutProps {
moda?: 'checkbox' | 'radio' ,
/** 活动类型 */
isGift?: number,
moda?: 'checkbox' | 'radio',
/** */
idNotInList?: number[],
/** 适用商城 */
......@@ -20,7 +22,7 @@ export interface CollocationLayoutProps {
}
const CollocationLayout: React.FC<CollocationLayoutProps> = (props: any) => {
const { moda = 'checkbox', idNotInList, shopIdList, visible, toggle, onConfirm } = props;
const { isGift, moda = 'checkbox', idNotInList, shopIdList, visible, toggle, onConfirm } = props;
/** 选择活动商品columns */
const columns: ColumnType<any>[] = [
{
......@@ -58,8 +60,14 @@ const CollocationLayout: React.FC<CollocationLayoutProps> = (props: any) => {
},
]
const handleFetchData = useCallback((params: any) => {
const newParams = {
idNotInList,
shopIdList,
...params,
}
isGift === 6 && (newParams.isGift = true)
return new Promise(resolve => {
PublicApi.postProductCommodityGetCommoditySkuListByShopId({ idNotInList, shopIdList, ...params }, { ctlType: 'none' }).then(res => {
PublicApi.postProductCommodityGetCommoditySkuListByShopId({ ...newParams }, { ctlType: 'none' }).then(res => {
if (res.code !== 1000) {
return
}
......@@ -84,7 +92,7 @@ const CollocationLayout: React.FC<CollocationLayoutProps> = (props: any) => {
console.warn(error)
})
})
}, [shopIdList, idNotInList])
}, [shopIdList, idNotInList, isGift])
const handleOk = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
const rowRecord: any[] = [...selectRowRecord]
......
......@@ -64,6 +64,7 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
useEffect(() => {
if (focus$) {
console.log(focus$, 10086)
setValue(focus$)
setDataSource([])
}
......@@ -207,6 +208,7 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
/>
{/* 选择活动商品 */}
<CollocationLayout
isGift={value}
visible={productVisible}
idNotInList={idNotInList}
shopIdList={shopIdList}
......
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