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
shenshaokai
jinfa-admin
Commits
76a9f7c5
Commit
76a9f7c5
authored
Aug 09, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 活动页bug
parent
618cd1a4
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
47 additions
and
25 deletions
+47
-25
index.ts
config/routes/index.ts
+1
-1
environment.ts
src/constants/const/environment.ts
+20
-0
index.tsx
...ng/marketingActivitiesManagement/activePage/add/index.tsx
+10
-8
schema.tsx
...g/marketingActivitiesManagement/activePage/add/schema.tsx
+1
-1
index.tsx
...esManagement/activePage/components/ActivityItem/index.tsx
+4
-3
index.tsx
...ment/activePage/components/ActivityTemplateItem/index.tsx
+3
-8
formilyTemplateDrawer.tsx
...ePage/components/TemplateDrawer/formilyTemplateDrawer.tsx
+0
-1
index.less
...anagement/activePage/components/TemplateDrawer/index.less
+1
-0
useGetData.tsx
...anagement/activePage/fixtures/common/hooks/useGetData.tsx
+5
-1
index.json
...tiesManagement/activePage/fixtures/common/mock/index.json
+2
-2
No files found.
config/routes/index.ts
View file @
76a9f7c5
...
@@ -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/constants/const/environment.ts
0 → 100644
View file @
76a9f7c5
/** 1.WEB 2.H5 3.小程序 4.APP */
/** WEB */
export
const
WEB
=
1
;
/** h5 */
export
const
H5
=
2
;
/** 小程序 */
export
const
APPLETS
=
3
;
/** APP */
export
const
APP
=
4
;
export
const
enumName
=
{
[
WEB
]:
'WEB'
,
[
H5
]:
'H5'
,
[
APPLETS
]:
'小程序'
,
[
APP
]:
'APP'
};
src/pages/marketing/marketingActivitiesManagement/activePage/add/index.tsx
View file @
76a9f7c5
...
@@ -2,9 +2,9 @@ import React, { useEffect, useMemo, useState } from 'react';
...
@@ -2,9 +2,9 @@ import React, { useEffect, useMemo, useState } from 'react';
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
;
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
,
message
}
from
'antd'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
ReutrnEle
from
'@/components/ReturnEle'
;
import
{
history
}
from
'umi'
;
import
{
history
,
useLocation
}
from
'umi'
;
import
{
BgColorsOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
BgColorsOutlined
,
SaveOutlined
}
from
'@ant-design/icons'
;
import
{
FormEffectHooks
,
createFormActions
,
FormPath
}
from
'@formily/antd'
;
import
{
FormEffectHooks
,
createFormActions
,
FormPath
}
from
'@formily/antd'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
@@ -14,7 +14,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
...
@@ -14,7 +14,7 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import
schema
from
'./schema'
;
import
schema
from
'./schema'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
FormilyTemplateDrawer
from
'../components/TemplateDrawer/formilyTemplateDrawer'
;
import
FormilyTemplateDrawer
from
'../components/TemplateDrawer/formilyTemplateDrawer'
;
import
{
useLocation
}
from
'umi'
;
const
actions
=
createFormActions
();
const
actions
=
createFormActions
();
...
@@ -41,7 +41,7 @@ type SubmitType = {
...
@@ -41,7 +41,7 @@ type SubmitType = {
}
}
const
Add
=
()
=>
{
const
Add
=
()
=>
{
const
{
id
,
...
rest
}
=
usePageStatus
();
const
{
id
,
}
=
usePageStatus
();
const
{
pathname
}
=
useLocation
();
const
{
pathname
}
=
useLocation
();
const
isEdit
=
useMemo
(()
=>
id
!==
''
&&
pathname
.
includes
(
"edit"
),
[
id
]);
const
isEdit
=
useMemo
(()
=>
id
!==
''
&&
pathname
.
includes
(
"edit"
),
[
id
]);
const
isView
=
useMemo
(()
=>
id
!==
''
&&
pathname
.
includes
(
"view"
),
[
id
]);
const
isView
=
useMemo
(()
=>
id
!==
''
&&
pathname
.
includes
(
"view"
),
[
id
]);
...
@@ -51,6 +51,10 @@ const Add = () => {
...
@@ -51,6 +51,10 @@ const Add = () => {
const
onSubmit
=
async
(
values
:
SubmitType
)
=>
{
const
onSubmit
=
async
(
values
:
SubmitType
)
=>
{
const
{
template
,
startTime
,
endTime
,
...
rest
}
=
values
;
const
{
template
,
startTime
,
endTime
,
...
rest
}
=
values
;
if
(
!
template
?.
templateId
)
{
message
.
error
(
"请填写活动模板"
);
return
;
}
const
startTimeStamp
=
moment
(
startTime
,
'YYYY-MM-DD HH:mm:ss'
).
valueOf
();
const
startTimeStamp
=
moment
(
startTime
,
'YYYY-MM-DD HH:mm:ss'
).
valueOf
();
const
endTimeStamp
=
moment
(
endTime
,
'YYYY-MM-DD HH:mm:ss'
).
valueOf
();
const
endTimeStamp
=
moment
(
endTime
,
'YYYY-MM-DD HH:mm:ss'
).
valueOf
();
setLoading
(
true
);
setLoading
(
true
);
...
@@ -177,10 +181,8 @@ const Add = () => {
...
@@ -177,10 +181,8 @@ const Add = () => {
linkage
.
loading
(
'shopId'
);
linkage
.
loading
(
'shopId'
);
fetchMallData
({
environment
:
value
.
toString
(),
shopType
:
'1'
}
as
any
)
fetchMallData
({
environment
:
value
.
toString
(),
shopType
:
'1'
}
as
any
)
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
formAction
.
setFieldState
(
"shopId"
,
state
=>
{
formAction
.
setFieldValue
(
"shopId"
,
""
);
state
.
originAsyncData
=
data
;
formAction
.
setFieldValue
(
'template'
,
{});
state
.
value
=
""
;
});
linkage
.
loaded
(
"shopId"
);
linkage
.
loaded
(
"shopId"
);
linkage
.
enum
(
"shopId"
,
data
);
linkage
.
enum
(
"shopId"
,
data
);
});
});
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/add/schema.tsx
View file @
76a9f7c5
...
@@ -57,7 +57,7 @@ const schema: ISchema = {
...
@@ -57,7 +57,7 @@ const schema: ISchema = {
]
]
},
},
template
:
{
template
:
{
type
:
'
object
'
,
type
:
'
string
'
,
"x-component"
:
'FormilyTemplateDrawer'
,
"x-component"
:
'FormilyTemplateDrawer'
,
"x-component-props"
:
{},
"x-component-props"
:
{},
title
:
'活动模板'
,
title
:
'活动模板'
,
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/components/ActivityItem/index.tsx
View file @
76a9f7c5
...
@@ -4,6 +4,7 @@ import { DeleteOutlined, EditOutlined, PlayCircleOutlined } from '@ant-design/ic
...
@@ -4,6 +4,7 @@ import { DeleteOutlined, EditOutlined, PlayCircleOutlined } from '@ant-design/ic
import
{
Button
,
Space
,
Popconfirm
}
from
'antd'
;
import
{
Button
,
Space
,
Popconfirm
}
from
'antd'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
import
{
Link
}
from
'umi'
;
import
{
Link
}
from
'umi'
;
import
{
enumName
}
from
'@/constants/const/environment'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
interface
Iprops
{
interface
Iprops
{
...
@@ -15,7 +16,7 @@ interface Iprops {
...
@@ -15,7 +16,7 @@ interface Iprops {
endTime
:
string
,
endTime
:
string
,
statusName
:
string
,
statusName
:
string
,
id
:
number
,
id
:
number
,
/** */
/**
1.WEB 2.H5 3.小程序 4.APP
*/
environment
:
1
|
2
|
3
|
4
|
number
,
environment
:
1
|
2
|
3
|
4
|
number
,
onRemove
?:
((
id
:
number
)
=>
void
)
|
null
,
onRemove
?:
((
id
:
number
)
=>
void
)
|
null
,
/** 1.待上线, 2已上线, 3进行中 4已下线 5已结束 */
/** 1.待上线, 2已上线, 3进行中 4已下线 5已结束 */
...
@@ -33,7 +34,7 @@ const END = 5;
...
@@ -33,7 +34,7 @@ const END = 5;
const
format
=
'YYYY-MM-DD HH:mm:ss'
;
const
format
=
'YYYY-MM-DD HH:mm:ss'
;
const
ActiveItem
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
ActiveItem
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
title
,
templateName
,
shopName
,
startTime
,
endTime
,
statusName
,
templatePicUrl
,
id
,
onRemove
,
status
,
onChangeStatus
}
=
props
;
const
{
title
,
templateName
,
shopName
,
startTime
,
endTime
,
statusName
,
templatePicUrl
,
id
,
onRemove
,
status
,
onChangeStatus
,
environment
}
=
props
;
const
handleRemove
=
()
=>
{
const
handleRemove
=
()
=>
{
onRemove
?.(
id
);
onRemove
?.(
id
);
...
@@ -60,7 +61,7 @@ const ActiveItem: React.FC<Iprops> = (props: Iprops) => {
...
@@ -60,7 +61,7 @@ const ActiveItem: React.FC<Iprops> = (props: Iprops) => {
<
div
className=
{
styles
.
tags
}
>
<
div
className=
{
styles
.
tags
}
>
<
Space
>
<
Space
>
<
StatusTag
type=
"default"
title=
{
templateName
}
/>
<
StatusTag
type=
"default"
title=
{
templateName
}
/>
<
StatusTag
type=
"warnning"
title=
{
"web"
}
/>
<
StatusTag
type=
"warnning"
title=
{
enumName
[
environment
]
||
''
}
/>
</
Space
>
</
Space
>
</
div
>
</
div
>
<
div
className=
{
styles
.
mall
}
>
<
div
className=
{
styles
.
mall
}
>
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/components/ActivityTemplateItem/index.tsx
View file @
76a9f7c5
import
React
from
'react'
;
import
React
from
'react'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
StatusTag
from
'@/components/StatusTag'
;
import
{
Checkbox
}
from
'antd'
;
import
{
Checkbox
}
from
'antd'
;
import
{
enumName
}
from
'@/constants/const/environment'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
interface
Iprops
{
interface
Iprops
{
checked
:
boolean
checked
:
boolean
onSelect
?:
((
selected
:
boolean
,
postData
:
any
)
=>
void
)
|
null
,
onSelect
?:
((
selected
:
boolean
,
postData
:
any
)
=>
void
)
|
null
,
...
@@ -13,13 +15,6 @@ interface Iprops {
...
@@ -13,13 +15,6 @@ interface Iprops {
}
}
}
}
const
ENVIRONMENT_MAP
=
{
'1'
:
'WEB'
,
'2'
:
'H5'
,
'3'
:
'APP'
,
'4'
:
'小程序'
};
const
ActivityTemplateItem
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
ActivityTemplateItem
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
checked
,
onSelect
=
null
,
dataSource
}
=
props
;
const
{
checked
,
onSelect
=
null
,
dataSource
}
=
props
;
const
onChange
=
(
selected
:
boolean
)
=>
{
const
onChange
=
(
selected
:
boolean
)
=>
{
...
@@ -39,7 +34,7 @@ const ActivityTemplateItem: React.FC<Iprops> = (props: Iprops) => {
...
@@ -39,7 +34,7 @@ const ActivityTemplateItem: React.FC<Iprops> = (props: Iprops) => {
<
p
>
{
dataSource
.
templateDescribe
}
</
p
>
<
p
>
{
dataSource
.
templateDescribe
}
</
p
>
</
div
>
</
div
>
<
div
className=
{
styles
.
tag
}
>
<
div
className=
{
styles
.
tag
}
>
<
StatusTag
type=
"primary"
title=
{
ENVIRONMENT_MAP
[
dataSource
.
environment
]
}
/>
<
StatusTag
type=
"primary"
title=
{
enumName
[
dataSource
.
environment
]
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/components/TemplateDrawer/formilyTemplateDrawer.tsx
View file @
76a9f7c5
...
@@ -36,7 +36,6 @@ const FormilyTemplateDrawer: React.FC<Iprops> & { isFieldComponent: boolean } =
...
@@ -36,7 +36,6 @@ const FormilyTemplateDrawer: React.FC<Iprops> & { isFieldComponent: boolean } =
templateName
:
record
.
templateName
,
templateName
:
record
.
templateName
,
templatePicUrl
:
record
.
templatePicUrl
,
templatePicUrl
:
record
.
templatePicUrl
,
};
};
console
.
log
(
data
);
mutators
.
change
(
data
);
mutators
.
change
(
data
);
setVisible
(
false
);
setVisible
(
false
);
};
};
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/components/TemplateDrawer/index.less
View file @
76a9f7c5
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
display: flex;
display: flex;
flex-direction: row;
flex-direction: row;
align-items: center;
align-items: center;
width: 100%;
.image {
.image {
width: 32px;
width: 32px;
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/fixtures/common/hooks/useGetData.tsx
View file @
76a9f7c5
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
use
Memo
,
use
State
}
from
'react'
;
import
mock
from
'../mock/index.json'
;
import
mock
from
'../mock/index.json'
;
function
getData
():
Promise
<
any
>
{
function
getData
():
Promise
<
any
>
{
...
@@ -21,6 +21,10 @@ function useGetData() {
...
@@ -21,6 +21,10 @@ function useGetData() {
fetchData
();
fetchData
();
},
[]);
},
[]);
const
adapter
=
useMemo
(()
=>
{
},
[
dataSource
]);
return
{
dataSource
,
};
return
{
dataSource
,
};
}
}
...
...
src/pages/marketing/marketingActivitiesManagement/activePage/fixtures/common/mock/index.json
View file @
76a9f7c5
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"status"
:
true
,
"status"
:
true
,
"details"
:
"https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/4f0f6362b2a348b993cc3139030356021611023985966.png"
"details"
:
"https://shushangyun-lingxi.oss-cn-shenzhen.aliyuncs.com/4f0f6362b2a348b993cc3139030356021611023985966.png"
},
},
"coupon"
:{
"coupon"
:{
"sort"
:
2
,
"sort"
:
2
,
"style"
:
0
,
"style"
:
0
,
"status"
:
true
,
"status"
:
true
,
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
{
"id"
:
1
,
"type"
:
2
},
{
"id"
:
1
,
"type"
:
2
},
{
"id"
:
2
,
"type"
:
2
}
{
"id"
:
2
,
"type"
:
2
}
]
]
},
},
"hot"
:{
"hot"
:{
"sort"
:
3
,
"sort"
:
3
,
"style"
:
0
,
"style"
:
0
,
...
...
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