|
@@ -3,7 +3,6 @@ import SpinBox from "@/components/Spin/SpinBox";
|
3
|
3
|
|
4
|
4
|
import { ScrollView } from '@tarojs/components';
|
5
|
5
|
import Taro from '@tarojs/taro';
|
6
|
|
-import usePrevious from '@/utils/hooks/usePrevious';
|
7
|
6
|
|
8
|
7
|
export default React.forwardRef((props, ref) => {
|
9
|
8
|
const {
|
|
@@ -24,7 +23,6 @@ export default React.forwardRef((props, ref) => {
|
24
|
23
|
const [list, setList] = useState([])
|
25
|
24
|
const pageRef = useRef({ current: 1 })
|
26
|
25
|
const [hasMore, setHasMore] = useState(false)
|
27
|
|
- const preParams = usePrevious(params)
|
28
|
26
|
|
29
|
27
|
// 滚动
|
30
|
28
|
const handleScrollToLower = (e) => {
|
|
@@ -49,7 +47,7 @@ export default React.forwardRef((props, ref) => {
|
49
|
47
|
setHasMore(pageInfo.current < pageInfo.pages)
|
50
|
48
|
|
51
|
49
|
if (onDataChange) {
|
52
|
|
- onDataChange(lst, { paramsChanged: preParams !== params })
|
|
50
|
+ onDataChange(lst, { paramsChanged: pageInfo.current === 1 })
|
53
|
51
|
}
|
54
|
52
|
|
55
|
53
|
pageRef.current = pageInfo
|