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
project
jinfa-admin
Commits
ed8dfc6f
Commit
ed8dfc6f
authored
Aug 19, 2021
by
卢均锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 完善c端首页装修的优惠券弹窗设置及回显
parent
4dc52a80
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
20 deletions
+44
-20
index.tsx
...pageCustomized/components/drawers/couponsDrawer/index.tsx
+2
-2
returnSaveParams.ts
...ges/pageCustomized/components/toolBar/returnSaveParams.ts
+8
-5
index.tsx
src/pages/pageCustomized/mobileClientEdit/index.tsx
+27
-8
index.tsx
...el/propsSettings/components/marketingCardCoupon/index.tsx
+7
-5
No files found.
src/pages/pageCustomized/components/drawers/couponsDrawer/index.tsx
View file @
ed8dfc6f
...
...
@@ -105,8 +105,8 @@ const CouponsDrawer: React.FC<CouponsDrawerProps> = (props: CouponsDrawerProps)
key
:
'belongName'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
Space
direction=
'vertical'
>
<
StatusTag
title=
{
record
.
type
===
1
?
'平台'
:
'商家'
}
type=
{
record
.
t
ype
===
1
?
'success'
:
'primary'
}
/>
{
record
.
t
ype
===
2
&&
<
Typography
.
Text
type=
'secondary'
>
{
text
}
</
Typography
.
Text
>
}
<
StatusTag
title=
{
record
.
belongType
===
1
?
'平台'
:
'商家'
}
type=
{
record
.
belongT
ype
===
1
?
'success'
:
'primary'
}
/>
{
record
.
belongT
ype
===
2
&&
<
Typography
.
Text
type=
'secondary'
>
{
text
}
</
Typography
.
Text
>
}
</
Space
>
)
},
...
...
src/pages/pageCustomized/components/toolBar/returnSaveParams.ts
View file @
ed8dfc6f
...
...
@@ -38,13 +38,15 @@ export const paramsClient = (templateId: any, pageConfig: PageConfigType) => {
title
:
pageConfig
[
'11-1-1'
]?.
props
?.
title
,
explain
:
pageConfig
[
'11-1-1'
]?.
props
?.
explain
,
icon
:
pageConfig
[
'11-1-1'
]?.
props
?.
icon
,
id
:
[]
id
:
[]
,
},
};
if
(
pageConfig
[
'11-1-2'
].
childNodes
?.
length
)
{
const
_list
=
pageConfig
[
'11-1-2'
].
childNodes
;
for
(
let
key
in
_list
)
{
_params
.
adornContent
.
specialOffer
.
details
.
id
.
push
(
pageConfig
[
_list
[
key
]]?.
props
?.
id
);
_params
.
adornContent
.
specialOffer
.
details
.
id
.
push
(
pageConfig
[
_list
[
key
]]?.
props
?.
id
,
);
}
}
break
;
...
...
@@ -80,9 +82,10 @@ export const paramsClient = (templateId: any, pageConfig: PageConfigType) => {
if
(
pageConfig
[
'13'
].
childNodes
?.
length
)
{
const
_list
=
pageConfig
[
'13'
].
childNodes
;
for
(
let
key
in
_list
)
{
_params
.
adornContent
.
coupon
.
details
.
id
.
push
(
pageConfig
[
_list
[
key
]]?.
props
?.
id
,
);
_params
.
adornContent
.
coupon
.
details
.
id
.
push
({
id
:
pageConfig
[
_list
[
key
]]?.
props
?.
id
,
belongType
:
pageConfig
[
_list
[
key
]]?.
props
?.
belongType
,
});
}
}
break
;
...
...
src/pages/pageCustomized/mobileClientEdit/index.tsx
View file @
ed8dfc6f
...
...
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import
{
BrickProvider
}
from
'@lingxi-disign/react'
;
import
{
updatePageConfig
}
from
'@lingxi-disign/core'
;
import
{
message
}
from
'antd'
;
import
moment
from
'moment'
;
import
cloneDeep
from
'lodash/cloneDeep'
;
import
{
PublicApi
}
from
'@/services/api'
;
...
...
@@ -177,11 +178,11 @@ const mobileClientEdit: React.FC<ShopPreviewPropsType> = (props) => {
_marketingConfig_1
[
'11-1-1'
].
props
.
icon
=
_details
.
icon
;
const
_ids
=
_details
.
id
.
join
(
','
);
if
(
_ids
.
length
>
0
)
{
const
_detailData
=
await
PublicApi
.
getMarketingPlatformActivityGoodsAdorn
({
ids
:
_ids
})
const
_detailData
=
await
PublicApi
.
getMarketingPlatformActivityGoodsAdorn
({
ids
:
_ids
})
if
(
_detailData
.
code
===
1000
)
{
_detailData
.
data
?.
forEach
((
item
,
index
)
=>
{
const
_newKey
=
`11-1-2-
${
Number
(
index
)
+
1
}
`
;
_marketingConfig_1
[
'11-1-2'
].
childNodes
.
push
(
_newKey
);
!
_marketingConfig_1
[
'11-1-2'
].
childNodes
.
includes
(
_newKey
)
&&
_marketingConfig_1
[
'11-1-2'
].
childNodes
.
push
(
_newKey
)
_marketingConfig_1
[
_newKey
]
=
{
key
:
_newKey
,
title
:
item
.
productName
,
...
...
@@ -388,12 +389,30 @@ const mobileClientEdit: React.FC<ShopPreviewPropsType> = (props) => {
// 优惠券弹窗
const
_details
=
appConfig
?.
adornContent
?.
coupon
?.
details
;
_couponsModalConfig
[
'13'
].
props
.
title
=
_details
.
title
;
// if (_details.id.length > 0) {
// for (let key in _details.id) {
// const _childKey: any = `13-${Number(key) + 1}`;
// !_couponsModalConfig['13'].childNodes.includes(_childKey) && _couponsModalConfig['13'].childNodes.push(_childKey)
// }
// }
if
(
_details
.
id
.
length
>
0
)
{
const
_couponList
=
_details
.
id
?.
map
((
item
)
=>
{
return
{
couponType
:
item
.
belongType
,
id
:
item
.
id
}
});
const
_couponListData
=
await
PublicApi
.
postMarketingCouponPlatformActivityPageSelectDetail
({
couponList
:
_couponList
});
if
(
_couponListData
.
code
===
1000
)
{
_couponListData
.
data
?.
forEach
((
item
,
index
)
=>
{
const
_newKey
:
any
=
`13-
${
Number
(
index
)
+
1
}
`
;
!
_couponsModalConfig
[
'13'
].
childNodes
.
includes
(
_newKey
)
&&
_couponsModalConfig
[
'13'
].
childNodes
.
push
(
_newKey
)
_couponsModalConfig
[
_newKey
]
=
{
key
:
_newKey
,
title
:
item
.
name
,
componentName
:
'CouponsModal.CouponsItem'
,
props
:
{
...
item
,
expiredDay
:
moment
(
item
?.
releaseTimeEnd
||
moment
()).
diff
(
moment
(),
'days'
),
isnull
:
false
}
}
})
}
for
(
let
key
in
_details
.
id
)
{
const
_childKey
:
any
=
`13-
${
Number
(
key
)
+
1
}
`
;
!
_couponsModalConfig
[
'13'
].
childNodes
.
includes
(
_childKey
)
&&
_couponsModalConfig
[
'13'
].
childNodes
.
push
(
_childKey
)
}
}
}
!
_mallLayoutConfig
[
'0'
].
childNodes
.
includes
(
'13'
)
&&
_mallLayoutConfig
[
'0'
].
childNodes
.
push
(
'13'
);
...
...
src/pages/pageCustomized/mobileSettingPanel/propsSettings/components/marketingCardCoupon/index.tsx
View file @
ed8dfc6f
...
...
@@ -14,13 +14,13 @@ import styles from './index.less';
interface
MarketingCardCouponProps
{
id
?:
number
,
t
ype
?:
number
,
belongT
ype
?:
number
,
// 当前选中组件的key
selectedKey
?:
any
,
}
const
MarketingCardCoupon
:
React
.
FC
<
MarketingCardCouponProps
>
=
(
props
:
MarketingCardCouponProps
)
=>
{
const
{
id
,
t
ype
,
selectedKey
}
=
props
;
const
{
id
,
belongT
ype
,
selectedKey
}
=
props
;
const
[
drawerVisible
,
setDrawerVisible
]
=
useState
(
false
);
const
[
record
,
setRecord
]
=
useState
<
any
>
();
const
_onClose
=
()
=>
{
...
...
@@ -28,15 +28,17 @@ const MarketingCardCoupon: React.FC<MarketingCardCouponProps> = (props: Marketin
}
useEffect
(()
=>
{
if
(
id
&&
id
!=
record
?.
id
)
{
PublicApi
.
postMarketingCouponPlatformActivityPageSelectDetail
({
couponList
:
[{
couponType
:
t
ype
,
id
:
id
}]
}).
then
((
res
)
=>
{
PublicApi
.
postMarketingCouponPlatformActivityPageSelectDetail
({
couponList
:
[{
couponType
:
belongT
ype
,
id
:
id
}]
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
setRecord
(
res
.
data
[
0
]);
}
else
{
setRecord
(
''
)
}
}).
catch
(
err
=>
console
.
log
(
err
))
}).
catch
(
_
=>
setRecord
(
''
))
}
else
if
(
!
id
){
setRecord
(
''
);
}
},
[
id
,
t
ype
])
},
[
id
,
belongT
ype
])
const
_onChooseConfirm
=
(
record
)
=>
{
setRecord
(
record
);
changeProps
({
...
...
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