|
|
@@ -12,7 +12,7 @@ const Notification = () => {
|
|
|
const [state, setState] = useState({
|
|
|
loading: false,
|
|
|
message: [],
|
|
|
- hasMore: true,
|
|
|
+ hasMore: false,
|
|
|
current: 1,
|
|
|
pageSize: 10,
|
|
|
total: 0
|
|
|
@@ -29,22 +29,16 @@ const Notification = () => {
|
|
|
message: state.message.concat(message),
|
|
|
total,
|
|
|
loading: false,
|
|
|
+ hasMore: total > params.current * state.pageSize,
|
|
|
current: params?.current || 1
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
useEffect(() => {
|
|
|
- initData({ current: 1, pageSize: 10 })
|
|
|
+ initData({ current: 1 })
|
|
|
}, [])
|
|
|
const loadMoreData = () => {
|
|
|
- if (state.total === state.message?.length) {
|
|
|
- return
|
|
|
- }
|
|
|
- setState({
|
|
|
- loading: true,
|
|
|
- current: state.current + 1,
|
|
|
- pageSize: state.pageSize
|
|
|
- })
|
|
|
+ initData({ current: state.current + 1 })
|
|
|
}
|
|
|
return (
|
|
|
<div className="bg-hex-ffffff rounded-md px-6 pb-6">
|