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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
27 deletions
+92
-27
index.tsx
...Ability/merchantCoupon/components/DeliverCoupon/index.tsx
+0
-0
schema.tsx
...bility/merchantCoupon/components/DeliverCoupon/schema.tsx
+37
-20
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 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-06-29 09:36:35
* @Date: 2021-06-29 09:36:35
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
6-29 10:18:11
* @LastEditTime: 2021-0
7-28 17:49:07
* @Description:
* @Description:
*/
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
ISchema
}
from
'@formily/antd'
;
...
@@ -31,7 +31,7 @@ export const querySchema: ISchema = {
...
@@ -31,7 +31,7 @@ export const querySchema: ISchema = {
'x-component'
:
'Search'
,
'x-component'
:
'Search'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'搜索'
,
placeholder
:
'搜索'
,
tip
:
'输入
优惠劵
名称 进行搜索'
,
tip
:
'输入
会员
名称 进行搜索'
,
},
},
},
},
},
},
...
@@ -45,33 +45,48 @@ export const querySchema: ISchema = {
...
@@ -45,33 +45,48 @@ export const querySchema: ISchema = {
},
},
},
},
properties
:
{
properties
:
{
i
d
:
{
memberI
d
:
{
type
:
'string'
,
type
:
'string'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'
优惠劵
ID'
,
placeholder
:
'
会员
ID'
,
allowClear
:
true
,
allowClear
:
true
,
style
:
{
width
:
160
,
},
},
},
},
},
'[startTime2, endTime2]'
:
{
memberType
:
{
type
:
'object'
,
type
:
'string'
,
'x-component'
:
'RangePicker'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
[
'劵有效期起始时间'
,
'劵有效期截止时间'
]
,
placeholder
:
'会员类型(所有)'
,
showTime
:
true
,
allowClear
:
true
,
},
},
},
},
type
:
{
level
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
default
:
undefined
,
enum
:
[],
enum
:
[],
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'
优惠劵类型
(所有)'
,
placeholder
:
'
会员等级
(所有)'
,
allowClear
:
true
,
allowClear
:
true
,
},
},
},
},
suitableMemberType
:
{
type
:
'string'
,
default
:
undefined
,
enum
:
[],
'x-component-props'
:
{
placeholder
:
'适用用户(所有)'
,
allowClear
:
true
,
},
},
'[startTime2, endTime2]'
:
{
type
:
'string'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
placeholder
:
[
'成为会员起始时间'
,
'成为会员截止时间'
],
showTime
:
true
,
},
},
submit
:
{
submit
:
{
'x-component'
:
'Submit'
,
'x-component'
:
'Submit'
,
'x-mega-props'
:
{
'x-mega-props'
:
{
...
@@ -105,17 +120,19 @@ export const drawerSchema: ISchema = {
...
@@ -105,17 +120,19 @@ export const drawerSchema: ISchema = {
'x-component'
:
'Mega-Layout'
,
'x-component'
:
'Mega-Layout'
,
'x-component-props'
:
{
'x-component-props'
:
{
grid
:
true
,
grid
:
true
,
full
:
true
,
autoRow
:
true
,
columns
:
4
,
columns
:
4
,
},
},
properties
:
{
properties
:
{
i
d
:
{
memberI
d
:
{
type
:
'string'
,
type
:
'string'
,
'x-component'
:
'NumberPicker'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'会员ID'
,
placeholder
:
'会员ID'
,
allowClear
:
true
,
},
},
},
},
memberType
:
{
memberType
Enum
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
default
:
undefined
,
enum
:
[],
enum
:
[],
...
@@ -124,7 +141,7 @@ export const drawerSchema: ISchema = {
...
@@ -124,7 +141,7 @@ export const drawerSchema: ISchema = {
allowClear
:
true
,
allowClear
:
true
,
},
},
},
},
memberL
evel
:
{
l
evel
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
default
:
undefined
,
enum
:
[],
enum
:
[],
...
@@ -133,7 +150,7 @@ export const drawerSchema: ISchema = {
...
@@ -133,7 +150,7 @@ export const drawerSchema: ISchema = {
allowClear
:
true
,
allowClear
:
true
,
},
},
},
},
applicabl
e
:
{
suitableMemberTyp
e
:
{
type
:
'string'
,
type
:
'string'
,
default
:
undefined
,
default
:
undefined
,
enum
:
[],
enum
:
[],
...
@@ -142,7 +159,7 @@ export const drawerSchema: ISchema = {
...
@@ -142,7 +159,7 @@ export const drawerSchema: ISchema = {
allowClear
:
true
,
allowClear
:
true
,
},
},
},
},
'[
startTime2, endTime2
]'
:
{
'[
becomeTimeStart, becomeTimeEnd
]'
:
{
type
:
'string'
,
type
:
'string'
,
'x-component'
:
'RangePicker'
,
'x-component'
:
'RangePicker'
,
'x-component-props'
:
{
'x-component-props'
:
{
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponAnalysis/deliver/index.tsx
View file @
01093727
...
@@ -2,15 +2,21 @@
...
@@ -2,15 +2,21 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-06-28 17:51:33
* @Date: 2021-06-28 17:51:33
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-
06 14:07:32
* @LastEditTime: 2021-07-
28 17:33:55
* @Description:
* @Description:
商家优惠劵发劵
*/
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
import
{
Row
,
Row
,
Col
,
Col
,
Spin
,
Spin
,
Button
,
message
,
}
from
'antd'
;
}
from
'antd'
;
import
{
SendOutlined
,
}
from
'@ant-design/icons'
;
import
{
history
}
from
'umi'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
PublicApi
}
from
'@/services/api'
;
import
{
GetMarketingCouponWaiteExecuteGetResponse
}
from
'@/services/MarketingApi'
;
import
{
GetMarketingCouponWaiteExecuteGetResponse
}
from
'@/services/MarketingApi'
;
...
@@ -19,18 +25,21 @@ import AnchorPage from '@/layouts/AnchorPage';
...
@@ -19,18 +25,21 @@ import AnchorPage from '@/layouts/AnchorPage';
import
AuditProcess
from
'@/components/AuditProcess'
;
import
AuditProcess
from
'@/components/AuditProcess'
;
import
BacisInfo
from
'../../components/BacisInfo'
;
import
BacisInfo
from
'../../components/BacisInfo'
;
import
CouponRules
from
'../../components/CouponRules'
;
import
CouponRules
from
'../../components/CouponRules'
;
import
DeliverCoupon
from
'../../components/DeliverCoupon'
;
import
DeliverCoupon
,
{
SuitableMemberType
}
from
'../../components/DeliverCoupon'
;
const
MerchantCouponAnalysisDeliver
:
React
.
FC
<
{}
>
=
()
=>
{
const
MerchantCouponAnalysisDeliver
:
React
.
FC
<
{}
>
=
()
=>
{
const
{
id
}
=
usePageStatus
();
const
{
id
}
=
usePageStatus
();
const
[
couponInfo
,
setCouponInfo
]
=
useState
<
GetMarketingCouponWaiteExecuteGetResponse
>
(
null
);
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
=
()
=>
{
const
getBasicInfo
=
()
=>
{
if
(
!
id
)
{
if
(
!
id
)
{
return
;
return
;
}
}
setInfoLoa
a
ding
(
true
);
setInfoLoading
(
true
);
PublicApi
.
getMarketingCouponWaiteExecuteGet
({
PublicApi
.
getMarketingCouponWaiteExecuteGet
({
id
,
id
,
}).
then
(
res
=>
{
}).
then
(
res
=>
{
...
@@ -38,7 +47,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
...
@@ -38,7 +47,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
setCouponInfo
(
res
.
data
);
setCouponInfo
(
res
.
data
);
}
}
}).
finally
(()
=>
{
}).
finally
(()
=>
{
setInfoLoa
a
ding
(
false
);
setInfoLoading
(
false
);
});
});
};
};
...
@@ -46,6 +55,34 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
...
@@ -46,6 +55,34 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
getBasicInfo
();
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
=
[
const
anchorsArr
=
[
{
{
key
:
'verifySteps'
,
key
:
'verifySteps'
,
...
@@ -70,6 +107,16 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
...
@@ -70,6 +107,16 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
<
AnchorPage
<
AnchorPage
title=
{
couponInfo
?.
name
}
title=
{
couponInfo
?.
name
}
anchors=
{
anchorsArr
}
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
]
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
{
/* 流转记录 */
}
{
/* 流转记录 */
}
...
@@ -121,6 +168,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
...
@@ -121,6 +168,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
{
/* 优惠券规则 */
}
{
/* 优惠券规则 */
}
<
Col
span=
{
24
}
>
<
Col
span=
{
24
}
>
<
DeliverCoupon
<
DeliverCoupon
onChange=
{
handleDeliverChange
}
id=
"deliverCoupon"
id=
"deliverCoupon"
/>
/>
</
Col
>
</
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