Commit 1ddfbc6a authored by 前端-许佳敏's avatar 前端-许佳敏
parents 0c689478 999b1347
...@@ -149,7 +149,7 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => { ...@@ -149,7 +149,7 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
setIdNotInList([...idNotInList, ...res.data.data.map(item => item.skuId)]) setIdNotInList([...idNotInList, ...res.data.data.map(item => item.skuId)])
}) })
} }
}, [activityId]) }, [!isEmpty(activityId)])
useEffect(() => { useEffect(() => {
handlesStFieldsValue() handlesStFieldsValue()
......
import React, { useCallback, useState } from 'react'; import React, { useCallback, useState } from 'react';
import { Button, message, Form } from 'antd'; import { Button, Form } from 'antd';
import { history, Prompt } from 'umi'; import { history, Prompt } from 'umi';
import { useEventEmitter } from '@umijs/hooks'; import { useEventEmitter } from '@umijs/hooks';
import { Context } from '@/pages/transaction/components/detailLayout/components/context'; import { Context } from '@/pages/transaction/components/detailLayout/components/context';
...@@ -35,8 +35,9 @@ const DetialLayout = () => { ...@@ -35,8 +35,9 @@ const DetialLayout = () => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [loading, setLoading] = useState<boolean>(false) const [loading, setLoading] = useState<boolean>(false)
const [unsaved, setUnsaved] = useState<boolean>(false); const [unsaved, setUnsaved] = useState<boolean>(false);
const [productList, setProductList] = useState<any[]>([]);
const [shopIdList, setShopIdList] = useState<number[]>([]); const [shopIdList, setShopIdList] = useState<number[]>([]);
const [signUpIds, setSignUpIds] = useState<number>();
const format = (text, fmt?: string) => { const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</> return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
} }
...@@ -77,7 +78,7 @@ const DetialLayout = () => { ...@@ -77,7 +78,7 @@ const DetialLayout = () => {
} }
} }
const fetchDataSource = useCallback(async () => { const fetchDataSource = async () => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then((res: any) => { await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then((res: any) => {
if (res.code !== 1000) { if (res.code !== 1000) {
return return
...@@ -94,21 +95,22 @@ const DetialLayout = () => { ...@@ -94,21 +95,22 @@ const DetialLayout = () => {
}) })
}) })
data.externalLogStates = externalLogStates; data.externalLogStates = externalLogStates;
const option: any = {value: data.activityType}; const option: any = { value: data.activityType };
focus$.emit(option) focus$.emit(option)
setDataSource(data); setDataSource(data);
handleBasicEffect(data); handleBasicEffect(data);
setShopIdList(data.shopList.map(item => { return item.shopId })); setShopIdList(data.shopList.map(item => { return item.shopId }));
setActivityDefinedBO(data.activityDefinedBO) setActivityDefinedBO(data.activityDefinedBO)
handleGeneralEffect(data.activityDefinedBO, data.activityType) handleGeneralEffect(data.activityDefinedBO, data.activityType)
setSignUpIds(signUpId)
}).catch(() => { }) }).catch(() => { })
}, []) }
useEffect(() => { useEffect(() => {
fetchDataSource(); fetchDataSource();
}, []) }, [])
const handleSubmit = useCallback(async () => { const handleSubmit = () => {
form.validateFields().then(res => { form.validateFields().then(res => {
const param: any = { const param: any = {
activityId, activityId,
...@@ -149,7 +151,7 @@ const DetialLayout = () => { ...@@ -149,7 +151,7 @@ const DetialLayout = () => {
setLoading(false) setLoading(false)
}) })
}) })
}, [productList]) }
return ( return (
<Context.Provider value={dataSource}> <Context.Provider value={dataSource}>
...@@ -184,8 +186,7 @@ const DetialLayout = () => { ...@@ -184,8 +186,7 @@ const DetialLayout = () => {
anchor="activityRuleLayout" anchor="activityRuleLayout"
effect={generalEffect} effect={generalEffect}
/> />
{/* <ProductListLayout signUpId={signUpId !== 'null' && signUpId} data={dataSource} getDataSource={handleGetDataSoure} /> */} <ProductListLayout getActivityDefinedBO={activityDefinedBO} activityId={signUpIds && { signUpId: signUpIds }} form={form} focus$={focus$} shopIdList={shopIdList} fieldApi={PublicApi.getMarketingPlatformActivitySignupDetailGoodsPage} />
<ProductListLayout getActivityDefinedBO={activityDefinedBO} activityId={signUpId && {signUpId: signUpId}} form={form} focus$={focus$} shopIdList={shopIdList} fieldApi={PublicApi.getMarketingPlatformActivitySignupDetailGoodsPage} />
<ActivityUserLayout dataScoure={dataSource} /> <ActivityUserLayout dataScoure={dataSource} />
<DemandLayout storeList={dataSource.shopList} /> <DemandLayout storeList={dataSource.shopList} />
<RecordLyout /> <RecordLyout />
......
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