diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js
index a6acc2081..356cd84cf 100644
--- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js
+++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js
@@ -445,7 +445,7 @@ class CoursesBanner extends Component {
{excellent===true?
- 国家精品
+ 开发课程
:""}
this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包
- {/* {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
+ {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&&
this.setState({moduleName: 'videos'})}
to={`/users/${username}/videos`}>视频
- } */}
+ }
diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js
index 2f251b583..ca2c11740 100644
--- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js
+++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.js
@@ -40,7 +40,7 @@ function usePagination() {
onChange: onPageChange
}
}
-const PAGE_SIZE = 16
+const PAGE_SIZE = 3
const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
let videoId = {};
@@ -101,10 +101,14 @@ function InfoVideo (props) {
}
function fetchReviewvideos() {
const fetchUrl = `/users/${username}/videos/review.json`
+ const sorts = sortKey.split('-')
setLoading(true)
axios.get(fetchUrl, {
params: {
- per_page: 100
+ page: pageObj.current,
+ per_page: PAGE_SIZE,
+ sort_by: sorts[0],
+ sort_direction: sorts[1],
}
})
.then((response) => {
@@ -119,8 +123,16 @@ function InfoVideo (props) {
}
useEffect(() => {
- fetchvideos()
- }, [pageObj.current, sortKey])
+ if (pageObj.current == 1) {
+ if (categoryObj.category == 'all') {
+ fetchvideos()
+ } else {
+ fetchReviewvideos()
+ }
+ } else {
+ pageObj.onChange(1)
+ }
+ }, [categoryObj.category])
useEffect(() => {
if (categoryObj.category == 'all') {
@@ -128,7 +140,7 @@ function InfoVideo (props) {
} else {
fetchReviewvideos()
}
- }, [categoryObj.category])
+ }, [ pageObj.current, sortKey ])
useEffect(() => {
if (videoModalObj.visible == false) {
@@ -327,9 +339,9 @@ function InfoVideo (props) {
}
-
+ {/* categoryObj.category == 'all' && */}
{
- categoryObj.category == 'all' && count > PAGE_SIZE &&
+ count > PAGE_SIZE &&
)