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
3e44c706
Commit
3e44c706
authored
Sep 27, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:渠道商城装修行情资讯数据
parent
5308c476
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
6 deletions
+89
-6
index.tsx
src/pages/editor/channelEdit/index.tsx
+61
-0
index.tsx
...ngsPanel/propsSettings/components/AdvertSetting/index.tsx
+1
-0
index.less
src/pages/lxMall/components/Information/index.less
+7
-0
index.tsx
src/pages/lxMall/components/Information/index.tsx
+17
-5
index.less
src/pages/lxMall/components/QuickNav/index.less
+2
-0
request.ts
src/utils/request.ts
+1
-1
No files found.
src/pages/editor/channelEdit/index.tsx
View file @
3e44c706
...
...
@@ -121,18 +121,78 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
})
}
/**
* 获取头条新闻
*/
const
fetchLeadNews
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
//@ts-ignore
PublicApi
.
getManageContentInformationFindAllByRecommendLabel
({
recommendLabel
:
1
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
leadNewsList
:
any
=
res
.
data
||
[]
if
(
leadNewsList
.
length
>=
2
)
{
let
leftList
=
leadNewsList
.
slice
(
0
,
Math
.
round
(
leadNewsList
.
length
/
2
))
let
rightList
=
leadNewsList
.
slice
(
Math
.
round
(
leadNewsList
.
length
/
2
),
leadNewsList
.
length
)
resolve
({
leadLeftNews
:
leftList
,
leadRightNews
:
rightList
})
}
else
{
resolve
({
leadNewsList
,
leadRightNews
:
[]
})
}
}
})
})
}
/**
* 获取全部栏目
*/
const
fetchAllColumn
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
PublicApi
.
getManageContentColumnAll
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
let
result
=
""
let
allColumn
=
res
.
data
if
(
allColumn
&&
allColumn
.
length
>
0
)
{
let
labelList
=
allColumn
.
map
((
item
:
any
)
=>
item
.
name
)
let
showCount
=
4
if
(
labelList
.
length
<=
showCount
)
{
result
=
labelList
.
join
(
' | '
)
}
else
{
labelList
=
labelList
.
slice
(
0
,
showCount
)
result
=
labelList
.
join
(
' | '
)
+
" ..."
}
}
resolve
(
result
)
}
})
})
}
const
getComponentsConfig
=
async
()
=>
{
// 导航栏
mainNavConfig
[
mainNavConfig
.
key
].
props
.
menuData
=
menuData
mainNavConfig
[
mainNavConfig
.
key
].
props
.
type
=
LAYOUT_TYPE
.
channel
mainNavConfig
[
mainNavConfig
.
key
].
props
.
categoryList
=
[]
// 一号位广告
bannerAdvertConfig
[
bannerAdvertConfig
.
key
].
props
.
advertList
=
await
findFirstAdvertsByType
()
// 二号位广告
serviceAdvertConfig
[
serviceAdvertConfig
.
key
].
props
.
advertList
=
await
findSecondAdvertsByType
()
//店铺信息
AboutUsConfig
[
AboutUsConfig
.
key
].
props
.
shopInfo
=
await
fetchShopInfo
()
// 行情资讯
InformationConfig
[
InformationConfig
.
key
].
props
.
newsList
=
await
fetchLeadNews
()
InformationConfig
[
InformationConfig
.
key
].
props
.
allColumn
=
await
fetchAllColumn
()
let
initIndex
=
100
let
floorLineConfig
:
any
=
{}
let
floorLineKeys
:
any
=
[]
...
...
@@ -183,6 +243,7 @@ const ChannelEdit: React.FC<ChannelEditPropsType> = (props) => {
}
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
serviceAdvertConfig
.
key
,
CommonTitle2Config
.
key
,
AboutUsConfig
.
key
,
InformationConfig
.
key
,
FooterConfig
.
key
]
let
config
=
{
...
mallLayoutConfig
,
...
topBarConfig
,
...
...
src/pages/editor/settingsPanel/propsSettings/components/AdvertSetting/index.tsx
View file @
3e44c706
...
...
@@ -296,6 +296,7 @@ const AdvertSetting: React.FC<AdvertSettingPropsType> = forwardRef((props, ref)
<
UploadImage
imgUrl=
{
item
.
picUrl
}
size=
{
getImgSize
()
}
fileMaxSize=
{
500
}
onChange=
{
(
val
)
=>
handleKeyChange
(
val
,
item
.
sort
,
'picUrl'
)
}
/>
</
div
>
...
...
src/pages/lxMall/components/Information/index.less
View file @
3e44c706
...
...
@@ -9,6 +9,7 @@
border: 1px solid rgba(245, 245, 245, 1);
.information_header {
display: flex;
height: 60px;
line-height: 60px;
padding-left: 20px;
...
...
@@ -24,6 +25,12 @@
font-size: 12px;
color: #909399;
}
.more_link {
color: #999999;
padding-right: 20px;
margin-left: auto;
}
}
}
...
...
src/pages/lxMall/components/Information/index.tsx
View file @
3e44c706
...
...
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetManageContentColumnAllResponse
}
from
'@/services/PassApi'
import
ImageBox
from
'@/components/ImageBox'
import
{
RightOutlined
}
from
'@ant-design/icons'
import
moment
from
'moment'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
styles
from
'./index.less'
...
...
@@ -97,12 +98,24 @@ const Information: React.FC<InformationPropsType> = (props) => {
}
}
const
toMoreLink
=
()
=>
{
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
channel
:
return
`/channelmall/infomation?channelId=
${
shopUrlParam
}
`
case
LAYOUT_TYPE
.
ichannel
:
return
`/ichannelmall/infomation?channelId=
${
shopUrlParam
}
`
default
:
return
`/infomation`
}
}
return
(
<
div
className=
{
styles
.
information
}
>
<
div
className=
{
styles
.
information_container
}
>
<
div
className=
{
styles
.
information_header
}
>
<
span
>
行情资讯
</
span
>
<
label
>
{
renderColumns
()
}
</
label
>
<
a
href=
{
toMoreLink
()
}
className=
{
styles
.
more_link
}
>
更多好货
<
RightOutlined
/></
a
>
</
div
>
<
div
className=
{
styles
.
information_list
}
>
...
...
@@ -113,7 +126,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
<>
{
index
===
0
?
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
>
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`information_recommand_${item.id}`
}
>
<
div
className=
{
styles
.
information_recommand
}
>
<
div
className=
{
styles
.
information_recommand_img
}
>
<
ImageBox
width=
{
220
}
height=
{
146
}
imgUrl=
{
item
.
imageUrl
}
/>
...
...
@@ -126,7 +139,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</
div
>
</
a
>
)
:
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
>
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`news_list_item_${item.id}`
}
>
<
div
className=
{
styles
.
news_list_item
}
>
<
div
className=
{
styles
.
news_list_item_title
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
styles
.
news_list_item_date
}
>
{
(
moment
(
item
.
createTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
))
}
</
div
>
...
...
@@ -134,7 +147,6 @@ const Information: React.FC<InformationPropsType> = (props) => {
</
a
>
)
}
</>
))
}
...
...
@@ -147,7 +159,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
<>
{
index
===
0
?
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
>
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`information_recommand_${index}`
}
>
<
div
className=
{
styles
.
information_recommand
}
>
<
div
className=
{
styles
.
information_recommand_img
}
>
<
ImageBox
width=
{
220
}
height=
{
146
}
imgUrl=
{
item
.
imageUrl
}
/>
...
...
@@ -160,7 +172,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</
div
>
</
a
>
)
:
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
>
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`news_list_item_${index}`
}
>
<
div
className=
{
styles
.
news_list_item
}
>
<
div
className=
{
styles
.
news_list_item_title
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
styles
.
news_list_item_date
}
>
{
(
moment
(
item
.
createTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
))
}
</
div
>
...
...
src/pages/lxMall/components/QuickNav/index.less
View file @
3e44c706
...
...
@@ -111,6 +111,7 @@
&_item {
flex: 1;
text-align: center;
cursor: pointer;
&_count {
font-size: 20px;
...
...
@@ -165,6 +166,7 @@
height: 80px;
align-items: center;
justify-content: center;
cursor: pointer;
&.bb {
border-bottom: 1px solid #F4F5F7;
...
...
src/utils/request.ts
View file @
3e44c706
...
...
@@ -66,7 +66,7 @@ const baseRequest = extend({
timeout
:
30
*
1000
,
headers
:
defaultHeaders
,
credentials
:
'include'
,
// 默认请求是否带上cookie
//
errorHandler
errorHandler
});
const
cache
=
{}
...
...
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