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
0f791c39
Commit
0f791c39
authored
Aug 23, 2021
by
卢均锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: c端装修推荐商品分类设置及回显
-修改部分c端装修相关设置组件因频繁发送changeProps导致卡死
parent
54a09984
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
22 deletions
+66
-22
returnSaveParams.ts
...ges/pageCustomized/components/toolBar/returnSaveParams.ts
+19
-0
config.ts
src/pages/pageCustomized/mobileClientEdit/config.ts
+2
-1
index.tsx
src/pages/pageCustomized/mobileClientEdit/index.tsx
+22
-0
index.tsx
...tingPanel/propsSettings/components/bannerClient/index.tsx
+6
-6
index.tsx
...propsSettings/components/bottomNavigationClient/index.tsx
+4
-4
index.tsx
...tingPanel/propsSettings/components/couponsModal/index.tsx
+1
-1
index.tsx
...el/propsSettings/components/marketingCardHeader/index.tsx
+2
-2
index.tsx
...ngPanel/propsSettings/components/suggestProduct/index.tsx
+10
-8
No files found.
src/pages/pageCustomized/components/toolBar/returnSaveParams.ts
View file @
0f791c39
...
...
@@ -445,6 +445,25 @@ export const paramsClient = (templateId: any, pageConfig: PageConfigType) => {
}
}
break
;
case
'10'
:
_params
.
adornContent
.
suggestProduct
=
{
sort
:
1
,
style
:
0
,
status
:
true
,
details
:
[],
};
if
(
pageConfig
[
'10'
].
childNodes
?.
length
)
{
const
_list
=
pageConfig
[
'10'
].
childNodes
;
for
(
let
key
in
pageConfig
[
'10'
].
childNodes
)
{
_params
.
adornContent
.
suggestProduct
.
details
.
push
({
title
:
pageConfig
[
_list
[
key
]]?.
props
?.
title
,
explain
:
pageConfig
[
_list
[
key
]]?.
props
?.
explain
,
type
:
pageConfig
[
_list
[
key
]]?.
props
?.
type
,
num
:
pageConfig
[
_list
[
key
]]?.
props
?.
num
,
});
}
}
break
;
case
'12'
:
_params
.
adornContent
.
bottom
=
{
sort
:
1
,
...
...
src/pages/pageCustomized/mobileClientEdit/config.ts
View file @
0f791c39
...
...
@@ -825,7 +825,8 @@ export const suggestProductConfig = {
componentName
:
'SuggestProduct.Items'
,
props
:
{},
childComponentName
:
'SuggestProduct.Commodity'
,
addBtnText
:
'添加商品'
,
maxLength
:
50
,
// addBtnText: '添加商品',
childNodes
:
[],
},
},
...
...
src/pages/pageCustomized/mobileClientEdit/index.tsx
View file @
0f791c39
...
...
@@ -806,6 +806,28 @@ const mobileClientEdit: React.FC<ShopPreviewPropsType> = (props) => {
if
(
appConfig
?.
adornContent
?.
suggestProduct
)
{
// 商品推荐
const
_details
=
appConfig
?.
adornContent
?.
suggestProduct
?.
details
;
if
(
_details
.
length
>
0
)
{
_details
?.
forEach
((
item
,
index
)
=>
{
const
_newKey
=
`10-
${
Number
(
index
)
+
1
}
`
;
!
_suggestProductConfig
[
'10'
].
childNodes
.
includes
(
_newKey
)
&&
_suggestProductConfig
[
'10'
].
childNodes
.
push
(
_newKey
)
_suggestProductConfig
[
_newKey
]
=
{
key
:
_newKey
,
title
:
item
?.
title
||
'商品容器'
,
canEdit
:
true
,
canHide
:
false
,
componentName
:
'SuggestProduct.Items'
,
props
:
{
...
item
,
isnull
:
false
},
childComponentName
:
'SuggestProduct.Commodity'
,
maxLength
:
item
?.
num
?
item
?.
num
:
50
,
// addBtnText: '添加商品',
childNodes
:
[],
}
})
}
}
!
_mallLayoutConfig
[
'0'
].
childNodes
.
includes
(
'10'
)
&&
_mallLayoutConfig
[
'0'
].
childNodes
.
push
(
'10'
);
...
...
src/pages/pageCustomized/mobileSettingPanel/propsSettings/components/bannerClient/index.tsx
View file @
0f791c39
...
...
@@ -101,13 +101,13 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
},
[
type
])
const
_isNull
=
(
list
)
=>
{
let
_
flag
=
true
;
let
_
number
=
0
;
for
(
let
key
in
list
)
{
if
(
list
[
key
])
{
_
flag
=
false
_
number
+=
1
}
}
return
_
flag
;
return
_
number
===
list
.
length
?
false
:
true
;
}
useEffect
(()
=>
{
...
...
@@ -119,7 +119,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
id
&&
_fetch
?.({
id
:
id
}).
then
((
res
)
=>
{
if
(
res
.
code
===
1000
)
{
setRecord
(
res
.
data
)
}
else
{
}
else
{
setRecord
(
''
);
}
}).
catch
(
_
=>
setRecord
(
''
));
...
...
@@ -188,7 +188,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
if
(
property
===
2
&&
type
===
5
)
{
return
false
}
if
(
!
type
)
{
if
(
!
type
)
{
return
false
}
return
true
;
...
...
@@ -257,7 +257,7 @@ const BannerClient: React.FC<BannerClientProps> = (props: BannerClientProps) =>
<
div
className=
{
styles
[
'banner'
]
}
>
<
div
className=
{
styles
[
'banner-box'
]
}
>
<
div
className=
{
styles
[
'banner-box-label'
]
}
>
名称
</
div
>
<
Input
key=
{
`${selectedKey}-name`
}
defaultValue=
{
name
}
on
Change
=
{
_onChangeName
}
/>
<
Input
key=
{
`${selectedKey}-name`
}
defaultValue=
{
name
}
on
Blur
=
{
_onChangeName
}
/>
</
div
>
<
div
className=
{
styles
[
'banner-box'
]
}
>
<
div
className=
{
styles
[
'banner-box-label'
]
}
>
图片
</
div
>
...
...
src/pages/pageCustomized/mobileSettingPanel/propsSettings/components/bottomNavigationClient/index.tsx
View file @
0f791c39
...
...
@@ -69,13 +69,13 @@ const BottomNavigationClient: React.FC<BottomNavigationClientProps> = (props: Bo
const
{
defaultIcon
,
selectIcon
,
name
,
type
,
selectedKey
}
=
props
;
const
_isNull
=
(
list
)
=>
{
let
_
flag
=
true
;
let
_
number
=
0
;
for
(
let
key
in
list
)
{
if
(
list
[
key
])
{
_
flag
=
false
_
number
+=
1
}
}
return
_
flag
;
return
_
number
===
list
.
length
?
false
:
true
;
}
const
_onChangeName
=
(
e
:
any
)
=>
{
...
...
@@ -108,7 +108,7 @@ const BottomNavigationClient: React.FC<BottomNavigationClientProps> = (props: Bo
<
div
className=
{
styles
[
'bottomNavigationClient'
]
}
>
<
div
className=
{
styles
[
'bottomNavigationClient-box'
]
}
>
<
div
className=
{
styles
[
'bottomNavigationClient-box-label'
]
}
>
名称
</
div
>
<
Input
key=
{
`${selectedKey}-name`
}
defaultValue=
{
name
}
on
Change
=
{
_onChangeName
}
/>
<
Input
key=
{
`${selectedKey}-name`
}
defaultValue=
{
name
}
on
Blur
=
{
_onChangeName
}
/>
</
div
>
<
div
className=
{
styles
[
'bottomNavigationClient-box'
]
}
>
<
div
className=
{
styles
[
'bottomNavigationClient-box-label'
]
}
>
链接
</
div
>
...
...
src/pages/pageCustomized/mobileSettingPanel/propsSettings/components/couponsModal/index.tsx
View file @
0f791c39
...
...
@@ -24,7 +24,7 @@ const CouponsModal: React.FC<CouponsModalProps> = (props: CouponsModalProps) =>
<
div
className=
{
styles
[
'couponsModal'
]
}
>
<
div
className=
{
styles
[
'couponsModal-box'
]
}
>
<
div
className=
{
styles
[
'couponsModal-box-label'
]
}
>
标题
</
div
>
<
Input
key=
{
`${selectedKey}-title`
}
defaultValue=
{
title
}
on
Change
=
{
_onChangeTitle
}
/>
<
Input
key=
{
`${selectedKey}-title`
}
defaultValue=
{
title
}
on
Blur
=
{
_onChangeTitle
}
/>
</
div
>
</
div
>
);
...
...
src/pages/pageCustomized/mobileSettingPanel/propsSettings/components/marketingCardHeader/index.tsx
View file @
0f791c39
...
...
@@ -50,11 +50,11 @@ const MarketingCardHeader: React.FC<MarketingCardHeaderProps> = (props: Marketin
<
div
className=
{
styles
[
'marketingCardHeader'
]
}
>
<
div
className=
{
styles
[
'marketingCardHeader-box'
]
}
>
<
div
className=
{
styles
[
'marketingCardHeader-box-label'
]
}
>
标题
</
div
>
<
Input
key=
{
`${selectedKey}-title`
}
defaultValue=
{
title
||
_defaultInfo
?.
title
}
on
Change
=
{
_onChangeTitle
}
/>
<
Input
key=
{
`${selectedKey}-title`
}
defaultValue=
{
title
||
_defaultInfo
?.
title
}
on
Blur
=
{
_onChangeTitle
}
/>
</
div
>
<
div
className=
{
styles
[
'marketingCardHeader-box'
]
}
>
<
div
className=
{
styles
[
'marketingCardHeader-box-label'
]
}
>
标题说明
</
div
>
<
Input
key=
{
`${selectedKey}-explain`
}
defaultValue=
{
explain
||
_defaultInfo
?.
explain
}
on
Change
=
{
_onChangeExplain
}
/>
<
Input
key=
{
`${selectedKey}-explain`
}
defaultValue=
{
explain
||
_defaultInfo
?.
explain
}
on
Blur
=
{
_onChangeExplain
}
/>
</
div
>
<
div
className=
{
styles
[
'marketingCardHeader-box'
]
}
>
<
div
className=
{
styles
[
'marketingCardHeader-box-label'
]
}
>
图标
</
div
>
...
...
src/pages/pageCustomized/mobileSettingPanel/propsSettings/components/suggestProduct/index.tsx
View file @
0f791c39
...
...
@@ -17,13 +17,13 @@ interface SuggestProductProps {
const
SuggestProduct
:
React
.
FC
<
SuggestProductProps
>
=
(
props
:
SuggestProductProps
)
=>
{
const
{
title
,
explain
,
type
,
num
,
customize
,
selectedKey
}
=
props
;
const
_isNull
=
(
list
)
=>
{
let
_
flag
=
true
;
let
_
number
=
0
;
for
(
let
key
in
list
)
{
if
(
list
[
key
])
{
_
flag
=
false
_
number
+=
1
}
}
return
_
flag
;
return
_
number
===
list
.
length
?
false
:
true
;
}
const
_onChangeTitle
=
(
e
:
any
)
=>
{
...
...
@@ -44,14 +44,16 @@ const SuggestProduct: React.FC<SuggestProductProps> = (props: SuggestProductProp
const
_onChangeType
=
(
e
:
any
)
=>
{
const
_val
=
e
.
target
.
value
;
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
type
:
_val
,
isnull
:
_isNull
([
title
,
explain
,
_val
])
})
props
:
Object
.
assign
({
...
props
},
{
type
:
_val
,
isnull
:
_isNull
([
title
,
explain
,
_val
])
}),
addBtnText
:
_val
===
3
?
'添加商品'
:
''
,
});
}
const
_onChangeNum
=
(
e
:
any
)
=>
{
const
_val
=
e
.
target
.
value
.
replace
(
/
[^\d]
/g
,
''
);
changeProps
({
props
:
Object
.
assign
({
...
props
},
{
num
:
_val
,
isnull
:
_isNull
([
title
,
explain
,
_val
])
})
props
:
Object
.
assign
({
...
props
},
{
num
:
_val
,
isnull
:
_isNull
([
title
,
explain
,
_val
])
}),
maxLength
:
_val
});
}
...
...
@@ -59,11 +61,11 @@ const SuggestProduct: React.FC<SuggestProductProps> = (props: SuggestProductProp
<
div
className=
{
styles
[
'suggestProduct'
]
}
>
<
div
className=
{
styles
[
'suggestProduct-box'
]
}
>
<
div
className=
{
styles
[
'suggestProduct-box-label'
]
}
>
标题
</
div
>
<
Input
key=
{
`${selectedKey}-title`
}
defaultValue=
{
title
}
on
Change
=
{
_onChangeTitle
}
maxLength=
{
8
}
/>
<
Input
key=
{
`${selectedKey}-title`
}
defaultValue=
{
title
}
on
Blur
=
{
_onChangeTitle
}
maxLength=
{
8
}
/>
</
div
>
<
div
className=
{
styles
[
'suggestProduct-box'
]
}
>
<
div
className=
{
styles
[
'suggestProduct-box-label'
]
}
>
标题说明
</
div
>
<
Input
key=
{
`${selectedKey}-explain`
}
defaultValue=
{
explain
}
on
Change
=
{
_onChangeExplain
}
maxLength=
{
16
}
/>
<
Input
key=
{
`${selectedKey}-explain`
}
defaultValue=
{
explain
}
on
Blur
=
{
_onChangeExplain
}
maxLength=
{
16
}
/>
</
div
>
<
div
className=
{
styles
[
'suggestProduct-box'
]
}
>
<
div
className=
{
styles
[
'suggestProduct-box-label'
]
}
>
商品展示
</
div
>
...
...
@@ -77,7 +79,7 @@ const SuggestProduct: React.FC<SuggestProductProps> = (props: SuggestProductProp
</
div
>
<
div
className=
{
styles
[
'suggestProduct-box'
]
}
>
<
div
className=
{
styles
[
'suggestProduct-box-label'
]
}
>
展示数量
</
div
>
<
Input
key=
{
`${selectedKey}-num`
}
defaultValue=
{
num
}
on
Change
=
{
_onChangeNum
}
/>
<
Input
key=
{
`${selectedKey}-num`
}
defaultValue=
{
num
}
on
Blur
=
{
_onChangeNum
}
/>
</
div
>
</
div
>
)
...
...
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