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
黄庭坚
jinfa-platform
Commits
01093727
Commit
01093727
authored
Jul 28, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对接优惠券发券相关
parent
1c8c5039
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
26 deletions
+91
-26
index.tsx
...Ability/merchantCoupon/components/DeliverCoupon/index.tsx
+0
-0
schema.tsx
...bility/merchantCoupon/components/DeliverCoupon/schema.tsx
+36
-19
index.tsx
...y/merchantCoupon/merchantCouponAnalysis/deliver/index.tsx
+55
-7
No files found.
src/pages/transaction/marketingAbility/merchantCoupon/components/DeliverCoupon/index.tsx
View file @
01093727
This diff is collapsed.
Click to expand it.
src/pages/transaction/marketingAbility/merchantCoupon/components/DeliverCoupon/schema.tsx
View file @
01093727
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-29 09:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
6-29 10:18:11
* @LastEditTime: 2021-0
7-28 17:49:07
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
...
...
@@ -31,7 +31,7 @@ export const querySchema: ISchema = {
'x-component'
:
'Search'
,
'x-component-props'
:
{
placeholder
:
'搜索'
,
tip
:
'输入
优惠劵
名称 进行搜索'
,
tip
:
'输入
会员
名称 进行搜索'
,
},
},
},
...
...
@@ -45,33 +45,48 @@ export const querySchema: ISchema = {
},
},
properties
:
{
i
d
:
{
memberI
d
:
{
type
:
'string'
,
'x-component-props'
:
{
placeholder
:
'
优惠劵
ID'
,
placeholder
:
'
会员
ID'
,
allowClear
:
true
,
style
:
{
width
:
160
,
},
},
memberType
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'会员类型(所有)'
,
allowClear
:
true
,
},
},
'[startTime2, endTime2]'
:
{
type
:
'object'
,
'x-component'
:
'RangePicker'
,
level
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
[
'劵有效期起始时间'
,
'劵有效期截止时间'
]
,
showTime
:
true
,
placeholder
:
'会员等级(所有)'
,
allowClear
:
true
,
},
},
t
ype
:
{
suitableMemberT
ype
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'
优惠劵类型
(所有)'
,
placeholder
:
'
适用用户
(所有)'
,
allowClear
:
true
,
},
},
'[startTime2, endTime2]'
:
{
type
:
'string'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
placeholder
:
[
'成为会员起始时间'
,
'成为会员截止时间'
],
showTime
:
true
,
},
},
submit
:
{
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
...
...
@@ -105,17 +120,19 @@ export const drawerSchema: ISchema = {
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
grid
:
true
,
full
:
true
,
autoRow
:
true
,
columns
:
4
,
},
properties
:
{
i
d
:
{
memberI
d
:
{
type
:
'string'
,
'x-component'
:
'NumberPicker'
,
'x-component-props'
:
{
placeholder
:
'会员ID'
,
allowClear
:
true
,
},
},
memberType
:
{
memberType
Enum
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
...
...
@@ -124,7 +141,7 @@ export const drawerSchema: ISchema = {
allowClear
:
true
,
},
},
memberL
evel
:
{
l
evel
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
...
...
@@ -133,7 +150,7 @@ export const drawerSchema: ISchema = {
allowClear
:
true
,
},
},
applicabl
e
:
{
suitableMemberTyp
e
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
...
...
@@ -142,7 +159,7 @@ export const drawerSchema: ISchema = {
allowClear
:
true
,
},
},
'[
startTime2, endTime2
]'
:
{
'[
becomeTimeStart, becomeTimeEnd
]'
:
{
type
:
'string'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponAnalysis/deliver/index.tsx
View file @
01093727
...
...
@@ -2,15 +2,21 @@
* @Author: XieZhiXiong
* @Date: 2021-06-28 17:51:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-
06 14:07:32
* @Description:
* @LastEditTime: 2021-07-
28 17:33:55
* @Description:
商家优惠劵发劵
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Row
,
Col
,
Spin
,
Button
,
message
,
}
from
'antd'
;
import
{
SendOutlined
,
}
from
'@ant-design/icons'
;
import
{
history
}
from
'umi'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetMarketingCouponWaiteExecuteGetResponse
}
from
'@/services/MarketingApi'
;
...
...
@@ -19,18 +25,21 @@ import AnchorPage from '@/layouts/AnchorPage';
import
AuditProcess
from
'@/components/AuditProcess'
;
import
BacisInfo
from
'../../components/BacisInfo'
;
import
CouponRules
from
'../../components/CouponRules'
;
import
DeliverCoupon
from
'../../components/DeliverCoupon'
;
import
DeliverCoupon
,
{
SuitableMemberType
}
from
'../../components/DeliverCoupon'
;
const
MerchantCouponAnalysisDeliver
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
id
}
=
usePageStatus
();
const
[
couponInfo
,
setCouponInfo
]
=
useState
<
GetMarketingCouponWaiteExecuteGetResponse
>
(
null
);
const
[
infoLoading
,
setInfoLoaading
]
=
useState
(
false
);
const
[
infoLoading
,
setInfoLoading
]
=
useState
(
false
);
const
[
submitLoading
,
setSubmitLoading
]
=
useState
(
false
);
const
deliverRef
=
useRef
<
SuitableMemberType
[]
>
([]);
const
getBasicInfo
=
()
=>
{
if
(
!
id
)
{
return
;
}
setInfoLoa
a
ding
(
true
);
setInfoLoading
(
true
);
PublicApi
.
getMarketingCouponWaiteExecuteGet
({
id
,
}).
then
(
res
=>
{
...
...
@@ -38,7 +47,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
setCouponInfo
(
res
.
data
);
}
}).
finally
(()
=>
{
setInfoLoa
a
ding
(
false
);
setInfoLoading
(
false
);
});
};
...
...
@@ -46,6 +55,34 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
getBasicInfo
();
},
[]);
const
handleDeliverChange
=
(
value
:
SuitableMemberType
[])
=>
{
deliverRef
.
current
=
value
;
};
const
handleSubmit
=
()
=>
{
if
(
!
id
)
{
return
;
}
if
(
!
deliverRef
.
current
.
length
)
{
message
.
warning
(
'未选择任何会员'
);
return
;
}
setSubmitLoading
(
true
);
PublicApi
.
postMarketingCouponWaiteExecuteGrant
({
id
:
+
id
,
grantMembers
:
deliverRef
.
current
.
map
((
item
)
=>
({
subMemberId
:
item
.
memberId
,
subRoleId
:
item
.
roleId
})),
}).
then
(
res
=>
{
if
(
res
.
code
!==
1000
)
{
return
;
}
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}).
finally
(()
=>
{
setSubmitLoading
(
false
);
});
};
const
anchorsArr
=
[
{
key
:
'verifySteps'
,
...
...
@@ -70,6 +107,16 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
<
AnchorPage
title=
{
couponInfo
?.
name
}
anchors=
{
anchorsArr
}
extra=
{
(
<
Button
type=
"primary"
icon=
{
<
SendOutlined
style=
{
{
transform
:
`rotate(-45deg)`
,
position
:
'relative'
,
top
:
-
2
}
}
/>
}
onClick=
{
handleSubmit
}
loading=
{
submitLoading
}
>
提交
</
Button
>
)
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 流转记录 */
}
...
...
@@ -121,6 +168,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
{
/* 优惠券规则 */
}
<
Col
span=
{
24
}
>
<
DeliverCoupon
onChange=
{
handleDeliverChange
}
id=
"deliverCoupon"
/>
</
Col
>
...
...
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