Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
shenshaokai
jinfa-admin
Commits
98e4a9d6
Commit
98e4a9d6
authored
Feb 17, 2022
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-system
into v2
parents
81a2e21f
d4faf550
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
72 additions
and
130 deletions
+72
-130
env.js
env.js
+2
-2
pullRemoteRouterList.js
scripts/pullRemoteRouterList.js
+1
-0
schema.ts
...esManagement/activePage/fixtures/common/configs/schema.ts
+0
-8
useGetLayout.ts
...nagement/activePage/fixtures/common/hooks/useGetLayout.ts
+8
-105
useSaveData.ts
...anagement/activePage/fixtures/common/hooks/useSaveData.ts
+1
-1
editPanelForm.tsx
...ctivePage/fixtures/components/EditPanel/editPanelForm.tsx
+16
-4
index.tsx
...ures/components/EditPanelFormily/FormilyProduct/index.tsx
+3
-1
index.tsx
...ivePage/fixtures/components/Layouts/Combination/index.tsx
+30
-5
swapCoupon.tsx
.../fixtures/components/Layouts/CommodityList/swapCoupon.tsx
+3
-3
request.ts
src/utils/request.ts
+8
-1
No files found.
env.js
View file @
98e4a9d6
...
@@ -168,9 +168,9 @@ module.exports = {
...
@@ -168,9 +168,9 @@ module.exports = {
// 阿里云demo站更新
// 阿里云demo站更新
"v2-ali-demo"
:
{
"v2-ali-demo"
:
{
SITE_ID
:
'1'
,
SITE_ID
:
'1'
,
BACK_GATEWAY
:
'http://lingxi-scm-gateway.shushangyun.com
:13880
'
,
BACK_GATEWAY
:
'http://lingxi-scm-gateway.shushangyun.com'
,
USE_ROUTE_CONFIG
:
true
,
USE_ROUTE_CONFIG
:
true
,
SOCKET_URL
:
'ws://lingxi-scm-gateway.shushangyun.com
:13880
'
,
SOCKET_URL
:
'ws://lingxi-scm-gateway.shushangyun.com'
,
YAPI_URL
:
'http://10.0.0.25:4000/'
YAPI_URL
:
'http://10.0.0.25:4000/'
}
}
}
}
scripts/pullRemoteRouterList.js
View file @
98e4a9d6
...
@@ -77,6 +77,7 @@ async function batchAxiosHttps() {
...
@@ -77,6 +77,7 @@ async function batchAxiosHttps() {
asyncHttpQueue
[
item
][
subItem
]
=
null
asyncHttpQueue
[
item
][
subItem
]
=
null
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
)
httpErrorQueue
.
push
({
...
serviceConfig
[
item
][
subItem
],
...
err
.
response
.
data
})
httpErrorQueue
.
push
({
...
serviceConfig
[
item
][
subItem
],
...
err
.
response
.
data
})
}
}
}
}
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/common/configs/schema.ts
View file @
98e4a9d6
import
{
ComponentSchemaType
,
PROPS_SETTING_TYPES
,
PROPS_TYPES
}
from
'@linkseeks/design-core'
;
import
{
ComponentSchemaType
,
PROPS_SETTING_TYPES
,
PROPS_TYPES
}
from
'@linkseeks/design-core'
;
// const View: ComponentSchemaType = {
// propsConfig: {
// children: {
// label: '内容',
// type: PROPS_TYPES.string,
// }
// },
// };
const
Advertisement
:
ComponentSchemaType
=
{
const
Advertisement
:
ComponentSchemaType
=
{
propsConfig
:
{
propsConfig
:
{
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/common/hooks/useGetLayout.ts
View file @
98e4a9d6
...
@@ -26,38 +26,6 @@ type DetailType = Omit<GetTemplateWebActivityPageGetResponse, "adornContent"> &
...
@@ -26,38 +26,6 @@ type DetailType = Omit<GetTemplateWebActivityPageGetResponse, "adornContent"> &
adornContent
:
DataSourceType
adornContent
:
DataSourceType
}
}
// /** 请求钱处理 */
// const formatData = {
// coupon: (data: { id: number, type: 1 | 2 | number & {} }[]) => {
// return {
// couponList: data.map((_item) => ({
// belongType: _item.type,
// couponId: _item.id
// })).filter((_item) => _item.couponId)
// };
// },
// hot: (data: number[]) => ({ids: data}),
// specialOffer: (data: number[]) => ({ids: data}),
// plummet: (data: number[]) => ({ids: data}),
// discount: (data: number[]) => ({ids: data}),
// fullQuantitySub: (data: number[]) => ({ids: data}),
// fullQuantityDiscount: (data: number[]) => ({ids: data}),
// fullMoneySub: (data: number[]) => ({ids: data}),
// fullMoneyDiscount: (data: number[]) => ({ids: data}),
// giveProduct: (data: number[]) => ({ids: data}),
// giveCoupon: (data: number[]) => ({ids: data}),
// morePiece: (data: number[]) => ({ids: data}),
// combination: (data: number[]) => ({ids: data}),
// groupPurchase: (data: number[]) => ({ids: data}),
// bargain: (data: number[]) => ({ids: data}),
// secKill: (data: number[]) => ({ids: data}),
// fullSwap: (data: number[]) => ({ids: data}),
// buySwap: (data: number[]) => ({ids: data}),
// preSale: (data: number[]) => ({ids: data}),
// setMeal: (data: number[]) => ({ids: data}),
// attempt: (data: number[]) => ({ids: data}),
// // suggestProductItem: (data: number[]) => ({ids: data.map((_item))}),
// };
/** key 对应组件名 */
/** key 对应组件名 */
const
COMPONENT_NAME
=
{
const
COMPONENT_NAME
=
{
...
@@ -112,68 +80,6 @@ const CHILD_COMPONENT_NAME = {
...
@@ -112,68 +80,6 @@ const CHILD_COMPONENT_NAME = {
suggestProduct
:
"CommodityList"
,
suggestProduct
:
"CommodityList"
,
};
};
// /**
// * key 对应接口
// */
// const service = {
// coupon: postMarketingCouponPlatformActivityPageSelectDetail,
// hot: getMarketingAdornActivityGoodsAdorn,
// specialOffer: getMarketingAdornActivityGoodsAdorn,
// plummet: getMarketingAdornActivityGoodsAdorn,
// discount: getMarketingAdornActivityGoodsAdorn,
// fullQuantitySub: getMarketingAdornActivityGoodsAdorn,
// fullQuantityDiscount: getMarketingAdornActivityGoodsAdorn,
// fullMoneySub: getMarketingAdornActivityGoodsAdorn,
// fullMoneyDiscount: getMarketingAdornActivityGoodsAdorn,
// giveProduct: getMarketingAdornActivityGoodsAdorn,
// giveCoupon: getMarketingAdornActivityGoodsAdorn,
// morePiece: getMarketingAdornActivityGoodsAdorn,
// combination: getMarketingAdornActivityGoodsAdorn,
// groupPurchase: getMarketingAdornActivityGoodsAdorn,
// bargain: getMarketingAdornActivityGoodsAdorn,
// secKill: getMarketingAdornActivityGoodsAdorn,
// fullSwap: getMarketingAdornActivityGoodsAdorn,
// buySwap: getMarketingAdornActivityGoodsAdorn,
// preSale: getMarketingAdornActivityGoodsAdorn,
// setMeal: getMarketingAdornActivityGoodsAdorn,
// attempt: getMarketingAdornActivityGoodsAdorn,
// suggestProductItem: getMarketingAdornActivityGoodsAdorn,
// };
// const DEFAULT_RES = [];
// const COMMON_FORMAT = ({code, data}) => {
// if (code === 1000) {
// return data;
// }
// return DEFAULT_RES;
// };
// /**
// * 请求后处理
// */
// const afterRequestFormat = {
// coupon: COMMON_FORMAT,
// hot: COMMON_FORMAT,
// specialOffer: COMMON_FORMAT,
// plummet: COMMON_FORMAT,
// discount: COMMON_FORMAT,
// fullQuantitySub: COMMON_FORMAT,
// fullQuantityDiscount: COMMON_FORMAT,
// fullMoneySub: COMMON_FORMAT,
// fullMoneyDiscount: COMMON_FORMAT,
// giveProduct: COMMON_FORMAT,
// giveCoupon: COMMON_FORMAT,
// morePiece: COMMON_FORMAT,
// combination: COMMON_FORMAT,
// groupPurchase: COMMON_FORMAT,
// bargain: COMMON_FORMAT,
// secKill: COMMON_FORMAT,
// fullSwap: COMMON_FORMAT,
// buySwap: COMMON_FORMAT,
// preSale: COMMON_FORMAT,
// setMeal: COMMON_FORMAT,
// suggestProductItem: COMMON_FORMAT,
// };
const
title
=
{
const
title
=
{
top
:
'广告图'
,
top
:
'广告图'
,
coupon
:
'优惠券'
,
coupon
:
'优惠券'
,
...
@@ -371,7 +277,7 @@ function useGetLayout() {
...
@@ -371,7 +277,7 @@ function useGetLayout() {
/** 获取自定义区域请求体 */
/** 获取自定义区域请求体 */
const
customizeAreaRequestData
=
adornContent
!
.
suggestProduct
!
.
props
?.
childrenData
?.
reduce
((
prev
,
next
,
_index
)
=>
{
const
customizeAreaRequestData
=
adornContent
!
.
suggestProduct
!
.
props
?.
childrenData
?.
reduce
((
prev
,
next
,
_index
)
=>
{
const
labelsWithId
=
{};
const
labelsWithId
=
{};
const
result
=
next
.
childrenData
.
map
((
_item
,
_key
)
=>
{
const
result
=
next
.
childrenData
?
.
map
((
_item
,
_key
)
=>
{
labelsWithId
[
`
${
_index
+
1
}
-
${
_key
+
1
}
-
${
_item
.
id
}
`
]
=
_item
.
label
;
labelsWithId
[
`
${
_index
+
1
}
-
${
_key
+
1
}
-
${
_item
.
id
}
`
]
=
_item
.
label
;
return
_item
.
id
return
_item
.
id
});
});
...
@@ -380,9 +286,8 @@ function useGetLayout() {
...
@@ -380,9 +286,8 @@ function useGetLayout() {
labelsWithId
:
labelsWithId
,
labelsWithId
:
labelsWithId
,
}
}
return
prev
return
prev
},
{
ids
:
[],
label
:
{}
})
},
{
ids
:
[],
label
:
{}
})
||
[]
/** 获取组合促销请求体 */
/** 获取组合促销请求体 */
console
.
log
(
adornContent
)
const
combinationRequestData
=
adornContent
.
combination
?.
props
?.
childrenData
?.
reduce
((
prev
,
next
,
_index
)
=>
{
const
combinationRequestData
=
adornContent
.
combination
?.
props
?.
childrenData
?.
reduce
((
prev
,
next
,
_index
)
=>
{
prev
=
[...
prev
,
...(
next
.
childrenData
||
[])]
prev
=
[...
prev
,
...(
next
.
childrenData
||
[])]
return
prev
return
prev
...
@@ -390,10 +295,10 @@ function useGetLayout() {
...
@@ -390,10 +295,10 @@ function useGetLayout() {
/** 获取其他活动的请求体 */
/** 获取其他活动的请求体 */
const
activityRequestData
=
Object
.
keys
(
adornContent
).
reduce
((
all
:
any
,
_item
)
=>
{
const
activityRequestData
=
Object
.
keys
(
adornContent
).
reduce
((
all
:
any
,
_item
)
=>
{
if
(
ACTIVITY_LIST
.
includes
(
_item
as
any
)
&&
_item
!==
'combination'
)
{
if
(
ACTIVITY_LIST
.
includes
(
_item
as
any
)
&&
_item
!==
'combination'
)
{
all
=
[...
all
,
...((
adornContent
[
_item
]
as
any
)
.
props
.
childrenData
)]
all
=
[...
all
,
...((
adornContent
[
_item
]
as
any
)
?.
props
?.
childrenData
.
filter
(
Boolean
)
||
[]
)]
}
}
return
all
;
return
all
;
},
[]);
},
[])
||
[]
;
const
getCouponData
=
async
(
couponData
)
=>
{
const
getCouponData
=
async
(
couponData
)
=>
{
if
(
couponData
.
length
===
0
)
{
if
(
couponData
.
length
===
0
)
{
...
@@ -490,8 +395,6 @@ function useGetLayout() {
...
@@ -490,8 +395,6 @@ function useGetLayout() {
...
thirdFloorData
,
...
thirdFloorData
,
},
},
}
}
// console.log(sideControllerData, "sideControllerData")
}
}
/** 设置左边菜单栏属性 */
/** 设置左边菜单栏属性 */
sideControllerData
=
{
sideControllerData
=
{
...
@@ -520,7 +423,7 @@ function useGetLayout() {
...
@@ -520,7 +423,7 @@ function useGetLayout() {
if
(
_row
.
key
===
'coupon'
)
{
if
(
_row
.
key
===
'coupon'
)
{
const
{
config
,
keys
}
=
createComponent
({
const
{
config
,
keys
}
=
createComponent
({
componentName
:
[
`
${
CHILD_COMPONENT_NAME
[
_row
.
key
]}
`
],
componentName
:
[
`
${
CHILD_COMPONENT_NAME
[
_row
.
key
]}
`
],
childrenData
:
childrenData
,
childrenData
:
childrenData
.
filter
(
Boolean
)
,
startKey
:
startKey
,
startKey
:
startKey
,
dataSource
:
couponResponseData
,
dataSource
:
couponResponseData
,
primaryKey
:
"id"
,
primaryKey
:
"id"
,
...
@@ -539,7 +442,7 @@ function useGetLayout() {
...
@@ -539,7 +442,7 @@ function useGetLayout() {
// 组合促销时
// 组合促销时
const
{
config
,
keys
}
=
createComponent
({
const
{
config
,
keys
}
=
createComponent
({
componentName
:
[
`Combination`
,
`Combination.Item`
],
componentName
:
[
`Combination`
,
`Combination.Item`
],
childrenData
:
childrenData
,
childrenData
:
childrenData
.
filter
(
Boolean
)
,
startKey
:
startKey
,
startKey
:
startKey
,
dataSource
:
activityDataResponse
,
dataSource
:
activityDataResponse
,
primaryKey
:
null
,
primaryKey
:
null
,
...
@@ -559,7 +462,7 @@ function useGetLayout() {
...
@@ -559,7 +462,7 @@ function useGetLayout() {
}
else
if
(
_row
.
key
!==
'suggestProduct'
)
{
}
else
if
(
_row
.
key
!==
'suggestProduct'
)
{
const
{
config
,
keys
}
=
createComponent
({
const
{
config
,
keys
}
=
createComponent
({
componentName
:
[
`
${
CHILD_COMPONENT_NAME
[
_row
.
key
]}
`
],
componentName
:
[
`
${
CHILD_COMPONENT_NAME
[
_row
.
key
]}
`
],
childrenData
:
childrenData
,
childrenData
:
childrenData
.
filter
(
Boolean
)
,
startKey
:
startKey
,
startKey
:
startKey
,
dataSource
:
activityDataResponse
,
dataSource
:
activityDataResponse
,
primaryKey
:
null
,
primaryKey
:
null
,
...
@@ -577,7 +480,7 @@ function useGetLayout() {
...
@@ -577,7 +480,7 @@ function useGetLayout() {
}
else
{
}
else
{
const
{
config
,
keys
}
=
createComponent
({
const
{
config
,
keys
}
=
createComponent
({
componentName
:
[
`CommodityList`
,
'CommodityList.Item'
],
componentName
:
[
`CommodityList`
,
'CommodityList.Item'
],
childrenData
:
childrenData
,
childrenData
:
childrenData
.
filter
(
Boolean
)
,
startKey
:
startKey
,
startKey
:
startKey
,
dataSource
:
activityDataResponse
,
dataSource
:
activityDataResponse
,
primaryKey
:
"id"
,
primaryKey
:
"id"
,
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/common/hooks/useSaveData.ts
View file @
98e4a9d6
...
@@ -107,7 +107,7 @@ function useSaveData(options: Options) {
...
@@ -107,7 +107,7 @@ function useSaveData(options: Options) {
const
childrenData
=
childNodes
.
map
((
_record
)
=>
{
const
childrenData
=
childNodes
.
map
((
_record
)
=>
{
const
childTargetProps
=
pageConfig
[
_record
].
props
;
const
childTargetProps
=
pageConfig
[
_record
].
props
;
return
childTargetProps
.
id
;
return
childTargetProps
.
id
;
});
})
.
filter
(
Boolean
)
;
// const childrenData = products?.map((_item) => _item.id) || [];
// const childrenData = products?.map((_item) => _item.id) || [];
result
=
generaterData
(
result
,
dataIndex
,
{
result
=
generaterData
(
result
,
dataIndex
,
{
sort
:
sort
,
sort
:
sort
,
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/EditPanel/editPanelForm.tsx
View file @
98e4a9d6
...
@@ -120,6 +120,8 @@ const EditPanelForm = () => {
...
@@ -120,6 +120,8 @@ const EditPanelForm = () => {
setFormValue
({
setFormValue
({
product
:
{
product
:
{
...
selectedInfo
.
props
,
...
selectedInfo
.
props
,
/** 当selectedInfo.props 未空对象的时候就不会更新当前value, 所有添加uuid */
uuid
:
Math
.
random
()
}
}
});
});
setSchema
(
activityProducts
);
setSchema
(
activityProducts
);
...
@@ -138,7 +140,7 @@ const EditPanelForm = () => {
...
@@ -138,7 +140,7 @@ const EditPanelForm = () => {
:
propsMapToValue
?.[
componentType
];
:
propsMapToValue
?.[
componentType
];
setSchema
(
tempSchema
);
setSchema
(
tempSchema
);
setFormValue
({
...
tempFormValue
});
setFormValue
({
...
tempFormValue
,
uuid
:
Math
.
random
()
});
}
}
/** 16 种活动,请求是需要带上活动类型 */
/** 16 种活动,请求是需要带上活动类型 */
const
activityType
=
ACTIVITY_MAP
[
componentType
]
?
{
activityType
:
ACTIVITY_MAP
[
componentType
]
}
:
{};
const
activityType
=
ACTIVITY_MAP
[
componentType
]
?
{
activityType
:
ACTIVITY_MAP
[
componentType
]
}
:
{};
...
@@ -147,16 +149,26 @@ const EditPanelForm = () => {
...
@@ -147,16 +149,26 @@ const EditPanelForm = () => {
// console.log(hotItem".substring(0, 1));
// console.log(hotItem".substring(0, 1));
formActions
.
setFieldState
(
'product'
,
(
fieldState
)
=>
{
formActions
.
setFieldState
(
'product'
,
(
fieldState
)
=>
{
const
[,
parentKey
]
=
selectedInfo
.
parentKey
.
split
(
'-'
);
const
[,
parentKey
]
=
selectedInfo
.
parentKey
.
split
(
'-'
);
const
isCombination
=
componentType
===
'combinationItem'
;
/** 如果是组合促销, 要是已经选择了一个组合促销数据,那么搜索活动商品列表时需要添加当前活动id */
let
withActivityId
=
{};
if
(
isCombination
)
{
const
[,
currentCombinationActivityId
]
=
sameKeys
[
`combination_
${
+
(
parentKey
)
-
1
}
`
][
0
].
split
(
'_'
);
withActivityId
=
currentCombinationActivityId
===
'undefined'
?
{}
:
{
id
:
currentCombinationActivityId
}
}
const
disabledKeys
=
componentType
===
'suggestProductItem'
const
disabledKeys
=
componentType
===
'suggestProductItem'
?
sameKeys
[
`suggestProduct_
${
parseInt
(
parentKey
)
-
1
}
`
]
?
sameKeys
[
`suggestProduct_
${
parseInt
(
parentKey
)
-
1
}
`
]
:
componentType
===
'combinationItem'
:
componentType
===
'combinationItem'
?
sameKeys
[
`combination_
${
parseInt
(
parentKey
)
-
1
}
`
]
?
sameKeys
[
`combination_
${
parseInt
(
parentKey
)
-
1
}
`
]
:
sameKeys
[
`
${
componentType
?.
substring
(
0
,
componentType
.
length
-
4
)}
`] || [];
:
sameKeys
[
`
${
componentType
?.
substring
(
0
,
componentType
.
length
-
4
)}
`] || [];
FormPath.setIn(fieldState, 'props.x-component-props', {
FormPath.setIn(fieldState, 'props.x-component-props', {
activityImage: activityImage,
...activityType,
...activityType,
disabledKeys: disabledKeys,
...isWithLabels,
...isWithLabels,
...withActivityId,
activityImage: activityImage,
disabledKeys: disabledKeys,
minType: isWithMinType,
minType: isWithMinType,
});
});
});
});
...
@@ -199,7 +211,7 @@ const EditPanelForm = () => {
...
@@ -199,7 +211,7 @@ const EditPanelForm = () => {
title: values?.title || values?.name
title: values?.title || values?.name
});
});
handleOnClose();
handleOnClose();
formActions.reset();
//
formActions.reset();
};
};
const renderUploadChild = (value) => {
const renderUploadChild = (value) => {
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/EditPanelFormily/FormilyProduct/index.tsx
View file @
98e4a9d6
...
@@ -81,12 +81,14 @@ const FormilyActivityProduct: React.FC<Iprops> & { isFieldComponent: boolean } =
...
@@ -81,12 +81,14 @@ const FormilyActivityProduct: React.FC<Iprops> & { isFieldComponent: boolean } =
const
fetchData
=
async
(
params
:
GetMarketingAdornPlatformActivityListAdornRequest
)
=>
{
const
fetchData
=
async
(
params
:
GetMarketingAdornPlatformActivityListAdornRequest
)
=>
{
const
withActivityType
=
componentProps
?.
activityType
?
{
activityType
:
componentProps
?.
activityType
}
:
{};
const
withActivityType
=
componentProps
?.
activityType
?
{
activityType
:
componentProps
?.
activityType
}
:
{};
const
minType
=
componentProps
?.
minType
?
{
minType
:
componentProps
.
minType
}
:
{};
const
minType
=
componentProps
?.
minType
?
{
minType
:
componentProps
.
minType
}
:
{};
const
withActivityId
=
componentProps
?.
id
?
{
id
:
componentProps
.
id
}
:
{}
const
common
=
{
const
common
=
{
...
params
,
...
params
,
shopId
:
shopId
?.
toString
(),
shopId
:
shopId
?.
toString
(),
...
withActivityType
,
...
withActivityType
,
...
minType
...
minType
,
...
withActivityId
,
};
};
const
isWithActivityType
=
common
;
const
isWithActivityType
=
common
;
return
await
getMarketingAdornPlatformActivityListAdorn
(
isWithActivityType
as
any
);
return
await
getMarketingAdornPlatformActivityListAdorn
(
isWithActivityType
as
any
);
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/Layouts/Combination/index.tsx
View file @
98e4a9d6
...
@@ -14,6 +14,22 @@ interface Iprops {
...
@@ -14,6 +14,22 @@ interface Iprops {
theme
:
number
theme
:
number
}
}
function
parseChildrenList
(
children
:
React
.
ReactNode
)
{
const
elements
=
React
.
Children
.
map
(
children
,
(
node
)
=>
{
if
(
React
.
isValidElement
(
node
))
{
const
key
=
node
.
key
!==
undefined
?
String
(
node
.
key
)
:
undefined
;
return
{
key
,
...
node
.
props
,
node
,
};
}
return
null
});
return
elements
||
[];
}
const
Combination
:
React
.
FC
<
Iprops
>
&
{
Item
:
typeof
CombinationItem
}
=
(
props
:
Iprops
)
=>
{
const
Combination
:
React
.
FC
<
Iprops
>
&
{
Item
:
typeof
CombinationItem
}
=
(
props
:
Iprops
)
=>
{
const
{
children
,
className
,
title
,
theme
,
status
=
true
,
...
other
}
=
props
;
const
{
children
,
className
,
title
,
theme
,
status
=
true
,
...
other
}
=
props
;
const
visible
=
status
const
visible
=
status
...
@@ -22,6 +38,11 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
...
@@ -22,6 +38,11 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
const
divProps
=
{
const
divProps
=
{
onClick
,
onMouseOver
onClick
,
onMouseOver
};
};
const
childrenList
=
parseChildrenList
(
children
);
const
containerTitle
=
childrenList
.
length
===
0
?
`以下商品认选n件,只需m元`
:
childrenList
[
0
]?.
activityList
?.
find
((
_item
)
=>
_item
.
id
===
childrenList
[
0
]?.
activityId
)?.
label
;
// const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState } = other as any;
// const { onClick, onDrag, onDragEnd, onDragEnter, onDragStart, onMouseOver, getOperateState } = other as any;
const
count
=
React
.
Children
.
count
(
children
);
const
count
=
React
.
Children
.
count
(
children
);
const
renderChildren
=
()
=>
{
const
renderChildren
=
()
=>
{
...
@@ -43,7 +64,7 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
...
@@ -43,7 +64,7 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
<
div
className=
{
classNameStr
}
{
...
divProps
}
>
<
div
className=
{
classNameStr
}
{
...
divProps
}
>
{
/* <p className={styles.title}>{title}</p> */
}
{
/* <p className={styles.title}>{title}</p> */
}
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
.
container
}
>
<
div
className=
{
styles
[
'container-title'
]
}
>
以下商品认选2件,只需800元
</
div
>
<
div
className=
{
styles
[
'container-title'
]
}
>
{
containerTitle
}
</
div
>
{
renderChildren
()
}
{
renderChildren
()
}
{
{
count
>
0
&&
(
count
>
0
&&
(
...
@@ -61,10 +82,10 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
...
@@ -61,10 +82,10 @@ const Combination: React.FC<Iprops> & { Item: typeof CombinationItem } = (props:
}
}
const
CombinationItem
:
React
.
FC
<
any
>
=
(
props
:
any
)
=>
{
const
CombinationItem
:
React
.
FC
<
any
>
=
(
props
:
any
)
=>
{
const
{
productImgUrl
,
discount
,
price
,
footer
,
sale
,
productName
,
id
,
activityPrice
}
=
props
as
any
;
const
{
productImgUrl
,
discount
,
price
,
footer
,
sale
,
productName
,
id
,
activityPrice
,
activityList
}
=
props
as
any
;
const
{
onClick
,
on
Drag
,
onDragEnd
,
onDragEnter
,
onDragStart
,
on
MouseOver
,
getOperateState
,
className
}
=
props
as
any
;
const
{
onClick
,
onMouseOver
,
getOperateState
,
className
}
=
props
as
any
;
const
divProps
=
{
const
divProps
=
{
onClick
,
on
Drag
,
onDragEnd
,
onDragEnter
,
onDragStart
,
on
MouseOver
onClick
,
onMouseOver
};
};
// const wrapClass = cx(styles.simple);
// const wrapClass = cx(styles.simple);
const
wrapClass
=
cx
(
styles
.
section
,
className
)
const
wrapClass
=
cx
(
styles
.
section
,
className
)
...
@@ -86,7 +107,11 @@ const CombinationItem: React.FC<any> = (props: any) => {
...
@@ -86,7 +107,11 @@ const CombinationItem: React.FC<any> = (props: any) => {
<
img
src=
{
productImgUrl
}
className=
{
styles
[
'simple-product-image'
]
}
/>
<
img
src=
{
productImgUrl
}
className=
{
styles
[
'simple-product-image'
]
}
/>
<
div
className=
{
styles
[
'simple-product-name'
]
}
>
{
productName
}
</
div
>
<
div
className=
{
styles
[
'simple-product-name'
]
}
>
{
productName
}
</
div
>
<
div
className=
{
styles
[
'simple-product-label'
]
}
>
<
div
className=
{
styles
[
'simple-product-label'
]
}
>
<
CustomizeTag
>
800元2件
</
CustomizeTag
>
{
activityList
.
map
((
_item
)
=>
{
return
(
<
CustomizeTag
>
{
_item
.
label
}
</
CustomizeTag
>
)
})
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/pages/marketingManage/marketing/marketingActivitiesManagement/activePage/fixtures/components/Layouts/CommodityList/swapCoupon.tsx
View file @
98e4a9d6
...
@@ -16,10 +16,10 @@ const SwapCoupon = (props) => {
...
@@ -16,10 +16,10 @@ const SwapCoupon = (props) => {
const
restProps
=
_omit
(
other
,
[
"getOperateState"
,
"onClick"
,
"onDrag"
,
"onDragEnd"
,
"onDragEnter"
,
"onDragStart"
,
"onMouseOver"
,
"draggable"
]);
const
restProps
=
_omit
(
other
,
[
"getOperateState"
,
"onClick"
,
"onDrag"
,
"onDragEnd"
,
"onDragEnter"
,
"onDragStart"
,
"onMouseOver"
,
"draggable"
]);
const
isEmpty
=
typeof
restProps
[
'productName'
]
===
'undefined'
;
const
isEmpty
=
typeof
restProps
[
'productName'
]
===
'undefined'
;
const
{
onClick
,
on
Drag
,
onDragEnd
,
onDragEnter
,
onDragStart
,
on
MouseOver
,
getOperateState
}
=
other
as
any
;
const
{
onClick
,
onMouseOver
,
getOperateState
}
=
other
as
any
;
const
divProps
=
{
const
divProps
=
{
onClick
,
on
Drag
,
onDragEnd
,
onDragEnter
,
onDragStart
,
on
MouseOver
,
onClick
,
onMouseOver
,
};
};
const
handleTabChange
=
(
key
:
string
)
=>
{
const
handleTabChange
=
(
key
:
string
)
=>
{
setActiveKey
(
key
);
setActiveKey
(
key
);
...
@@ -65,7 +65,7 @@ const SwapCoupon = (props) => {
...
@@ -65,7 +65,7 @@ const SwapCoupon = (props) => {
<
span
className=
{
styles
.
num
}
>
{
_row
.
denomination
}
</
span
>
<
span
className=
{
styles
.
num
}
>
{
_row
.
denomination
}
</
span
>
</
div
>
</
div
>
<
div
className=
{
styles
.
condition
}
>
{
`满${_row.useConditionMoney}可使用`
}
</
div
>
<
div
className=
{
styles
.
condition
}
>
{
`满${_row.useConditionMoney}可使用`
}
</
div
>
<
div
className=
{
styles
.
couponType
}
>
{
_row
.
coupon
Name
}
</
div
>
<
div
className=
{
styles
.
couponType
}
>
{
_row
.
type
Name
}
</
div
>
</
div
>
</
div
>
);
);
})
})
...
...
src/utils/request.ts
View file @
98e4a9d6
import
{
extend
,
ResponseError
,
OnionOptions
,
RequestOptionsInit
,
ResponseInterceptor
,
OnionMiddleware
,
Context
,
RequestMethod
}
from
'umi-request'
;
import
{
extend
,
ResponseError
,
OnionOptions
,
RequestOptionsInit
,
ResponseInterceptor
,
OnionMiddleware
,
Context
,
RequestMethod
}
from
'umi-request'
;
import
responseCode
from
'@/constants/responseCode'
import
responseCode
from
'@/constants/responseCode'
import
{
IRequestError
,
IRequestSuccess
}
from
'..'
;
import
{
IRequestError
,
IRequestSuccess
}
from
'..'
;
import
{
history
}
from
'umi'
import
{
getLocale
,
history
}
from
'umi'
import
{
message
}
from
'antd'
import
{
message
}
from
'antd'
import
{
getAuth
,
removeAuth
,
removeRouters
}
from
'./auth'
;
import
{
getAuth
,
removeAuth
,
removeRouters
}
from
'./auth'
;
import
{
isDev
}
from
'@/constants'
;
import
{
isDev
}
from
'@/constants'
;
...
@@ -44,6 +44,12 @@ const defaultHeaders = {
...
@@ -44,6 +44,12 @@ const defaultHeaders = {
'source'
:
'99'
'source'
:
'99'
}
}
const
requestLanguageMaps
=
{
'zh-CN'
:
'zh'
,
'en-US'
:
'en'
,
'ko-KR'
:
'ko'
,
}
/**
/**
* 配置request请求时的默认参数, 底层使用fetch进行请求
* 配置request请求时的默认参数, 底层使用fetch进行请求
*/
*/
...
@@ -59,6 +65,7 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):
...
@@ -59,6 +65,7 @@ baseRequest.interceptors.request.use((url: string, options: RequestOptionsInit):
// 判断是否有权限
// 判断是否有权限
const
{
userId
,
memberId
,
token
}
=
getAuth
()
||
{}
const
{
userId
,
memberId
,
token
}
=
getAuth
()
||
{}
const
headers
=
{
const
headers
=
{
'Accept-Language'
:
requestLanguageMaps
[
getLocale
()
as
any
],
...
options
.
headers
,
...
options
.
headers
,
userId
,
userId
,
memberId
,
memberId
,
...
...
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