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
5c9aa071
Commit
5c9aa071
authored
Oct 26, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 优惠券弹窗回显问题
parent
a616819c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
index.tsx
src/pages/mobileTemplate/channelTemplateEdit/index.tsx
+30
-0
index.tsx
src/pages/mobileTemplate/ownMallTemplateEdit/index.tsx
+29
-0
No files found.
src/pages/mobileTemplate/channelTemplateEdit/index.tsx
View file @
5c9aa071
...
...
@@ -13,6 +13,7 @@ import {
resolveMappingPageConfig
,
updatePageConfig
,
}
from
'@lingxi-disign/react'
;
import
moment
from
'moment'
import
ToolBar
from
'../../editor/components/toolBar'
;
import
MobileDesignPanel
from
'../../editor/components/MobileDesignPanel'
;
import
MobileClientEditLeft
from
'../../editor/components/mobileClientEditLeft'
;
...
...
@@ -1014,6 +1015,35 @@ const mobileShopTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
}
}
}
if
(
appConfig
?.
coupon
)
{
// 优惠券弹窗
const
_details
=
appConfig
?.
coupon
?.
details
;
_couponsModalConfig
[
'13'
].
props
.
title
=
_details
?.
title
;
if
(
_details
.
id
.
length
>
0
)
{
const
_couponList
=
_details
.
id
?.
map
((
item
)
=>
{
return
{
belongType
:
item
.
belongType
,
couponId
:
item
.
id
};
});
const
_couponListData
=
await
PublicApi
.
postMarketingCouponActivityPageSelectDetail
({
couponList
:
_couponList
});
message
.
destroy
();
if
(
_couponListData
.
code
===
1000
)
{
_couponListData
.
data
?.
forEach
((
item
,
index
)
=>
{
console
.
log
(
item
,
'couponitem'
)
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
}
};
});
}
}
}
!
_mallLayoutConfig
[
'0'
].
childNodes
.
includes
(
'12'
)
&&
_mallLayoutConfig
[
'0'
].
childNodes
.
push
(
'12'
);
...
...
src/pages/mobileTemplate/ownMallTemplateEdit/index.tsx
View file @
5c9aa071
...
...
@@ -22,6 +22,7 @@ import { priceFormat } from '@/utils/numberFomat';
import
*
as
MarketingConfigs
from
'./marketing_config'
;
import
{
cloneDeep
}
from
'lodash'
;
import
{
GlobalConfig
}
from
'@/global/config'
import
moment
from
'moment'
import
{
defaultHeaderNavData
,
channelLayoutConfig
,
...
...
@@ -1042,6 +1043,34 @@ const OwnMallTempleteEdit: React.FC<ShopPreviewPropsType> = props => {
}
}
if
(
appConfig
?.
coupon
)
{
// 优惠券弹窗
const
_details
=
appConfig
?.
coupon
?.
details
;
_couponsModalConfig
[
'13'
].
props
.
title
=
_details
?.
title
;
if
(
_details
.
id
.
length
>
0
)
{
const
_couponList
=
_details
.
id
?.
map
((
item
)
=>
{
return
{
belongType
:
item
.
belongType
,
couponId
:
item
.
id
};
});
const
_couponListData
=
await
PublicApi
.
postMarketingCouponActivityPageSelectDetail
({
couponList
:
_couponList
});
message
.
destroy
();
if
(
_couponListData
.
code
===
1000
)
{
_couponListData
.
data
?.
forEach
((
item
,
index
)
=>
{
console
.
log
(
item
,
'couponitem'
)
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
}
};
});
}
}
}
_mallLayoutConfig
[
'0'
].
childNodes
=
[...
_mallLayoutConfig
[
'0'
].
childNodes
,
'16'
,
'12'
,
'13'
,
'14'
];
const
config
=
{
...
_mallLayoutConfig
,
...
...
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