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
f5ede3d0
Commit
f5ede3d0
authored
Dec 11, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 修改代码eslint提示的规范问题
parent
2c4fccea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
108 deletions
+61
-108
defaultData.ts
src/pages/pageCustomized/mallEdit/defaultData.ts
+1
-22
index.tsx
src/pages/pageCustomized/mallEdit/index.tsx
+28
-42
index.tsx
src/pages/pageCustomized/preview/mallPreview/index.tsx
+32
-44
No files found.
src/pages/pageCustomized/mallEdit/defaultData.ts
View file @
f5ede3d0
...
@@ -144,26 +144,6 @@ export default {
...
@@ -144,26 +144,6 @@ export default {
"hasQuickNav"
:
true
,
"hasQuickNav"
:
true
,
"linkdisable"
:
true
,
"linkdisable"
:
true
,
"advertList"
:
[]
"advertList"
:
[]
// "advertList": [
// {
// id: 1,
// templateId: 707,
// type: 2,
// name: '意大利进口荔枝纹牛皮会员价促销最低 9 折',
// picUrl: 'https://img.alicdn.com/imgextra/i4/81/O1CN01VT5ViO1CT8h4sY7qc_!!81-0-luban.jpg_q100.jpg_.webp',
// link: 'https://www.baidu.com',
// sort: 1,
// },
// {
// id: 2,
// templateId: 707,
// type: 2,
// name: '意大利进口荔枝纹牛皮会员价促销最低 9 折',
// picUrl: 'https://img.alicdn.com/tps/i4/TB1ICgYL.H1gK0jSZSySuttlpXa.jpg',
// link: 'https://www.baidu.com',
// sort: 2,
// }
// ]
}
}
},
},
"7"
:
{
"7"
:
{
...
@@ -233,4 +213,4 @@ export default {
...
@@ -233,4 +213,4 @@ export default {
"componentName"
:
"Footer"
,
"componentName"
:
"Footer"
,
"props"
:
{},
"props"
:
{},
},
},
}
}
\ No newline at end of file
src/pages/pageCustomized/mallEdit/index.tsx
View file @
f5ede3d0
...
@@ -27,7 +27,7 @@ interface MallEditPropsType {
...
@@ -27,7 +27,7 @@ interface MallEditPropsType {
}
}
}
}
le
t
TemplateList
=
[
'science'
]
cons
t
TemplateList
=
[
'science'
]
const
MallEdit
:
React
.
FC
<
MallEditPropsType
>
=
(
props
)
=>
{
const
MallEdit
:
React
.
FC
<
MallEditPropsType
>
=
(
props
)
=>
{
const
{
query
:
{
id
,
template
}
}
=
props
.
location
const
{
query
:
{
id
,
template
}
}
=
props
.
location
...
@@ -46,11 +46,11 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -46,11 +46,11 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
const
findFirstAdvertsByType
=
()
=>
{
const
findFirstAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
1
type
:
1
}
}
//@ts-ignore
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -63,11 +63,11 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -63,11 +63,11 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
const
findSecondAdvertsByType
=
()
=>
{
const
findSecondAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
2
type
:
2
}
}
//@ts-ignore
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -98,12 +98,11 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -98,12 +98,11 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
*/
*/
const
fetchCategoryById
=
(
categoryId
)
=>
{
const
fetchCategoryById
=
(
categoryId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
param
=
{
const
param
:
any
=
{
templateId
:
id
,
templateId
:
id
,
categoryId
categoryId
}
}
// @ts-ignore
PublicApi
.
getTemplatePlatformFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplatePlatformFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -112,18 +111,6 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -112,18 +111,6 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
})
})
}
}
const
fetchTmeplateInfo
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
//@ts-ignore
PublicApi
.
getTemplatePlatformFindMallHome
({
templateId
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
}
/**
/**
* 获取头条新闻
* 获取头条新闻
*/
*/
...
@@ -132,10 +119,10 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -132,10 +119,10 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
//@ts-ignore
//@ts-ignore
PublicApi
.
getManageContentInformationFindAllByRecommendLabel
({
recommendLabel
:
1
}).
then
(
res
=>
{
PublicApi
.
getManageContentInformationFindAllByRecommendLabel
({
recommendLabel
:
1
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
le
t
leadNewsList
:
any
=
res
.
data
||
[]
cons
t
leadNewsList
:
any
=
res
.
data
||
[]
if
(
leadNewsList
.
length
>=
2
)
{
if
(
leadNewsList
.
length
>=
2
)
{
le
t
leftList
=
leadNewsList
.
slice
(
0
,
Math
.
round
(
leadNewsList
.
length
/
2
))
cons
t
leftList
=
leadNewsList
.
slice
(
0
,
Math
.
round
(
leadNewsList
.
length
/
2
))
le
t
rightList
=
leadNewsList
.
slice
(
Math
.
round
(
leadNewsList
.
length
/
2
),
leadNewsList
.
length
)
cons
t
rightList
=
leadNewsList
.
slice
(
Math
.
round
(
leadNewsList
.
length
/
2
),
leadNewsList
.
length
)
resolve
({
resolve
({
leadLeftNews
:
leftList
,
leadLeftNews
:
leftList
,
leadRightNews
:
rightList
leadRightNews
:
rightList
...
@@ -160,10 +147,10 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -160,10 +147,10 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
PublicApi
.
getManageContentColumnAll
().
then
(
res
=>
{
PublicApi
.
getManageContentColumnAll
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
let
result
=
""
let
result
=
""
le
t
allColumn
=
res
.
data
cons
t
allColumn
=
res
.
data
if
(
allColumn
&&
allColumn
.
length
>
0
)
{
if
(
allColumn
&&
allColumn
.
length
>
0
)
{
let
labelList
=
allColumn
.
map
((
item
:
any
)
=>
item
.
name
)
let
labelList
=
allColumn
.
map
((
item
:
any
)
=>
item
.
name
)
le
t
showCount
=
4
cons
t
showCount
=
4
if
(
labelList
.
length
<=
showCount
)
{
if
(
labelList
.
length
<=
showCount
)
{
result
=
labelList
.
join
(
' | '
)
result
=
labelList
.
join
(
' | '
)
}
else
{
}
else
{
...
@@ -190,7 +177,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -190,7 +177,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
interactAdvertConfig
[
interactAdvertConfig
.
key
].
props
.
advertList
=
await
findSecondAdvertsByType
()
interactAdvertConfig
[
interactAdvertConfig
.
key
].
props
.
advertList
=
await
findSecondAdvertsByType
()
const
shopList
=
GlobalConfig
.
web
.
shopInfo
const
shopList
=
GlobalConfig
.
web
.
shopInfo
le
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
cons
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
...
@@ -200,17 +187,17 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -200,17 +187,17 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
let
initIndex
=
100
let
initIndex
=
100
let
floorLineConfig
:
any
=
{}
let
floorLineConfig
:
any
=
{}
le
t
floorLineKeys
:
any
=
[]
cons
t
floorLineKeys
:
any
=
[]
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
for
(
le
t
item
of
firstCategory
)
{
for
(
cons
t
item
of
firstCategory
)
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
let
floorLineConfigItem
=
{}
let
floorLineConfigItem
=
{}
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
le
t
FloorLine
=
{
cons
t
FloorLine
=
{
[
String
(
initIndex
+
1
)]:
{
[
String
(
initIndex
+
1
)]:
{
"componentName"
:
"FloorLine"
,
"componentName"
:
"FloorLine"
,
"props"
:
{
"props"
:
{
...
@@ -219,7 +206,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -219,7 +206,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
"childNodes"
:
[
String
(
initIndex
+
2
),
String
(
initIndex
+
3
)]
"childNodes"
:
[
String
(
initIndex
+
2
),
String
(
initIndex
+
3
)]
}
}
}
}
le
t
Horizontal1
=
{
cons
t
Horizontal1
=
{
[
String
(
initIndex
+
2
)]:
{
[
String
(
initIndex
+
2
)]:
{
"componentName"
:
"FloorLine.Horizontal"
,
"componentName"
:
"FloorLine.Horizontal"
,
"props"
:
{},
"props"
:
{},
...
@@ -227,7 +214,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -227,7 +214,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
},
},
}
}
le
t
Brand
=
{
cons
t
Brand
=
{
[
String
(
initIndex
+
3
)]:
{
[
String
(
initIndex
+
3
)]:
{
"componentName"
:
"FloorLine.Brand"
,
"componentName"
:
"FloorLine.Brand"
,
"props"
:
{
"props"
:
{
...
@@ -238,7 +225,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -238,7 +225,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
},
},
}
}
le
t
Category
=
{
cons
t
Category
=
{
[
String
(
initIndex
+
4
)]:
{
[
String
(
initIndex
+
4
)]:
{
"componentName"
:
"FloorLine.Category"
,
"componentName"
:
"FloorLine.Category"
,
"props"
:
{
"props"
:
{
...
@@ -250,7 +237,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -250,7 +237,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
},
},
}
}
le
t
Vertical1
=
{
cons
t
Vertical1
=
{
[
String
(
initIndex
+
5
)]:
{
[
String
(
initIndex
+
5
)]:
{
"componentName"
:
"FloorLine.Vertical"
,
"componentName"
:
"FloorLine.Vertical"
,
"props"
:
{},
"props"
:
{},
...
@@ -258,7 +245,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -258,7 +245,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
},
},
}
}
le
t
FloorHeader
=
{
cons
t
FloorHeader
=
{
[
String
(
initIndex
+
6
)]:
{
[
String
(
initIndex
+
6
)]:
{
"componentName"
:
"FloorLine.FloorHeader"
,
"componentName"
:
"FloorLine.FloorHeader"
,
"props"
:
{
"props"
:
{
...
@@ -270,7 +257,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -270,7 +257,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
},
},
}
}
le
t
Banner
=
{
cons
t
Banner
=
{
[
String
(
initIndex
+
7
)]:
{
[
String
(
initIndex
+
7
)]:
{
"componentName"
:
"FloorLine.Banner"
,
"componentName"
:
"FloorLine.Banner"
,
"props"
:
{
"props"
:
{
...
@@ -282,14 +269,14 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -282,14 +269,14 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
},
},
}
}
le
t
Horizontal2
=
{
cons
t
Horizontal2
=
{
[
String
(
initIndex
+
8
)]:
{
[
String
(
initIndex
+
8
)]:
{
"componentName"
:
"FloorLine.Horizontal"
,
"componentName"
:
"FloorLine.Horizontal"
,
"props"
:
{},
"props"
:
{},
"childNodes"
:
[
String
(
initIndex
+
9
),
String
(
initIndex
+
10
)]
"childNodes"
:
[
String
(
initIndex
+
9
),
String
(
initIndex
+
10
)]
},
},
}
}
le
t
Goods
=
{
cons
t
Goods
=
{
[
String
(
initIndex
+
9
)]:
{
[
String
(
initIndex
+
9
)]:
{
"componentName"
:
"FloorLine.Goods"
,
"componentName"
:
"FloorLine.Goods"
,
"props"
:
{
"props"
:
{
...
@@ -300,7 +287,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -300,7 +287,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
},
},
}
}
le
t
Shops
=
{
cons
t
Shops
=
{
[
String
(
initIndex
+
10
)]:
{
[
String
(
initIndex
+
10
)]:
{
"componentName"
:
"FloorLine.Shops"
,
"componentName"
:
"FloorLine.Shops"
,
"props"
:
{
"props"
:
{
...
@@ -317,7 +304,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -317,7 +304,7 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
}
}
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
FindMoreConfig
.
key
,
InformationConfig
.
key
,
FooterConfig
.
key
]
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
FindMoreConfig
.
key
,
InformationConfig
.
key
,
FooterConfig
.
key
]
le
t
config
=
{
cons
t
config
=
{
...
mallLayoutConfig
,
...
mallLayoutConfig
,
...
topBarConfig
,
...
topBarConfig
,
...
topAdvertConfig
,
...
topAdvertConfig
,
...
@@ -349,4 +336,4 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
...
@@ -349,4 +336,4 @@ const MallEdit: React.FC<MallEditPropsType> = (props) => {
)
:
<
Loading
/>
)
:
<
Loading
/>
}
}
export
default
MallEdit
export
default
MallEdit
\ No newline at end of file
src/pages/pageCustomized/preview/mallPreview/index.tsx
View file @
f5ede3d0
...
@@ -26,7 +26,7 @@ interface MallPreviewPropsType {
...
@@ -26,7 +26,7 @@ interface MallPreviewPropsType {
}
}
}
}
le
t
TemplateList
=
[
'science'
]
cons
t
TemplateList
=
[
'science'
]
const
MallPreview
:
React
.
FC
<
MallPreviewPropsType
>
=
(
props
)
=>
{
const
MallPreview
:
React
.
FC
<
MallPreviewPropsType
>
=
(
props
)
=>
{
const
{
query
:
{
id
,
template
}
}
=
props
.
location
const
{
query
:
{
id
,
template
}
}
=
props
.
location
...
@@ -45,11 +45,11 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -45,11 +45,11 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
const
findFirstAdvertsByType
=
()
=>
{
const
findFirstAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
1
type
:
1
}
}
//@ts-ignore
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -62,11 +62,11 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -62,11 +62,11 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
const
findSecondAdvertsByType
=
()
=>
{
const
findSecondAdvertsByType
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
:
id
,
templateId
:
id
,
type
:
2
type
:
2
}
}
//@ts-ignore
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplatePlatformFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -99,12 +99,11 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -99,12 +99,11 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
*/
*/
const
fetchCategoryById
=
(
categoryId
)
=>
{
const
fetchCategoryById
=
(
categoryId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
param
=
{
const
param
:
any
=
{
templateId
:
id
,
templateId
:
id
,
categoryId
categoryId
}
}
// @ts-ignore
PublicApi
.
getTemplatePlatformFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplatePlatformFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
resolve
(
res
.
data
)
...
@@ -113,30 +112,20 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -113,30 +112,20 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
})
})
}
}
const
fetchTmeplateInfo
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
//@ts-ignore
PublicApi
.
getTemplatePlatformFindMallHome
({
templateId
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
})
})
}
/**
/**
* 获取头条新闻
* 获取头条新闻
*/
*/
const
fetchLeadNews
=
()
=>
{
const
fetchLeadNews
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
//@ts-ignore
const
params
:
any
=
{
PublicApi
.
getManageContentInformationFindAllByRecommendLabel
({
recommendLabel
:
1
}).
then
(
res
=>
{
recommendLabel
:
1
}
PublicApi
.
getManageContentInformationFindAllByRecommendLabel
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
le
t
leadNewsList
:
any
=
res
.
data
||
[]
cons
t
leadNewsList
:
any
=
res
.
data
||
[]
if
(
leadNewsList
.
length
>=
2
)
{
if
(
leadNewsList
.
length
>=
2
)
{
le
t
leftList
=
leadNewsList
.
slice
(
0
,
Math
.
round
(
leadNewsList
.
length
/
2
))
cons
t
leftList
=
leadNewsList
.
slice
(
0
,
Math
.
round
(
leadNewsList
.
length
/
2
))
le
t
rightList
=
leadNewsList
.
slice
(
Math
.
round
(
leadNewsList
.
length
/
2
),
leadNewsList
.
length
)
cons
t
rightList
=
leadNewsList
.
slice
(
Math
.
round
(
leadNewsList
.
length
/
2
),
leadNewsList
.
length
)
resolve
({
resolve
({
leadLeftNews
:
leftList
,
leadLeftNews
:
leftList
,
leadRightNews
:
rightList
leadRightNews
:
rightList
...
@@ -161,10 +150,10 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -161,10 +150,10 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
PublicApi
.
getManageContentColumnAll
().
then
(
res
=>
{
PublicApi
.
getManageContentColumnAll
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
if
(
res
.
code
===
1000
)
{
let
result
=
""
let
result
=
""
le
t
allColumn
=
res
.
data
cons
t
allColumn
=
res
.
data
if
(
allColumn
&&
allColumn
.
length
>
0
)
{
if
(
allColumn
&&
allColumn
.
length
>
0
)
{
let
labelList
=
allColumn
.
map
((
item
:
any
)
=>
item
.
name
)
let
labelList
=
allColumn
.
map
((
item
:
any
)
=>
item
.
name
)
le
t
showCount
=
4
cons
t
showCount
=
4
if
(
labelList
.
length
<=
showCount
)
{
if
(
labelList
.
length
<=
showCount
)
{
result
=
labelList
.
join
(
' | '
)
result
=
labelList
.
join
(
' | '
)
}
else
{
}
else
{
...
@@ -191,7 +180,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -191,7 +180,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
interactAdvertConfig
[
interactAdvertConfig
.
key
].
props
.
advertList
=
await
findSecondAdvertsByType
()
interactAdvertConfig
[
interactAdvertConfig
.
key
].
props
.
advertList
=
await
findSecondAdvertsByType
()
const
shopList
=
GlobalConfig
.
web
.
shopInfo
const
shopList
=
GlobalConfig
.
web
.
shopInfo
le
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
cons
t
webMallInfo
=
shopList
.
filter
(
item
=>
item
.
environment
===
1
&&
item
.
type
===
1
)[
0
]
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
headerConfig
[
headerConfig
.
key
].
props
.
logoUrl
=
webMallInfo
.
logoUrl
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
topBarConfig
[
topBarConfig
.
key
].
props
.
shopname
=
webMallInfo
.
name
...
@@ -201,17 +190,17 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -201,17 +190,17 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
let
initIndex
=
100
let
initIndex
=
100
let
floorLineConfig
:
any
=
{}
let
floorLineConfig
:
any
=
{}
le
t
floorLineKeys
:
any
=
[]
cons
t
floorLineKeys
:
any
=
[]
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
for
(
le
t
item
of
firstCategory
)
{
for
(
cons
t
item
of
firstCategory
)
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
)
let
floorLineConfigItem
=
{}
let
floorLineConfigItem
=
{}
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
floorLineKeys
.
push
(
String
(
initIndex
+
1
))
le
t
FloorLine
=
{
cons
t
FloorLine
=
{
[
String
(
initIndex
+
1
)]:
{
[
String
(
initIndex
+
1
)]:
{
"componentName"
:
"FloorLine"
,
"componentName"
:
"FloorLine"
,
"props"
:
{
"props"
:
{
...
@@ -220,7 +209,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -220,7 +209,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
"childNodes"
:
[
String
(
initIndex
+
2
),
String
(
initIndex
+
3
)]
"childNodes"
:
[
String
(
initIndex
+
2
),
String
(
initIndex
+
3
)]
}
}
}
}
le
t
Horizontal1
=
{
cons
t
Horizontal1
=
{
[
String
(
initIndex
+
2
)]:
{
[
String
(
initIndex
+
2
)]:
{
"componentName"
:
"FloorLine.Horizontal"
,
"componentName"
:
"FloorLine.Horizontal"
,
"props"
:
{},
"props"
:
{},
...
@@ -228,7 +217,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -228,7 +217,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
},
},
}
}
le
t
Brand
=
{
cons
t
Brand
=
{
[
String
(
initIndex
+
3
)]:
{
[
String
(
initIndex
+
3
)]:
{
"componentName"
:
"FloorLine.Brand"
,
"componentName"
:
"FloorLine.Brand"
,
"props"
:
{
"props"
:
{
...
@@ -239,7 +228,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -239,7 +228,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
},
},
}
}
le
t
Category
=
{
cons
t
Category
=
{
[
String
(
initIndex
+
4
)]:
{
[
String
(
initIndex
+
4
)]:
{
"componentName"
:
"FloorLine.Category"
,
"componentName"
:
"FloorLine.Category"
,
"props"
:
{
"props"
:
{
...
@@ -251,7 +240,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -251,7 +240,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
},
},
}
}
le
t
Vertical1
=
{
cons
t
Vertical1
=
{
[
String
(
initIndex
+
5
)]:
{
[
String
(
initIndex
+
5
)]:
{
"componentName"
:
"FloorLine.Vertical"
,
"componentName"
:
"FloorLine.Vertical"
,
"props"
:
{},
"props"
:
{},
...
@@ -259,7 +248,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -259,7 +248,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
},
},
}
}
le
t
FloorHeader
=
{
cons
t
FloorHeader
=
{
[
String
(
initIndex
+
6
)]:
{
[
String
(
initIndex
+
6
)]:
{
"componentName"
:
"FloorLine.FloorHeader"
,
"componentName"
:
"FloorLine.FloorHeader"
,
"props"
:
{
"props"
:
{
...
@@ -271,7 +260,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -271,7 +260,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
},
},
}
}
le
t
Banner
=
{
cons
t
Banner
=
{
[
String
(
initIndex
+
7
)]:
{
[
String
(
initIndex
+
7
)]:
{
"componentName"
:
"FloorLine.Banner"
,
"componentName"
:
"FloorLine.Banner"
,
"props"
:
{
"props"
:
{
...
@@ -283,14 +272,14 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -283,14 +272,14 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
},
},
}
}
le
t
Horizontal2
=
{
cons
t
Horizontal2
=
{
[
String
(
initIndex
+
8
)]:
{
[
String
(
initIndex
+
8
)]:
{
"componentName"
:
"FloorLine.Horizontal"
,
"componentName"
:
"FloorLine.Horizontal"
,
"props"
:
{},
"props"
:
{},
"childNodes"
:
[
String
(
initIndex
+
9
),
String
(
initIndex
+
10
)]
"childNodes"
:
[
String
(
initIndex
+
9
),
String
(
initIndex
+
10
)]
},
},
}
}
le
t
Goods
=
{
cons
t
Goods
=
{
[
String
(
initIndex
+
9
)]:
{
[
String
(
initIndex
+
9
)]:
{
"componentName"
:
"FloorLine.Goods"
,
"componentName"
:
"FloorLine.Goods"
,
"props"
:
{
"props"
:
{
...
@@ -301,7 +290,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -301,7 +290,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
},
},
}
}
le
t
Shops
=
{
cons
t
Shops
=
{
[
String
(
initIndex
+
10
)]:
{
[
String
(
initIndex
+
10
)]:
{
"componentName"
:
"FloorLine.Shops"
,
"componentName"
:
"FloorLine.Shops"
,
"props"
:
{
"props"
:
{
...
@@ -318,7 +307,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -318,7 +307,7 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
}
}
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
FindMoreConfig
.
key
,
InformationConfig
.
key
,
FooterConfig
.
key
]
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
FindMoreConfig
.
key
,
InformationConfig
.
key
,
FooterConfig
.
key
]
le
t
config
=
{
cons
t
config
=
{
...
mallLayoutConfig
,
...
mallLayoutConfig
,
...
topBarConfig
,
...
topBarConfig
,
...
topAdvertConfig
,
...
topAdvertConfig
,
...
@@ -349,4 +338,4 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
...
@@ -349,4 +338,4 @@ const MallPreview: React.FC<MallPreviewPropsType> = (props) => {
)
:
<
Loading
/>
)
:
<
Loading
/>
}
}
export
default
MallPreview
export
default
MallPreview
\ No newline at end of file
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