Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
H5Public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
CI / CD
CI / CD
流水线
作业
日程
统计图
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
H5Public
Commits
4c8ee7e6
提交
4c8ee7e6
authored
7月 24, 2024
作者:
ChenShaonan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改ListViewDiy传参
上级
92ec6170
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
+6
-4
index.js
HighStateComponent/ListViewDiy/index.js
+6
-4
没有找到文件。
HighStateComponent/ListViewDiy/index.js
浏览文件 @
4c8ee7e6
...
@@ -37,6 +37,8 @@ export class ListViewDiy extends Component {
...
@@ -37,6 +37,8 @@ export class ListViewDiy extends Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
pageNo
:
void
0
,
// 学生列表页面设置班长后重新请求数据参数设置
pageSize
:
void
0
,
// 学生列表页面设置班长后重新请求数据参数设置
isLoading
:
false
,
// 管理footer组件里面的loading状态, 只有滚动到底部加载数据时才为ture, 不覆盖旧数据
isLoading
:
false
,
// 管理footer组件里面的loading状态, 只有滚动到底部加载数据时才为ture, 不覆盖旧数据
isRefreshing
:
false
,
// pullToRefresh组件的loading状态,只有搜索和下拉刷新时为true,覆盖旧数据
isRefreshing
:
false
,
// pullToRefresh组件的loading状态,只有搜索和下拉刷新时为true,覆盖旧数据
listViewData
:
new
ListView
.
DataSource
({
listViewData
:
new
ListView
.
DataSource
({
...
@@ -77,7 +79,7 @@ export class ListViewDiy extends Component {
...
@@ -77,7 +79,7 @@ export class ListViewDiy extends Component {
if
(
isLoading
||
isRefreshing
||
(
!
isRefresh
&&
!
hasNextPage
))
return
;
if
(
isLoading
||
isRefreshing
||
(
!
isRefresh
&&
!
hasNextPage
))
return
;
// 如果是刷新数据,只改变pullToRefresh组件的loading状态,否则改变footer的loading状态
// 如果是刷新数据,只改变pullToRefresh组件的loading状态,否则改变footer的loading状态
this
.
setState
({[
isRefresh
?
'isRefreshing'
:
'isLoading'
]:
true
});
this
.
setState
({
[
isRefresh
?
'isRefreshing'
:
'isLoading'
]:
true
});
const
params
=
{
const
params
=
{
pageNo
:
isRefresh
?
1
:
pageNo
,
pageNo
:
isRefresh
?
1
:
pageNo
,
...
@@ -108,7 +110,7 @@ export class ListViewDiy extends Component {
...
@@ -108,7 +110,7 @@ export class ListViewDiy extends Component {
}
}
onEndReached
=
(
event
)
=>
{
onEndReached
=
(
event
)
=>
{
this
.
setState
(({
pageNo
})
=>
({
pageNo
:
pageNo
+
1
}),
()
=>
this
.
queryData
(
false
));
this
.
setState
(({
pageNo
})
=>
({
pageNo
:
pageNo
+
1
}),
()
=>
this
.
queryData
(
false
));
}
}
componentWillUnmount
()
{
componentWillUnmount
()
{
...
@@ -134,7 +136,7 @@ export class ListViewDiy extends Component {
...
@@ -134,7 +136,7 @@ export class ListViewDiy extends Component {
renderHeader
=
{
renderHeader
}
renderHeader
=
{
renderHeader
}
renderFooter
=
{
renderFooter
}
renderFooter
=
{
renderFooter
}
renderRow
=
{(
rowData
,
sectionID
,
rowID
,
highlightRow
)
=>
renderRow
(
renderRow
=
{(
rowData
,
sectionID
,
rowID
,
highlightRow
)
=>
renderRow
(
rowData
,
sectionID
,
rowID
,
highlightRow
,
this
.
queryData
,
{
rowData
,
sectionID
,
rowID
,
highlightRow
,
queryData
:
this
.
queryData
}
)}
)}
renderSeparator
=
{
ListSeparator
}
renderSeparator
=
{
ListSeparator
}
scrollRenderAheadDistance
=
{
500
}
scrollRenderAheadDistance
=
{
500
}
...
@@ -146,7 +148,7 @@ export class ListViewDiy extends Component {
...
@@ -146,7 +148,7 @@ export class ListViewDiy extends Component {
pageSize
=
{
pageSize
}
pageSize
=
{
pageSize
}
initialListSize
=
{
pageSize
}
initialListSize
=
{
pageSize
}
onEndReachedThreshold
=
{
10
}
onEndReachedThreshold
=
{
10
}
contentContainerStyle
=
{{
height
:
'100%'
,
width
:
'100%'
}}
contentContainerStyle
=
{{
height
:
'100%'
,
width
:
'100%'
}}
style
=
{{
style
=
{{
height
:
'100%'
,
height
:
'100%'
,
overflow
:
'scroll'
,
overflow
:
'scroll'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论