Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wecom-sidebar
Project
Project
Details
Activity
Releases
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
wanghuihui
wecom-sidebar
Commits
e68fcf2b
Commit
e68fcf2b
authored
Mar 14, 2022
by
Aivs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:添加滚动下拉数据
parent
eaef2a7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
home.css
src/css/home.css
+3
-0
findCustom.tsx
src/pages/findCustom.tsx
+23
-4
No files found.
src/css/home.css
View file @
e68fcf2b
...
@@ -331,4 +331,7 @@
...
@@ -331,4 +331,7 @@
}
}
.honme
.ant-form-item-label
>
label
{
.honme
.ant-form-item-label
>
label
{
font-size
:
12px
!important
;
font-size
:
12px
!important
;
}
.scrollY
{
overflow-y
:
auto
;
}
}
\ No newline at end of file
src/pages/findCustom.tsx
View file @
e68fcf2b
...
@@ -13,6 +13,8 @@ const { TabPane } = Tabs;
...
@@ -13,6 +13,8 @@ const { TabPane } = Tabs;
const
Actions
:
React
.
FC
=
()
=>
{
const
Actions
:
React
.
FC
=
()
=>
{
const
[
msg
,
setMsg
]
=
useState
<
string
>
(
''
)
const
[
msg
,
setMsg
]
=
useState
<
string
>
(
''
)
const
[
scroll
,
setScroll
]
=
useState
<
any
>
(
undefined
)
const
[
cheight
,
setCheight
]
=
useState
<
number
>
(
0
)
const
[
columns
]
=
useState
<
any
>
([
const
[
columns
]
=
useState
<
any
>
([
{
{
title
:
'头像'
,
title
:
'头像'
,
...
@@ -118,8 +120,11 @@ const Actions: React.FC = () => {
...
@@ -118,8 +120,11 @@ const Actions: React.FC = () => {
let
data
:
any
=
{...
listQuery
}
let
data
:
any
=
{...
listQuery
}
data
.
wxId
=
res
.
userId
data
.
wxId
=
res
.
userId
const
baseItem
=
await
selectUserBase
(
data
)
const
baseItem
=
await
selectUserBase
(
data
)
console
.
log
(
baseItem
)
if
(
baseItem
.
data
.
data
){
if
(
baseItem
.
data
.
data
)
setListData
([...
baseItem
.
data
.
data
])
let
list
=
[...
listData
]
let
data
=
listQuery
.
page
===
1
?[...
baseItem
.
data
.
data
]:
list
.
concat
([...
baseItem
.
data
.
data
])
setListData
(
data
)
}
}
}
const
inputChange
=
(
e
:
any
)
=>
{
const
inputChange
=
(
e
:
any
)
=>
{
let
Query
=
{...
listQuery
}
let
Query
=
{...
listQuery
}
...
@@ -134,9 +139,23 @@ const Actions: React.FC = () => {
...
@@ -134,9 +139,23 @@ const Actions: React.FC = () => {
const
back
=
()
=>
{
const
back
=
()
=>
{
history
.
goBack
()
history
.
goBack
()
}
}
//监听滚动条滚动到距离底部50px,获取下一页数据
const
handleOnScroll
=
()
=>
{
if
(
scroll
)
{
const
contentScrollTop
=
scroll
.
scrollTop
;
//滚动条距离顶部
const
clientHeight
=
scroll
.
clientHeight
;
//可视区域
const
scrollHeight
=
scroll
.
scrollHeight
;
//滚动条内容的总高度
if
(
contentScrollTop
+
clientHeight
+
50
>=
scrollHeight
)
{
//滚动条距离底部50px拉去下一页数据
let
Query
=
{...
listQuery
}
Query
.
page
=
Query
.
page
+
1
setListQuery
(
Query
)
getUserBase
()
// 获取数据的方法
}
}
};
useEffect
(()
=>
{
useEffect
(()
=>
{
//getUserBase()
//getUserBase()
setCheight
(
window
.
innerHeight
-
120
)
//获取屏幕的高度-120,为content高度
},
[])
},
[])
return
(
return
(
...
@@ -152,7 +171,7 @@ const Actions: React.FC = () => {
...
@@ -152,7 +171,7 @@ const Actions: React.FC = () => {
tabs
.
map
((
item
:
any
,
idx
:
number
)
=>
tabs
.
map
((
item
:
any
,
idx
:
number
)
=>
<
TabPane
tab=
{
item
}
key=
{
idx
}
>
<
TabPane
tab=
{
item
}
key=
{
idx
}
>
<
div
className=
"content
"
>
<
div
className=
"content
scrollY"
style=
{
{
height
:
cheight
+
'px'
}
}
ref=
{
(
dom
)
=>
{
setScroll
(
dom
);}
}
onScrollCapture=
{
()
=>
handleOnScroll
()
}
>
{
idx
>
0
?
<
p
className=
'detailWord'
>
暂未开发
</
p
>:
listData
.
length
===
0
?
<
p
className=
'detailWord'
>
暂无数据,请输入查询条件
</
p
>:
listData
.
map
((
list
:
any
,
index
:
number
)
=>
{
idx
>
0
?
<
p
className=
'detailWord'
>
暂未开发
</
p
>:
listData
.
length
===
0
?
<
p
className=
'detailWord'
>
暂无数据,请输入查询条件
</
p
>:
listData
.
map
((
list
:
any
,
index
:
number
)
=>
<
div
className=
"customItem"
>
<
div
className=
"customItem"
>
<
div
className=
"flex spaceBetween w100"
>
<
div
className=
"flex spaceBetween w100"
>
...
...
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