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
linweijiong
jinfa-platform
Commits
3a525ab7
Commit
3a525ab7
authored
Nov 12, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 删除适用会员用户字段(UI需求)
parent
91674da4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
84 deletions
+3
-84
index.tsx
...lity/merchantCoupon/components/ApplicableMember/index.tsx
+0
-14
index.tsx
...CouponUnsubmitted/components/CouponForm/effects/index.tsx
+0
-27
useBusinessEffects.ts
...itted/components/CouponForm/effects/useBusinessEffects.ts
+3
-25
index.tsx
...merchantCouponUnsubmitted/components/CouponForm/index.tsx
+0
-9
schema.tsx
...erchantCouponUnsubmitted/components/CouponForm/schema.tsx
+0
-9
No files found.
src/pages/transaction/marketingAbility/merchantCoupon/components/ApplicableMember/index.tsx
View file @
3a525ab7
...
...
@@ -57,10 +57,6 @@ const ApplicableMember: React.FC<IProps> = (props) => {
const
showApplicationMemberLevel
=
true
;
let
applicationUserRoleOptions
=
applicableMember
?.
applicationMemberLevel
?.
map
((
item
)
=>
({
label
:
item
.
roleName
,
value
:
item
.
id
}));
// 去重
applicationUserRoleOptions
=
applicationUserRoleOptions
?.
filter
((
item
,
index
)
=>
applicationUserRoleOptions
.
findIndex
(
item2
=>
item2
.
label
===
item
.
label
)
===
index
);
return
(
<
MellowCard
title=
"适用用户"
...
...
@@ -91,16 +87,6 @@ const ApplicableMember: React.FC<IProps> = (props) => {
<>
<
Field
type=
"string"
enum=
{
applicationUserRoleOptions
}
title=
"适用用户角色"
name=
"applicationUserRole"
x
-
component=
"TofuCheckGroup"
x
-
component
-
props=
{
{
ediabled
:
false
,
}
}
/>
<
Field
type=
"string"
enum=
{
applicableMember
?.
applicationMemberLevel
?.
map
((
item
)
=>
({
...
item
,
value
:
item
.
id
}))
}
name=
"applicationMemberLevel"
x
-
component=
"MemberCheckboxGroup"
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/CouponForm/effects/index.tsx
View file @
3a525ab7
...
...
@@ -48,31 +48,6 @@ const fetchCouponGetWay = async () => {
};
};
// 初始化 适用用户角色
const
fetchApplicationUserRole
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMemberManageMarketingSuitableLevelConfigPageItems
();
const
allItem
=
{
label
:
'全部'
,
value
:
0
,
};
if
(
res
.
code
===
1000
)
{
const
{
data
=
[]
}
=
res
;
const
options
=
[
allItem
,
...(
data
.
map
(
item
=>
({
label
:
item
.
roleName
,
value
:
item
.
roleId
})))
];
return
{
applicationUserRole
:
options
,
};
}
return
{
data
:
[],
totalCount
:
0
,
};
};
// 初始化 适用用户
const
fetchSuitableUser
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMarketingCouponSuitableMemberTypeList
();
...
...
@@ -121,8 +96,6 @@ export const createEffects = (context, actions) => {
useAsyncInitSelect
([
'getWay'
],
fetchCouponGetWay
);
useAsyncInitSelect
([
'applicationUserRole'
],
fetchApplicationUserRole
);
useAsyncInitSelect
([
'suitableMemberTypes'
],
fetchSuitableUser
);
// 初始化 品牌数据
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/CouponForm/effects/useBusinessEffects.ts
View file @
3a525ab7
...
...
@@ -221,37 +221,15 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
});
});
// 适用用户角色
onFieldInputChange$
(
'applicationUserRole'
).
subscribe
(
state
=>
{
const
{
value
}
=
state
;
let
filtered
=
[...
value
];
// 这里处理一下全部,当点击了 全部 把 0 去掉,否则插入一个 0
if
(
value
.
includes
(
0
))
{
filtered
=
(
value
||
[]).
filter
((
item
)
=>
item
!==
0
);
// 过滤掉 0全选元素
}
else
{
filtered
.
unshift
(
0
);
}
setFieldState
(
'applicationMemberLevel'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'props.x-component-props'
,
Object
.
assign
({},
fieldState
.
props
[
'x-component-props'
],
{
extraParams
:
{
roleIds
:
filtered
.
join
(
','
),
levelConfigIds
:
''
,
},
}));
});
});
// 适用用户
onFieldValueChange$
(
'suitableMemberTypes'
).
subscribe
(
state
=>
{
const
{
value
}
=
state
;
// 包含新会员(仅会员用户) 或者 老会员(仅会员用户),展示
适用用户角色 与
会员等级列表
// 包含新会员(仅会员用户) 或者 老会员(仅会员用户),展示 会员等级列表
if
(
value
&&
(
value
.
includes
(
SUITABLE_TYPE_NEW_MEMBER
)
||
value
.
includes
(
SUITABLE_TYPE_OLD_MEMBER
)))
{
linkage
.
show
(
'*(application
UserRole,application
MemberLevel)'
);
linkage
.
show
(
'*(applicationMemberLevel)'
);
}
else
{
linkage
.
hide
(
'*(application
UserRole,application
MemberLevel)'
);
linkage
.
hide
(
'*(applicationMemberLevel)'
);
}
});
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/CouponForm/index.tsx
View file @
3a525ab7
...
...
@@ -127,10 +127,6 @@ export type SubmitValueType = {
*/
suitableMemberTypes
:
number
[],
/**
* 适用用户角色
*/
applicationUserRole
:
any
[],
/**
* 适用会员等级
*/
applicationMemberLevel
:
number
[],
...
...
@@ -200,15 +196,11 @@ const CouponForm: React.FC<IProps> = (props) => {
history
,
...
rest
}
=
res
.
data
;
let
applicationUserRole
=
suitableMemberLevelTypes
?.
map
((
item
)
=>
item
.
roleId
)
||
[];
// 去重
applicationUserRole
=
applicationUserRole
?.
filter
((
item
,
index
)
=>
applicationUserRole
.
findIndex
(
item2
=>
item2
===
item
)
===
index
);
setCouponInfo
({
goodsList
:
suitableCommoditySkuList
as
any
,
applicableCategories
:
(
suitableCategoryList
as
any
)?.
map
((
item
)
=>
({
category
:
item
.
map
((
category
)
=>
`
${
category
.
id
}
`
)})),
applicableBrands
:
suitableBrandList
?.
map
((
item
)
=>
({
brand
:
item
.
id
})),
applicationUserRole
,
applicationMemberLevel
:
suitableMemberLevelTypes
?.
map
((
item
)
=>
item
.
id
),
suitableMemberTypes
:
suitableMemberTypes
?.
map
((
item
)
=>
item
.
value
),
suitableMallTypes
:
suitableMallTypes
?.
map
((
item
)
=>
item
.
id
),
...
...
@@ -303,7 +295,6 @@ const CouponForm: React.FC<IProps> = (props) => {
applicableBrands
,
applicableCategories
,
applicationMemberLevel
,
applicationUserRole
,
releaseTimeStart
,
releaseTimeEnd
,
effectiveTimeStart
,
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/CouponForm/schema.tsx
View file @
3a525ab7
...
...
@@ -512,15 +512,6 @@ const schema: ISchema = {
'x-component-props'
:
{
},
},
applicationUserRole
:
{
title
:
'适用用户角色'
,
type
:
'string'
,
enum
:
[],
default
:
[
0
],
'x-component'
:
'TofuCheckGroup'
,
'x-component-props'
:
{
},
},
applicationMemberLevel
:
{
type
:
'string'
,
required
:
true
,
...
...
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