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
3ad1e9fc
Commit
3ad1e9fc
authored
Aug 03, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 修改接口
parent
3c4579a3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
index.tsx
...CouponUnsubmitted/components/CouponForm/effects/index.tsx
+5
-5
index.tsx
...merchantCouponUnsubmitted/components/CouponForm/index.tsx
+10
-4
No files found.
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/CouponForm/effects/index.tsx
View file @
3ad1e9fc
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:03:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
7-28 14:58:01
* @LastEditTime: 2021-0
8-03 11:26:22
* @Description:
*/
import
{
FormPath
,
FormEffectHooks
}
from
'@formily/antd'
;
...
...
@@ -49,7 +49,7 @@ const fetchCouponGetWay = async () => {
// 初始化 适用用户角色
const
fetchApplicationUserRole
=
async
()
=>
{
const
res
=
await
PublicApi
.
getMember
AbilityLevelRoleList
();
const
res
=
await
PublicApi
.
getMember
ManageMarketingSuitableLevelConfigPageItems
();
const
allItem
=
{
label
:
'全部'
,
...
...
@@ -89,8 +89,8 @@ const fetchSuitableUser = async () => {
};
// 获取 实用会员选项
const
fetchMemberOtions
:
(
params
:
{
current
:
string
,
pageSize
:
string
,
levelConfigIds
:
string
,
roleIds
:
string
})
=>
Promise
<
ResponseType
>
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
getMember
AbilityLevelTa
gPage
(
params
);
const
fetchMemberO
p
tions
:
(
params
:
{
current
:
string
,
pageSize
:
string
,
levelConfigIds
:
string
,
roleIds
:
string
})
=>
Promise
<
ResponseType
>
=
async
(
params
)
=>
{
const
res
=
await
PublicApi
.
getMember
ManageMarketingSuitableLevelConfi
gPage
(
params
);
if
(
res
.
code
===
1000
)
{
const
options
=
res
.
data
.
data
.
map
(
item
=>
({
label
:
item
.
roleName
,
...
...
@@ -165,7 +165,7 @@ export const createEffects = (context, actions) => {
setFieldState
(
'applicationMemberLevel'
,
state
=>
{
FormPath
.
setIn
(
state
,
'props.x-component-props'
,
{
showMoreAction
:
true
,
fetchOptions
:
fetchMemberOtions
,
fetchOptions
:
fetchMemberO
p
tions
,
});
});
});
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/CouponForm/index.tsx
View file @
3ad1e9fc
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 13:47:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-0
2 17:58:54
* @LastEditTime: 2021-08-0
3 11:42:36
* @Description: 新增/修改 优惠券表单
*/
import
React
,
{
useState
,
useMemo
,
useEffect
}
from
'react'
;
...
...
@@ -182,6 +182,7 @@ const CouponForm: React.FC<IProps> = (props) => {
suitableBrandList
,
suitableMallTypes
,
suitableMemberLevelTypes
,
suitableMemberTypes
,
denomination
,
quantity
,
releaseTimeStart
,
...
...
@@ -197,12 +198,17 @@ 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
:
[]
,
applicationUserRole
,
applicationMemberLevel
:
suitableMemberLevelTypes
?.
map
((
item
)
=>
item
.
id
),
suitableMemberTypes
:
suitableMemberTypes
?.
map
((
item
)
=>
item
.
value
),
suitableMallTypes
:
suitableMallTypes
?.
map
((
item
)
=>
item
.
id
),
denomination
:
`
${
denomination
}
`
,
quantity
:
`
${
quantity
}
`
,
...
...
@@ -213,8 +219,8 @@ const CouponForm: React.FC<IProps> = (props) => {
invalidDay
:
invalidDay
!==
null
?
`
${
invalidDay
}
`
:
undefined
,
useConditionMoney
:
`
${
useConditionMoney
}
`
,
receiveCondition
:
{
conditionGetTotal
:
`
${
conditionGetTotal
}
`
,
conditionGetDay
:
`
${
conditionGetDay
}
`
,
conditionGetTotal
:
conditionGetTotal
?
`
${
conditionGetTotal
}
`
:
undefined
,
conditionGetDay
:
conditionGetDay
?
`
${
conditionGetDay
}
`
:
undefined
,
},
...
rest
,
});
...
...
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