Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
project
jinfa-admin
Commits
f54b2f9b
Commit
f54b2f9b
authored
Aug 09, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接新增活动页接口
parent
96e30ebb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
13 deletions
+93
-13
index.ts
config/routes/index.ts
+1
-1
index.tsx
src/pages/home/components/TodayAdd/index.tsx
+2
-1
index.tsx
...ng/marketingActivitiesManagement/activePage/add/index.tsx
+67
-10
schema.tsx
...g/marketingActivitiesManagement/activePage/add/schema.tsx
+18
-1
useSetMallData.tsx
...ingActivitiesManagement/activePage/add/useSetMallData.tsx
+5
-0
No files found.
config/routes/index.ts
View file @
f54b2f9b
...
@@ -108,7 +108,7 @@ const router = [
...
@@ -108,7 +108,7 @@ const router = [
// },
// },
// ...routeList,
// ...routeList,
// merchantMarketingRoute,
// merchantMarketingRoute,
//
marketingRoutes,
marketingRoutes
,
// platformCouponManageRoute,
// platformCouponManageRoute,
...
asyncRoutes
,
...
asyncRoutes
,
// purchaseBidRoute,
// purchaseBidRoute,
...
...
src/pages/home/components/TodayAdd/index.tsx
View file @
f54b2f9b
...
@@ -12,6 +12,7 @@ import { ItodayAdd } from '../../common/interface'
...
@@ -12,6 +12,7 @@ import { ItodayAdd } from '../../common/interface'
import
useViewRequest
from
'../../common/hooks/useViewRequest'
;
import
useViewRequest
from
'../../common/hooks/useViewRequest'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetReportPlatformHomeGetNewlyAddedDayReportResponse
}
from
'@/services/reportApi'
;
import
{
GetReportPlatformHomeGetNewlyAddedDayReportResponse
}
from
'@/services/reportApi'
;
import
{
priceFormat
}
from
'@/utils/numberFomat'
interface
Iprops
{}
interface
Iprops
{}
...
@@ -21,7 +22,7 @@ const TodayAdd: React.FC<Iprops> = (props) => {
...
@@ -21,7 +22,7 @@ const TodayAdd: React.FC<Iprops> = (props) => {
const
list
=
useMemo
(()
=>
[
const
list
=
useMemo
(()
=>
[
{
{
title
:
'今日新增订单(元)'
,
title
:
'今日新增订单(元)'
,
number
:
responseData
?.
orderAmount
,
number
:
priceFormat
(
responseData
?.
orderAmount
)
,
icon
:
orderIcon
,
icon
:
orderIcon
,
percent
:
responseData
?.
orderGrowthRate
||
0
percent
:
responseData
?.
orderGrowthRate
||
0
},
},
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/add/index.tsx
View file @
f54b2f9b
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
NiceForm
from
'@/components/NiceForm'
;
import
RangeTime
from
'@/components/RangeTime/FormilyRangeTime'
;
import
RangeTime
from
'@/components/RangeTime/FormilyRangeTime'
;
import
{
Button
,
Space
}
from
'antd'
import
{
Button
,
Space
}
from
'antd'
...
@@ -8,18 +8,54 @@ import schema from './schema';
...
@@ -8,18 +8,54 @@ import schema from './schema';
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
history
}
from
'umi'
;
import
{
history
}
from
'umi'
;
import
{
BgColorsOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
BgColorsOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
createFormActions
}
from
'@formily/antd'
;
import
{
FormEffectHooks
,
createFormActions
,
FormPath
}
from
'@formily/antd'
import
FormilyTemplateDrawer
from
'../components/TemplateDrawer/formilyTemplateDrawer'
;
import
FormilyTemplateDrawer
from
'../components/TemplateDrawer/formilyTemplateDrawer'
;
const
actions
=
createFormActions
()
import
{
PublicApi
}
from
'@/services/api'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
const
actions
=
createFormActions
();
const
{
onFieldInputChange$
,
onFieldChange$
}
=
FormEffectHooks
;
const
Add
=
()
=>
{
const
Add
=
()
=>
{
const
[
initialValue
,
setInitialValue
]
=
useState
<
any
>
(
null
);
const
onSubmit
=
(
values
:
any
)
=>
{
const
onSubmit
=
(
values
:
any
)
=>
{
}
}
useEffect
(()
=>
{
setInitialValue
({
environment
:
1
,
mall
:
'34'
,
})
},
[])
useEffect
(()
=>
{
if
(
!
initialValue
)
{
return
;
}
async
function
setMall
()
{
const
data
=
await
fetchMallData
({
environment
:
initialValue
.
environment
}
as
any
);
actions
.
setFieldState
(
"mall"
,
state
=>
{
state
.
props
.
enum
=
data
;
})
}
setMall
()
},
[
initialValue
])
const
fetchMallData
=
async
(
params
:
{
shopType
:
number
,
environment
:
number
})
=>
{
const
data
=
[{
label
:
'123'
,
value
:
'34'
}];
const
data2
=
[{
label
:
'test'
,
value
:
'1'
},
{
label
:
'test1'
,
value
:
'2'
}]
return
new
Promise
((
resolve
)
=>
{
setTimeout
(()
=>
{
resolve
(
params
.
environment
===
1
?
data
:
data2
)
},
1000
)
})
}
return
(
return
(
<
PageHeaderWrapper
<
PageHeaderWrapper
title=
"
账户详情
"
title=
"
新增活动页
"
onBack=
{
()
=>
history
.
goBack
()
}
onBack=
{
()
=>
history
.
goBack
()
}
backIcon=
{
<
ReutrnEle
/>
}
backIcon=
{
<
ReutrnEle
/>
}
extra=
{
extra=
{
...
@@ -36,13 +72,34 @@ const Add = () => {
...
@@ -36,13 +72,34 @@ const Add = () => {
schema=
{
schema
}
schema=
{
schema
}
actions=
{
actions
}
actions=
{
actions
}
components=
{
{
RangeTime
,
FormilyTemplateDrawer
}
}
components=
{
{
RangeTime
,
FormilyTemplateDrawer
}
}
value=
{
{
effects=
{
(
$
,
formAction
)
=>
{
template
:
{
const
linkage
=
useLinkageUtils
()
id
:
1
,
onFieldInputChange$
(
'environment'
).
subscribe
((
fieldState
)
=>
{
template
:
'嘻嘻嘻'
,
const
value
=
fieldState
.
value
;
image
:
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201601%2F19%2F20160119142753_dB5a3.thumb.700_0.jpeg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1630132740&t=c7f669f0e84521b179cb6776f98ffccb'
formAction
.
setFieldState
(
'mall'
,
state
=>
{
}
FormPath
.
setIn
(
state
,
'props.x-props.hasFeedback'
,
true
)
})
linkage
.
loading
(
'mall'
);
fetchMallData
({
environment
:
value
}
as
any
)
.
then
((
data
)
=>
{
formAction
.
setFieldState
(
"mall"
,
state
=>
{
state
.
originAsyncData
=
data
;
state
.
value
=
""
;
})
linkage
.
loaded
(
"mall"
)
linkage
.
enum
(
"mall"
,
data
);
})
});
}
}
}
}
// value={{
// template: {
// id: 1,
// template: '嘻嘻嘻',
// image: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201601%2F19%2F20160119142753_dB5a3.thumb.700_0.jpeg&refer=http%3A%2F%2Fb-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1630132740&t=c7f669f0e84521b179cb6776f98ffccb'
// }
// }}
value=
{
initialValue
}
/>
/>
</
div
>
</
div
>
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/add/schema.tsx
View file @
f54b2f9b
...
@@ -28,7 +28,24 @@ const schema: ISchema = {
...
@@ -28,7 +28,24 @@ const schema: ISchema = {
},
},
environment
:
{
environment
:
{
type
:
'string'
,
type
:
'string'
,
enum
:
[],
enum
:
[
{
label
:
'WEB'
,
value
:
1
,
},
{
label
:
'H5'
,
value
:
2
,
},
{
label
:
'小程序'
,
value
:
3
,
},
{
label
:
'APP'
,
value
:
4
,
}
],
title
:
'活动页使用环境'
,
title
:
'活动页使用环境'
,
required
:
true
,
required
:
true
,
},
},
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/add/useSetMallData.tsx
0 → 100644
View file @
f54b2f9b
import
React
from
'react'
function
useSetMallData
()
{
}
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