|
|
@@ -42,7 +42,7 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
|
|
|
const { videoCategoryOptions } = useVideoCategoryOptions();
|
|
|
const [category, setCategory] = useState<string>();
|
|
|
const sort = VideoSortType.推荐指数;
|
|
|
- const PAGE_SIZE = 40;
|
|
|
+ const PAGE_SIZE = 10;
|
|
|
const [searchTerm, setSearchTerm] = useState<string>('');
|
|
|
const [currentPage, setCurrentPage] = useState(1);
|
|
|
const [total, setTotal] = useState(0);
|
|
|
@@ -115,6 +115,10 @@ const VideoSelectModal: React.FC<VideoSelectModalProps> = ({ visible, onClose, o
|
|
|
setVideoListAll(old => [...old, ...mapped.filter(v => !old.find(o => o.videoId === v.videoId))]);
|
|
|
setTotal(res.data.totalSize);
|
|
|
setHasMore(pageNum * PAGE_SIZE < res.data.totalSize);
|
|
|
+ // 初次/搜索后预取下一页,减少滚动等待
|
|
|
+ if (mode === 'replace' && pageNum * PAGE_SIZE < res.data.totalSize) {
|
|
|
+ getVideoList(pageNum + 1, 'append');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|