提交 b60f961c authored 作者: 王绍森's avatar 王绍森

ListViewDiy组件修改

上级 9b7e659b
.listWrapper {
height: 100%;
:global {
.am-list-body {
background-color: transparent;
......
......@@ -14,6 +14,7 @@ import styles from './ListViewDiy.less';
// mountedSearch: 页面加载后是否查询
// ListSeparator: ListView组件的ListSeparator
// NoResult: 搜索结果为空时显示的内容
// responseCallback: 搜索结果回调函数
export class ListViewDiy extends Component {
constructor(props) {
super(props);
......@@ -58,7 +59,7 @@ export class ListViewDiy extends Component {
})
queryData = (isRefresh = true) => {
const { searchValues, } = this.props;
const { searchValues, responseCallback, } = this.props;
const { isLoading, isRefreshing, hasNextPage, pageSize, pageNo, } = this.state;
if (isLoading || isRefreshing || (!isRefresh && !hasNextPage)) return;
......@@ -84,7 +85,8 @@ export class ListViewDiy extends Component {
hasNextPage,
hasSearched: true,
};
})
});
responseCallback && responseCallback(res,)
}
}).finally(() => {
this.setState({ isLoading: false, isRefreshing: false, });
......@@ -92,7 +94,7 @@ export class ListViewDiy extends Component {
}
onEndReached = (event) => {
this.setState(({ pageNo }) => ({ pageNo: pageNo + 1}), this.queryData(false));
this.setState(({ pageNo }) => ({ pageNo: pageNo + 1}), () => this.queryData(false));
}
render() {
......@@ -123,7 +125,7 @@ export class ListViewDiy extends Component {
initialListSize={pageSize}
onEndReachedThreshold={10}
style={{
height,
height: '100%',
overflow: 'scroll',
}}
/>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论