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
1c8c5039
Commit
1c8c5039
authored
Jul 28, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 加强判断
parent
b378995c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
17 deletions
+49
-17
marketing.ts
src/constants/marketing.ts
+21
-2
index.tsx
...ility/merchantCoupon/components/ApplicableGoods/index.tsx
+3
-1
index.tsx
...nUnsubmitted/components/ApplicableGoodsFormItem/index.tsx
+4
-2
index.tsx
...erchantCouponUnsubmitted/components/GoodsDrawer/index.tsx
+10
-5
schema.tsx
...rchantCouponUnsubmitted/components/GoodsDrawer/schema.tsx
+7
-6
utils.ts
...ages/transaction/marketingAbility/merchantCoupon/utils.ts
+4
-1
No files found.
src/constants/marketing.ts
View file @
1c8c5039
...
@@ -46,4 +46,23 @@ export const MERCHANT_COUPON_RECEIVE_ACTIVITY = 3;
...
@@ -46,4 +46,23 @@ export const MERCHANT_COUPON_RECEIVE_ACTIVITY = 3;
/**
/**
* 会员运营用券
* 会员运营用券
*/
*/
export
const
MERCHANT_COUPON_RECEIVE_OPERATE
=
4
;
export
const
MERCHANT_COUPON_RECEIVE_OPERATE
=
4
;
\ No newline at end of file
/* --------------------------------- 商家优惠券适用用户 -------------------------------- */
/**
* 新用户(不包含会员)
*/
export
const
SUITABLE_TYPE_NEW_USER
=
1
;
/**
* 老用户(不包含会员)
*/
export
const
SUITABLE_TYPE_OLD_USER
=
2
;
/**
* 新会员(仅会员用户)
*/
export
const
SUITABLE_TYPE_NEW_MEMBER
=
3
;
/**
* 老会员(仅会员用户)
*/
export
const
SUITABLE_TYPE_OLD_MEMBER
=
4
;
\ No newline at end of file
src/pages/transaction/marketingAbility/merchantCoupon/components/ApplicableGoods/index.tsx
View file @
1c8c5039
...
@@ -96,7 +96,9 @@ const ApplicableGoods: React.FC<IProps> = (props) => {
...
@@ -96,7 +96,9 @@ const ApplicableGoods: React.FC<IProps> = (props) => {
dataIndex
:
'unitPrice'
,
dataIndex
:
'unitPrice'
,
render
:
(
text
)
=>
{
render
:
(
text
)
=>
{
const
unitPrice
=
normalizeUnitPrice
(
text
);
const
unitPrice
=
normalizeUnitPrice
(
text
);
return
`¥
${
unitPrice
[
0
]?.
price
}
~
$
{
unitPrice
[
unitPrice
.
length
-
1
]?.
price
}
`;
const
start
=
unitPrice
[
0
]?.
price
;
const
end
=
unitPrice
[
unitPrice
.
length
-
1
].
price
;
return
start
!==
end
?
`¥
${
start
}
~
${
end
}
`
:
`¥
${
start
}
`
;
},
},
},
},
];
];
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/ApplicableGoodsFormItem/index.tsx
View file @
1c8c5039
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-07-19 14:19:31
* @Date: 2021-07-19 14:19:31
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-
19 18:18:38
* @LastEditTime: 2021-07-
28 11:01:30
* @Description: 适用商品 Form Item
* @Description: 适用商品 Form Item
*/
*/
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
...
@@ -70,7 +70,9 @@ const ApplicableGoodsFormItem = (props) => {
...
@@ -70,7 +70,9 @@ const ApplicableGoodsFormItem = (props) => {
align
:
'center'
,
align
:
'center'
,
render
:
(
text
)
=>
{
render
:
(
text
)
=>
{
const
unitPrice
=
normalizeUnitPrice
(
text
);
const
unitPrice
=
normalizeUnitPrice
(
text
);
return
`¥
${
unitPrice
[
0
]?.
price
}
~
$
{
unitPrice
[
unitPrice
.
length
-
1
]?.
price
}
`;
const
start
=
unitPrice
[
0
]?.
price
;
const
end
=
unitPrice
[
unitPrice
.
length
-
1
].
price
;
return
start
!==
end
?
`¥
${
start
}
~
${
end
}
`
:
`¥
${
start
}
`
;
},
},
},
},
(
(
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/GoodsDrawer/index.tsx
View file @
1c8c5039
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-06-24 16:11:55
* @Date: 2021-06-24 16:11:55
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-2
0 10:29:12
* @LastEditTime: 2021-07-2
8 14:13:43
* @Description: 商品选择抽屉
* @Description: 商品选择抽屉
*/
*/
import
React
,
{
useEffect
}
from
'react'
;
import
React
,
{
useEffect
}
from
'react'
;
...
@@ -101,13 +101,16 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
...
@@ -101,13 +101,16 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
},
[
checkeds
]);
},
[
checkeds
]);
const
fetchData
=
async
(
params
:
ExtraFetchType
)
=>
{
const
fetchData
=
async
(
params
:
ExtraFetchType
)
=>
{
le
t
res
=
await
PublicApi
.
getProductCommodityGetCommoditySkuListByShopId
({
cons
t
res
=
await
PublicApi
.
getProductCommodityGetCommoditySkuListByShopId
({
...
params
,
...
params
,
current
:
`
${
params
.
current
}
`
,
current
:
`
${
params
.
current
}
`
,
pageSize
:
`
${
params
.
pageSize
}
`
,
pageSize
:
`
${
params
.
pageSize
}
`
,
shopId
:
`
${
shopIds
[
0
]
||
''
}
`
,
shopId
:
`
${
shopIds
[
0
]
||
''
}
`
,
});
});
return
res
.
data
;
if
(
res
.
code
===
1000
)
{
return
res
.
data
;
}
return
{
data
:
[],
totalCount
:
0
};
};
};
const
handleClose
=
()
=>
{
const
handleClose
=
()
=>
{
...
@@ -150,11 +153,13 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
...
@@ -150,11 +153,13 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
},
},
{
{
title
:
'商品价格'
,
title
:
'商品价格'
,
dataIndex
:
'
p
rice'
,
dataIndex
:
'
unitP
rice'
,
align
:
'center'
,
align
:
'center'
,
render
:
(
text
)
=>
{
render
:
(
text
)
=>
{
const
unitPrice
=
normalizeUnitPrice
(
text
);
const
unitPrice
=
normalizeUnitPrice
(
text
);
return
`¥
${
unitPrice
[
0
]?.
price
}
~
$
{
unitPrice
[
unitPrice
.
length
-
1
]?.
price
}
`;
const
start
=
unitPrice
[
0
]?.
price
;
const
end
=
unitPrice
[
unitPrice
.
length
-
1
].
price
;
return
start
!==
end
?
`¥
${
start
}
~
${
end
}
`
:
`¥
${
start
}
`
;
},
},
},
},
];
];
...
...
src/pages/transaction/marketingAbility/merchantCoupon/merchantCouponUnsubmitted/components/GoodsDrawer/schema.tsx
View file @
1c8c5039
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-06-24 16:19:18
* @Date: 2021-06-24 16:19:18
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
6-24 16:19:18
* @LastEditTime: 2021-0
7-28 10:54:23
* @Description:
* @Description:
*/
*/
import
{
ISchema
}
from
'@formily/antd'
;
import
{
ISchema
}
from
'@formily/antd'
;
...
@@ -26,18 +26,19 @@ export const querySchema: ISchema = {
...
@@ -26,18 +26,19 @@ export const querySchema: ISchema = {
},
},
[
FORM_FILTER_PATH
]:
{
[
FORM_FILTER_PATH
]:
{
type
:
'object'
,
type
:
'object'
,
'x-component'
:
'
flex
-layout'
,
'x-component'
:
'
mega
-layout'
,
'x-component-props'
:
{
'x-component-props'
:
{
colStyle
:
{
grid
:
true
,
marginLeft
:
20
,
full
:
true
,
},
autoRow
:
true
,
columns
:
6
,
},
},
properties
:
{
properties
:
{
category
:
{
category
:
{
type
:
'string'
,
type
:
'string'
,
'x-component-props'
:
{
'x-component-props'
:
{
placeholder
:
'商品品类'
,
placeholder
:
'商品品类'
,
allowClear
:
true
,
allowClear
:
true
,
},
},
},
},
brand
:
{
brand
:
{
...
...
src/pages/transaction/marketingAbility/merchantCoupon/utils.ts
View file @
1c8c5039
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Author: XieZhiXiong
* @Date: 2021-07-20 10:10:55
* @Date: 2021-07-20 10:10:55
* @LastEditors: XieZhiXiong
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-2
3 15:00:55
* @LastEditTime: 2021-07-2
8 16:48:48
* @Description:
* @Description:
*/
*/
import
{
OptionItemType
}
from
'../components/ApplicableList'
;
import
{
OptionItemType
}
from
'../components/ApplicableList'
;
...
@@ -69,6 +69,9 @@ export type BrandItemType = {
...
@@ -69,6 +69,9 @@ export type BrandItemType = {
}
}
export
function
normalizeUnitPrice
(
unitPrice
:
UnitPriceType
):
UnitPriceType
[]
{
export
function
normalizeUnitPrice
(
unitPrice
:
UnitPriceType
):
UnitPriceType
[]
{
if
(
!
unitPrice
)
{
return
;
}
const
ret
=
[];
const
ret
=
[];
const
objKeys
=
Object
.
keys
(
unitPrice
).
sort
((
a
,
b
)
=>
parseFloat
(
a
)
-
parseFloat
(
b
));
const
objKeys
=
Object
.
keys
(
unitPrice
).
sort
((
a
,
b
)
=>
parseFloat
(
a
)
-
parseFloat
(
b
));
...
...
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