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
linweijiong
jinfa-platform
Commits
22991f93
Commit
22991f93
authored
Oct 19, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:企业商城搜索部分滚动置顶
parent
62482e2d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
14 deletions
+35
-14
index.less
src/pages/lxMall/components/Header/index.less
+1
-1
index.tsx
src/pages/lxMall/components/Header/index.tsx
+25
-4
index.tsx
src/pages/lxMall/components/Information/index.tsx
+9
-9
No files found.
src/pages/lxMall/components/Header/index.less
View file @
22991f93
...
...
@@ -19,7 +19,7 @@
top: 0;
left: 0;
z-index: 999;
border-bottom: 1px solid var(--mall_main_color);
//
border-bottom: 1px solid var(--mall_main_color);
padding-top: 0;
transition: all .5s;
...
...
src/pages/lxMall/components/Header/index.tsx
View file @
22991f93
...
...
@@ -19,11 +19,32 @@ const Header: React.FC<HeaderPropsType> = (props) => {
const
[
count
,
setCount
]
=
useState
<
number
>
(
0
)
const
{
search
}
=
history
.
location
.
query
let
handleScroll
=
()
=>
{
const
scrollTop
=
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
const
floatSearch
=
document
.
getElementById
(
"floatSearch"
)
if
(
scrollTop
>
500
)
{
if
(
!
hasClass
(
floatSearch
.
classList
,
'show'
))
{
floatSearch
.
classList
.
add
(
styles
.
show
)
}
}
else
{
if
(
hasClass
(
floatSearch
.
classList
,
'show'
))
{
floatSearch
.
classList
.
remove
(
styles
.
show
)
}
}
}
const
hasClass
=
(
list
,
className
)
=>
{
let
result
=
false
list
&&
list
.
forEach
(
item
=>
{
if
(
item
&&
item
.
indexOf
(
className
)
>
-
1
)
{
result
=
true
}
})
return
result
}
useEffect
(()
=>
{
// setTimeout(() => {
// let floatSearch = document.getElementById("floatSearch")
// floatSearch.classList.add(styles.show)
// }, 4000);
window
.
addEventListener
(
'scroll'
,
handleScroll
)
},
[])
useEffect
(()
=>
{
...
...
src/pages/lxMall/components/Information/index.tsx
View file @
22991f93
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
,
{
useEffect
,
useState
,
Fragment
}
from
'react'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetManageContentColumnAllResponse
}
from
'@/services/PassApi'
import
ImageBox
from
'@/components/ImageBox'
...
...
@@ -123,10 +123,10 @@ const Information: React.FC<InformationPropsType> = (props) => {
<
div
className=
{
styles
.
information_list_item_body
}
>
{
(
leadLeftNews
&&
leadLeftNews
.
length
>
0
)
&&
leadLeftNews
.
map
((
item
,
index
)
=>
index
<=
3
&&
(
<>
<
Fragment
key=
{
`news_list_item_left_${item.id}`
}
>
{
index
===
0
?
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`information_recommand_${item.id}`
}
>
<
a
href=
{
toDetailLink
(
item
.
id
)
}
>
<
div
className=
{
styles
.
information_recommand
}
>
<
div
className=
{
styles
.
information_recommand_img
}
>
<
ImageBox
width=
{
220
}
height=
{
146
}
imgUrl=
{
item
.
imageUrl
}
/>
...
...
@@ -139,7 +139,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</
div
>
</
a
>
)
:
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`news_list_item_${item.id}`
}
>
<
a
href=
{
toDetailLink
(
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
>
...
...
@@ -147,7 +147,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</
a
>
)
}
</>
</
Fragment
>
))
}
</
div
>
...
...
@@ -156,10 +156,10 @@ const Information: React.FC<InformationPropsType> = (props) => {
<
div
className=
{
styles
.
information_list_item_body
}
>
{
(
leadRightNews
&&
leadRightNews
.
length
>
0
)
&&
leadRightNews
.
map
((
item
,
index
)
=>
index
<=
3
&&
(
<>
<
Fragment
key=
{
`information_recommand_right_${item.id}`
}
>
{
index
===
0
?
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`information_recommand_${index}`
}
>
<
a
href=
{
toDetailLink
(
item
.
id
)
}
>
<
div
className=
{
styles
.
information_recommand
}
>
<
div
className=
{
styles
.
information_recommand_img
}
>
<
ImageBox
width=
{
220
}
height=
{
146
}
imgUrl=
{
item
.
imageUrl
}
/>
...
...
@@ -172,7 +172,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</
div
>
</
a
>
)
:
(
<
a
href=
{
toDetailLink
(
item
.
id
)
}
key=
{
`news_list_item_${index}`
}
>
<
a
href=
{
toDetailLink
(
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
>
...
...
@@ -180,7 +180,7 @@ const Information: React.FC<InformationPropsType> = (props) => {
</
a
>
)
}
</>
</
Fragment
>
))
}
</
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