Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
999b1347
Commit
999b1347
authored
Sep 03, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix(商家营销活动): 修复活动商品接口多次请求的问题
parent
18681003
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
index.tsx
...n/marketingAbility/components/productListLayout/index.tsx
+1
-1
add.tsx
.../marketingAbility/paltformSign/readySubmitExamine/add.tsx
+10
-9
No files found.
src/pages/transaction/marketingAbility/components/productListLayout/index.tsx
View file @
999b1347
...
...
@@ -149,7 +149,7 @@ const ProductListLayout: React.FC<ProductListProps> = (props: any) => {
setIdNotInList
([...
idNotInList
,
...
res
.
data
.
data
.
map
(
item
=>
item
.
skuId
)])
})
}
},
[
activityId
])
},
[
!
isEmpty
(
activityId
)
])
useEffect
(()
=>
{
handlesStFieldsValue
()
...
...
src/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/add.tsx
View file @
999b1347
import
React
,
{
useCallback
,
useState
}
from
'react'
;
import
{
Button
,
message
,
Form
}
from
'antd'
;
import
{
Button
,
Form
}
from
'antd'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
useEventEmitter
}
from
'@umijs/hooks'
;
import
{
Context
}
from
'@/pages/transaction/components/detailLayout/components/context'
;
...
...
@@ -35,8 +35,9 @@ const DetialLayout = () => {
const
[
form
]
=
Form
.
useForm
();
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
)
const
[
unsaved
,
setUnsaved
]
=
useState
<
boolean
>
(
false
);
const
[
productList
,
setProductList
]
=
useState
<
any
[]
>
([]);
const
[
shopIdList
,
setShopIdList
]
=
useState
<
number
[]
>
([]);
const
[
signUpIds
,
setSignUpIds
]
=
useState
<
number
>
();
const
format
=
(
text
,
fmt
?:
string
)
=>
{
return
<>
{
moment
(
text
).
format
(
fmt
||
"YYYY-MM-DD HH:mm:ss"
)
}
</>
}
...
...
@@ -77,7 +78,7 @@ const DetialLayout = () => {
}
}
const
fetchDataSource
=
useCallback
(
async
()
=>
{
const
fetchDataSource
=
async
()
=>
{
await
PublicApi
.
getMarketingPlatformActivitySignupDetail
({
activityId
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
!==
1000
)
{
return
...
...
@@ -94,21 +95,22 @@ const DetialLayout = () => {
})
})
data
.
externalLogStates
=
externalLogStates
;
const
option
:
any
=
{
value
:
data
.
activityType
};
const
option
:
any
=
{
value
:
data
.
activityType
};
focus$
.
emit
(
option
)
setDataSource
(
data
);
handleBasicEffect
(
data
);
setShopIdList
(
data
.
shopList
.
map
(
item
=>
{
return
item
.
shopId
}));
setActivityDefinedBO
(
data
.
activityDefinedBO
)
handleGeneralEffect
(
data
.
activityDefinedBO
,
data
.
activityType
)
setSignUpIds
(
signUpId
)
}).
catch
(()
=>
{
})
}
,
[])
}
useEffect
(()
=>
{
fetchDataSource
();
},
[])
const
handleSubmit
=
useCallback
(
async
()
=>
{
const
handleSubmit
=
()
=>
{
form
.
validateFields
().
then
(
res
=>
{
const
param
:
any
=
{
activityId
,
...
...
@@ -149,7 +151,7 @@ const DetialLayout = () => {
setLoading
(
false
)
})
})
}
,
[
productList
])
}
return
(
<
Context
.
Provider
value=
{
dataSource
}
>
...
...
@@ -184,8 +186,7 @@ const DetialLayout = () => {
anchor=
"activityRuleLayout"
effect=
{
generalEffect
}
/>
{
/* <ProductListLayout signUpId={signUpId !== 'null' && signUpId} data={dataSource} getDataSource={handleGetDataSoure} /> */
}
<
ProductListLayout
getActivityDefinedBO=
{
activityDefinedBO
}
activityId=
{
signUpId
&&
{
signUpId
:
signUpId
}
}
form=
{
form
}
focus
$=
{
focus$
}
shopIdList=
{
shopIdList
}
fieldApi=
{
PublicApi
.
getMarketingPlatformActivitySignupDetailGoodsPage
}
/>
<
ProductListLayout
getActivityDefinedBO=
{
activityDefinedBO
}
activityId=
{
signUpIds
&&
{
signUpId
:
signUpIds
}
}
form=
{
form
}
focus
$=
{
focus$
}
shopIdList=
{
shopIdList
}
fieldApi=
{
PublicApi
.
getMarketingPlatformActivitySignupDetailGoodsPage
}
/>
<
ActivityUserLayout
dataScoure=
{
dataSource
}
/>
<
DemandLayout
storeList=
{
dataSource
.
shopList
}
/>
<
RecordLyout
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment