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
42828018
Commit
42828018
authored
Dec 31, 2021
by
前端-黄佳鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改平台营销活动
parent
51b017ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
36 deletions
+43
-36
marketing.ts
src/constants/const/marketing.ts
+15
-0
add.tsx
...ages/marketingManage/marketing/waitAddedMarketing/add.tsx
+6
-23
index.tsx
...eting/waitAddedMarketing/components/basicLayout/index.tsx
+20
-13
yapi_hashmaps.json
yapi_hashmaps.json
+2
-0
No files found.
src/constants/const/marketing.ts
View file @
42828018
...
...
@@ -65,3 +65,18 @@
* 老会员(仅会员用户)
*/
export
const
SUITABLE_TYPE_OLD_MEMBER
=
4
;
/**
* 活动参与类型 - 商家报名活动 1
*/
export
const
AVTIVITY_SIGNUP_MERCHANTREG
=
1
;
/**
* 活动参与类型 - 平台自建活动 2
*/
export
const
AVTIVITY_SIGNUP_PLATFORM
=
2
;
/**
* 活动类型 - 抽奖 10
*/
export
const
AVTIVITY_TYPE_LOTTERY
=
10
;
src/pages/marketingManage/marketing/waitAddedMarketing/add.tsx
View file @
42828018
...
...
@@ -2,7 +2,6 @@
import
React
,
{
Fragment
,
useEffect
,
useState
}
from
'react'
;
import
{
history
,
Prompt
}
from
'umi'
;
import
{
Form
,
Button
}
from
'antd'
;
import
{
ACTIVITYTYPEARRAY
}
from
'./components/constants'
;
import
PeripheralLayout
from
'@/components/DetailLayout'
;
import
BasicInfoLayout
from
'./components/basicLayout'
;
import
RulesLayout
from
'./components/rulesLayout'
;
...
...
@@ -14,7 +13,10 @@ import ApplyMemberLayout from './components/applyMember';
import
{
useEventEmitter
}
from
'@umijs/hooks'
;
import
PrizeListLayout
from
'./components/prizeListLayout'
;
import
{
isEmpty
}
from
'@antv/util'
;
import
{
getMarketingMerchantActivityGetActivityTypeList
,
getMarketingPlatformActivityDetail
,
getMarketingPlatformMerchantActivityGetActivityTypeList
,
postMarketingPlatformActivitySave
,
postMarketingPlatformActivityUpdate
}
from
'@/services/MarketingV2Api'
;
import
{
getMarketingMerchantActivityGetActivityTypeList
,
getMarketingPlatformActivityDetail
,
postMarketingPlatformActivitySave
,
postMarketingPlatformActivityUpdate
}
from
'@/services/MarketingV2Api'
;
import
{
AVTIVITY_TYPE_LOTTERY
}
from
'@/constants/const/marketing'
;
const
layout
:
any
=
{
colon
:
false
,
...
...
@@ -30,25 +32,6 @@ const Link = [
{
id
:
'applyMemberLayout'
,
title
:
'适用会员'
},
]
// const avtivityTypes = [
// { lable: '特价促销', value: 1 },
// { lable: '直降促销', value: 2 },
// { lable: '折价促销', value: 3 },
// { lable: '满量促销', value: 4 },
// { lable: '满额促销', value: 5 },
// { lable: '赠送促销', value: 6 },
// { lable: '多件促销', value: 7 },
// { lable: '组合促销', value: 8 },
// { lable: '拼团', value: 9 },
// { lable: '抽奖', value: 10 },
// { lable: '砍价', value: 11 },
// { lable: '秒杀', value: 12 },
// { lable: '换购', value: 13 },
// { lable: '预售', value: 14 },
// { lable: '套餐', value: 15 },
// { lable: '试用', value: 16 },
// ]
type
objType
=
{
lable
:
string
,
value
:
number
...
...
@@ -317,9 +300,9 @@ const AddedMarketing = (props: any) => {
form=
{
form
}
{
...
layout
}
>
<
BasicInfoLayout
form=
{
form
}
focus
$=
{
focus$
}
isEdit=
{
path
===
'edit'
?
true
:
false
}
/>
<
BasicInfoLayout
avtivityTypes=
{
avtivityTypes
}
form=
{
form
}
focus
$=
{
focus$
}
isEdit=
{
path
===
'edit'
?
true
:
false
}
/>
<
RulesLayout
form=
{
form
}
focus
$=
{
focus$
}
/>
{
value
===
10
&&
(<
PrizeListLayout
form=
{
form
}
prizeList=
{
prizeList
}
focus
$=
{
value
}
/>)
}
{
value
===
AVTIVITY_TYPE_LOTTERY
&&
(<
PrizeListLayout
form=
{
form
}
prizeList=
{
prizeList
}
focus
$=
{
value
}
/>)
}
<
PartakeUserLayout
onGetLevel=
{
handleGetLevel
}
onSetLevel=
{
memberLevelList
}
setMemberType=
{
memberType
}
/>
<
ShopLayout
onGetShopList=
{
handleGetShopList
}
onSetShopList=
{
shopList
}
/>
<
ApplyMemberLayout
dataView=
{
dataView
}
getInviteList=
{
getInviteList
}
/>
...
...
src/pages/marketingManage/marketing/waitAddedMarketing/components/basicLayout/index.tsx
View file @
42828018
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
CardLayout
from
'../card'
;
import
{
ACTIVITYTYPEARRAY
}
from
'../constants'
;
import
{
Form
,
Row
,
Col
,
Input
,
Select
,
Radio
,
Tooltip
,
Space
,
DatePicker
}
from
'antd'
;
import
{
FormInstance
}
from
'antd/es/form/Form'
;
import
{
EventEmitter
}
from
'@umijs/hooks/lib/useEventEmitter'
import
moment
from
'moment'
;
import
{
QuestionCircleOutlined
}
from
'@ant-design/icons'
;
import
{
isEmpty
}
from
'@formily/antd/esm/shared'
;
import
{
AVTIVITY_SIGNUP_MERCHANTREG
,
AVTIVITY_SIGNUP_PLATFORM
,
AVTIVITY_TYPE_LOTTERY
}
from
'@/constants/const/marketing'
;
const
{
Option
}
=
Select
;
const
text
=
"商家报名活动指由平台建立的,商家参与的营销活动,平台创建活动后,不设置活动商品,由商家报名参加,活动商品由平台从报名通过的商家商品中选择。平台自建活动为平台单独使用的活动,目前平台自建活动仅支持抽奖活动。"
interface
BasicInfoProps
{
/** 活动类型 */
avtivityTypes
:
any
[],
focus$
?:
EventEmitter
<
void
>
,
/** FormInstance */
form
?:
FormInstance
,
...
...
@@ -19,7 +26,7 @@ interface BasicInfoProps {
}
const
BasicInfoLayout
:
React
.
FC
<
BasicInfoProps
>
=
(
props
:
any
)
=>
{
const
{
focus$
,
form
,
isEdit
}
=
props
;
const
{
focus$
,
form
,
isEdit
,
avtivityTypes
}
=
props
;
const
[
activitySignUpType
,
setActivitySignUpType
]
=
useState
<
Number
>
(
0
)
const
startTimeDisabled
=
(
current
,
name
)
=>
{
...
...
@@ -55,20 +62,20 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
};
const
handleChange
=
(
e
,
option
)
=>
{
if
(
e
!==
10
)
{
setActivitySignUpType
(
1
)
form
.
setFieldsValue
({
'activitySignUpType'
:
1
})
if
(
e
!==
AVTIVITY_TYPE_LOTTERY
)
{
setActivitySignUpType
(
AVTIVITY_SIGNUP_MERCHANTREG
)
form
.
setFieldsValue
({
'activitySignUpType'
:
AVTIVITY_SIGNUP_MERCHANTREG
})
}
else
{
setActivitySignUpType
(
2
)
form
.
setFieldsValue
({
'activitySignUpType'
:
2
})
setActivitySignUpType
(
AVTIVITY_SIGNUP_PLATFORM
)
form
.
setFieldsValue
({
'activitySignUpType'
:
AVTIVITY_SIGNUP_PLATFORM
})
}
focus$
.
emit
(
option
);
}
useEffect
(()
=>
{
if
(
isEdit
)
{
setActivitySignUpType
(
1
);
form
.
setFieldsValue
({
'activitySignUpType'
:
1
})
setActivitySignUpType
(
AVTIVITY_SIGNUP_MERCHANTREG
);
form
.
setFieldsValue
({
'activitySignUpType'
:
AVTIVITY_SIGNUP_MERCHANTREG
})
}
},
[
isEdit
])
...
...
@@ -94,7 +101,7 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
rules=
{
[{
required
:
true
,
message
:
'请输入活动名称'
}]
}
>
<
Select
placeholder=
"请选择活动类型"
onChange=
{
handleChange
}
disabled=
{
isEdit
}
>
{
ACTIVITYTYPEARRAY
.
map
((
item
)
=>
<
Option
key=
{
'ACTIVITY_TYPE'
+
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
lable
}
</
Option
>)
}
{
!
isEmpty
(
avtivityTypes
)
&&
avtivityTypes
.
map
((
item
)
=>
<
Option
key=
{
'ACTIVITY_TYPE'
+
item
.
value
}
value=
{
item
.
value
}
>
{
item
.
lable
}
</
Option
>)
}
</
Select
>
</
Form
.
Item
>
<
Form
.
Item
...
...
@@ -103,8 +110,8 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
rules=
{
[{
required
:
true
,
message
:
'请输入活动名称'
}]
}
>
<
Radio
.
Group
disabled
>
<
Radio
value=
{
1
}
>
商家报名活动
</
Radio
>
<
Radio
value=
{
2
}
>
平台自建活动
</
Radio
>
<
Radio
value=
{
AVTIVITY_SIGNUP_MERCHANTREG
}
>
商家报名活动
</
Radio
>
<
Radio
value=
{
AVTIVITY_SIGNUP_PLATFORM
}
>
平台自建活动
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
</
Col
>
...
...
@@ -188,7 +195,7 @@ const BasicInfoLayout: React.FC<BasicInfoProps> = (props: any) => {
</
Form
.
Item
>
</
Space
>
</
Form
.
Item
>
{
activitySignUpType
===
1
&&
(
{
activitySignUpType
===
AVTIVITY_SIGNUP_MERCHANTREG
&&
(
<
Form
.
Item
label=
"要求报名时间"
style=
{
{
margin
:
0
}
}
...
...
yapi_hashmaps.json
0 → 100644
View file @
42828018
{}
\ No newline at end of file
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