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
043bee1b
Commit
043bee1b
authored
Dec 07, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改叠加活动互斥
parent
82b912ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
41 deletions
+92
-41
constants.ts
...nage/marketing/waitAddedMarketing/components/constants.ts
+63
-37
index.tsx
...eting/waitAddedMarketing/components/rulesLayout/index.tsx
+29
-4
No files found.
src/pages/marketingManage/marketing/waitAddedMarketing/components/constants.ts
View file @
043bee1b
...
...
@@ -29,49 +29,75 @@ export const OVERLAYACTIVITYTYPE = (int) => {
case
1
:
case
2
:
case
3
:
return
[
{
label
:
'满量促销'
,
value
:
4
},
{
label
:
'满额促销'
,
value
:
5
},
{
label
:
'赠送促销'
,
value
:
6
},
{
label
:
'换购'
,
value
:
13
},
]
return
{
B
:
[
{
label
:
'满量促销'
,
value
:
4
},
{
label
:
'满额促销'
,
value
:
5
},
],
C
:
[
{
label
:
'赠送促销'
,
value
:
6
},
{
label
:
'换购'
,
value
:
13
},
]
}
case
4
:
case
5
:
return
[
{
label
:
'特价促销'
,
value
:
1
},
{
label
:
'直降促销'
,
value
:
2
},
{
label
:
'折扣促销'
,
value
:
3
},
{
label
:
'赠送促销'
,
value
:
6
},
{
label
:
'换购'
,
value
:
13
},
]
return
{
A
:
[
{
label
:
'特价促销'
,
value
:
1
},
{
label
:
'直降促销'
,
value
:
2
},
{
label
:
'折扣促销'
,
value
:
3
},
],
B
:
[
{
label
:
'赠送促销'
,
value
:
6
},
],
C
:
[
{
label
:
'换购'
,
value
:
13
},
],
}
case
6
:
return
[
{
label
:
'特价促销'
,
value
:
1
},
{
label
:
'直降促销'
,
value
:
2
},
{
label
:
'折扣促销'
,
value
:
3
},
{
label
:
'满量促销'
,
value
:
4
},
{
label
:
'满额促销'
,
value
:
5
},
{
label
:
'多件促销'
,
value
:
7
},
{
label
:
'组合促销'
,
value
:
8
},
{
label
:
'换购'
,
value
:
13
},
]
return
{
A
:
[
{
label
:
'特价促销'
,
value
:
1
},
{
label
:
'直降促销'
,
value
:
2
},
{
label
:
'折扣促销'
,
value
:
3
},
],
B
:
[
{
label
:
'满量促销'
,
value
:
4
},
{
label
:
'满额促销'
,
value
:
5
},
],
C
:
[
{
label
:
'多件促销'
,
value
:
7
},
{
label
:
'组合促销'
,
value
:
8
},
{
label
:
'换购'
,
value
:
13
},
],
}
case
7
:
case
8
:
return
[
{
label
:
'赠送促销'
,
value
:
6
},
{
label
:
'换购'
,
value
:
13
},
]
return
{
B
:
[
{
label
:
'赠送促销'
,
value
:
6
},
],
C
:
[
{
label
:
'换购'
,
value
:
13
},
]
}
case
13
:
return
[
{
label
:
'特价促销'
,
value
:
1
},
{
label
:
'直降促销'
,
value
:
2
},
{
label
:
'折扣促销'
,
value
:
3
},
{
label
:
'满量促销'
,
value
:
4
},
{
label
:
'满额促销'
,
value
:
5
},
{
label
:
'多件促销'
,
value
:
6
},
{
label
:
'组合促销'
,
value
:
7
},
{
label
:
'换购'
,
value
:
8
},
]
return
{
A
:
[
{
label
:
'特价促销'
,
value
:
1
},
{
label
:
'直降促销'
,
value
:
2
},
{
label
:
'折扣促销'
,
value
:
3
},
],
B
:
[
{
label
:
'满量促销'
,
value
:
4
},
{
label
:
'满额促销'
,
value
:
5
},
],
C
:
[
{
label
:
'多件促销'
,
value
:
6
},
{
label
:
'组合促销'
,
value
:
7
},
{
label
:
'换购'
,
value
:
8
},
],
}
}
}
/** 超限规则 */
...
...
src/pages/marketingManage/marketing/waitAddedMarketing/components/rulesLayout/index.tsx
View file @
043bee1b
import
React
,
{
Fragment
,
useState
}
from
'react'
;
import
{
OVERLAYACTIVITYTYPE
,
OVERRUNRULETYPE
,
PROMOTIONTYPE
,
LADDERBOLIST
}
from
'../constants'
import
{
OVERLAYACTIVITYTYPE
,
PROMOTIONTYPE
,
LADDERBOLIST
}
from
'../constants'
import
{
Form
,
Checkbox
,
Radio
,
Input
,
Space
,
Button
,
DatePicker
,
Select
}
from
'antd'
;
import
{
EventEmitter
}
from
'@umijs/hooks/lib/useEventEmitter'
;
import
{
FormInstance
}
from
'antd/es/form/Form'
;
...
...
@@ -28,6 +28,7 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
const
{
focus$
,
form
}
=
props
;
const
[
option
,
setOption
]
=
useState
<
optionProps
>
();
const
[
ladderType
,
setLadderType
]
=
useState
<
number
>
(
1
);
const
[
rejec
,
setRejec
]
=
useState
<
any
>
({});
const
handleActivityDefinedBO
=
(
e
)
=>
{
const
{
value
}
=
e
.
target
...
...
@@ -39,6 +40,18 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
form
.
resetFields
([
'activityDefined'
]);
});
const
rejection
=
(
key
:
string
,
num
:
number
)
=>
{
console
.
log
(
num
,
10086
)
const
data
=
{
...
rejec
};
if
(
data
[
key
]
===
num
)
{
data
[
key
]
=
null
}
else
{
data
[
key
]
=
num
}
setRejec
({
...
data
})
}
/** 叠加活动类型 */
const
allowActivity
=
(
int
=
1
)
=>
{
switch
(
int
)
{
...
...
@@ -60,9 +73,21 @@ const RulesLayout: React.FC<RulesLayoutProps> = (props: any) => {
className=
{
style
.
rulesLayout
}
>
<
Checkbox
.
Group
>
{
OVERLAYACTIVITYTYPE
(
int
)?.
map
(
item
=>
(
<
Checkbox
key=
{
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Checkbox
>
))
}
{
!
isEmpty
(
OVERLAYACTIVITYTYPE
(
int
)?.
A
)
&&
(
OVERLAYACTIVITYTYPE
(
int
)?.
A
!
.
map
(
item
=>
(
<
Checkbox
key=
{
item
.
value
}
value=
{
item
.
value
}
disabled=
{
rejec
?.
A
&&
item
.
value
!==
rejec
?.
A
}
onChange=
{
(
value
)
=>
rejection
(
'A'
,
item
.
value
)
}
>
{
item
.
label
}
</
Checkbox
>
))
)
}
{
!
isEmpty
(
OVERLAYACTIVITYTYPE
(
int
)?.
B
)
&&
(
OVERLAYACTIVITYTYPE
(
int
)?.
B
.
map
(
item
=>
(
<
Checkbox
key=
{
item
.
value
}
value=
{
item
.
value
}
disabled=
{
rejec
?.
B
&&
item
.
value
!==
rejec
?.
B
}
onChange=
{
(
value
)
=>
rejection
(
'B'
,
item
.
value
)
}
>
{
item
.
label
}
</
Checkbox
>
))
)
}
{
!
isEmpty
(
OVERLAYACTIVITYTYPE
(
int
)?.
C
)
&&
(
OVERLAYACTIVITYTYPE
(
int
)?.
C
.
map
(
item
=>
(
<
Checkbox
key=
{
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Checkbox
>
))
)
}
</
Checkbox
.
Group
>
</
Form
.
Item
>
)
...
...
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