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
XieZhiXiong
jinfa-platform
Commits
2837281e
Commit
2837281e
authored
Aug 02, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加适用用户展示
parent
1247c76f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
6 deletions
+126
-6
index.less
...ity/merchantCoupon/components/ApplicableMember/index.less
+0
-0
index.tsx
...lity/merchantCoupon/components/ApplicableMember/index.tsx
+99
-0
index.tsx
...gAbility/merchantCoupon/components/CouponDetail/index.tsx
+27
-6
No files found.
src/pages/transaction/marketingAbility/merchantCoupon/components/ApplicableMember/index.less
0 → 100644
View file @
2837281e
src/pages/transaction/marketingAbility/merchantCoupon/components/ApplicableMember/index.tsx
0 → 100644
View file @
2837281e
/*
* @Author: XieZhiXiong
* @Date: 2021-08-02 16:56:32
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-02 17:48:07
* @Description: 适用用户
*/
import
React
,
{
useMemo
}
from
'react'
;
import
{
SchemaForm
,
SchemaMarkupField
as
Field
,
}
from
'@formily/antd'
;
import
MellowCard
,
{
MellowCardProps
}
from
'@/components/MellowCard'
;
import
TofuCheckGroup
from
'../../../components/FormilyFieldItem/TofuCheckGroup'
;
import
MemberCheckboxGroup
from
'../../../components/FormilyFieldItem/MemberCheckboxGroup'
;
import
{
OptionItemType
as
MemberOptionItemType
}
from
'../../../components/MemberCheckboxGroup'
;
import
ApplicableList
from
'../../../components/FormilyFieldItem/ApplicableList'
;
export
type
ApplicationMemberLevelType
=
Omit
<
MemberOptionItemType
,
'value'
>
&
{
id
:
string
}
interface
IProps
extends
MellowCardProps
{
/**
* 适用会员信息
*/
applicableMember
:
{
/**
* 适用用户
*/
suitableMemberTypes
:
{}[],
/**
* 适用用户角色
*/
applicationUserRole
:
{}[],
/**
* 适用用户列表
*/
applicationMemberLevel
:
ApplicationMemberLevelType
[],
},
}
const
ApplicableMember
:
React
.
FC
<
IProps
>
=
(
props
)
=>
{
const
{
applicableMember
,
...
rest
}
=
props
;
const
useFields
=
():
any
=>
(
useMemo
(()
=>
({
TofuCheckGroup
,
MemberCheckboxGroup
,
ApplicableList
,
}),
[])
);
const
showApplicationMemberLevel
=
true
;
return
(
<
MellowCard
title=
"适用用户"
bodyStyle=
{
{
paddingBottom
:
0
,
}
}
{
...
rest
}
>
<
SchemaForm
labelAlign=
"left"
labelCol=
{
3
}
wrapperCol=
{
21
}
fields=
{
useFields
()
}
editable=
{
false
}
>
<
Field
type=
"string"
enum=
{
[]
}
title=
"适用用户"
name=
"suitableMemberTypes"
x
-
component=
"TofuCheckGroup"
/>
{
showApplicationMemberLevel
&&
(
<>
<
Field
type=
"string"
enum=
{
[]
}
default=
{
[
0
]
}
title=
"适用用户角色"
name=
"applicationUserRole"
x
-
component=
"TofuCheckGroup"
/>
<
Field
type=
"string"
enum=
{
applicableMember
?.
applicationMemberLevel
?.
map
((
item
)
=>
({
...
item
,
value
:
item
.
id
}))
}
name=
"applicationMemberLevel"
x
-
component=
"MemberCheckboxGroup"
/>
</>
)
}
</
SchemaForm
>
</
MellowCard
>
);
};
export
default
ApplicableMember
;
src/pages/transaction/marketingAbility/merchantCoupon/components/CouponDetail/index.tsx
View file @
2837281e
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-25 17:23:30
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
7-23 15:16:09
* @LastEditTime: 2021-0
8-02 17:35:52
* @Description: 商家优惠券页面详情组件
*/
import
React
,
{
useMemo
}
from
'react'
;
...
...
@@ -34,6 +34,7 @@ import ApplicableGoods, { ListItemDataType } from '../../components/ApplicableGo
import
ApplicableShopList
from
'../../components/ApplicableShopList'
;
import
ApplicableCategories
from
'../../components/ApplicableCategories'
;
import
ApplicableBrands
from
'../../components/ApplicableBrands'
;
import
ApplicableMember
,
{
ApplicationMemberLevelType
}
from
'../../components/ApplicableMember'
;
import
InnerFlowRecords
from
'../../components/InnerFlowRecords'
;
export
type
DetailType
=
BacisInfoPropsType
[
'dataSource'
]
&
CouponRulesPropsType
[
'dataSource'
]
&
{
...
...
@@ -123,6 +124,10 @@ export type DetailType = BacisInfoPropsType['dataSource'] & CouponRulesPropsType
* 适用商城
*/
suitableMallTypes
?:
ShopItemType
[],
/**
* 适用会员
*/
suitableMemberLevelTypes
?:
ApplicationMemberLevelType
[],
};
interface
IProps
{
...
...
@@ -156,6 +161,10 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
key
:
'couponRules'
,
name
:
'优惠券规则'
,
},
{
key
:
'applicableShopList'
,
name
:
'适用商城'
,
},
(
dataSource
?.
type
===
MERCHANT_COUPON_TYPE_PRODUCT
||
dataSource
?.
type
===
MERCHANT_COUPON_TYPE_VOUCHER
...
...
@@ -182,7 +191,7 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
:
null
),
{
key
:
'applicable
ShopList
'
,
key
:
'applicable
Member
'
,
name
:
'适用商城'
,
},
{
...
...
@@ -259,6 +268,14 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
/>
</
Col
>
{
/* 适用商城 */
}
<
Col
span=
{
24
}
>
<
ApplicableShopList
options=
{
shopList
}
id=
"applicableShopList"
/>
</
Col
>
{
/* 适用商品 */
}
{
(
...
...
@@ -308,11 +325,15 @@ const MerchantCouponDetail: React.FC<IProps> = (props) => {
)
}
{
/* 适用
商城
*/
}
{
/* 适用
用户
*/
}
<
Col
span=
{
24
}
>
<
ApplicableShopList
options=
{
shopList
}
id=
"applicableShopList"
<
ApplicableMember
applicableMember=
{
{
suitableMemberTypes
:
[],
applicationUserRole
:
[],
applicationMemberLevel
:
dataSource
?.
suitableMemberLevelTypes
,
}
}
id=
"applicableMember"
/>
</
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