dev_unstable
hjm 6 years ago
parent 1ad925b264
commit 004524390f

@ -474,7 +474,7 @@ class MessagSub extends Component{
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
return window.open(`/managements/video_applies`); return window.open(`/managements/video_applies`);
}else if(item.tiding_type==="System"){ }else if(item.tiding_type==="System"){
return window.open(`/users/${item.trigger_user.login}/videos`); return window.open(`/users/${this.props.current_user.login}/videos`);
} }
return ''; return '';
default : default :

@ -40,7 +40,7 @@ function usePagination() {
onChange: onPageChange onChange: onPageChange
} }
} }
const PAGE_SIZE = 16 const PAGE_SIZE = 3
const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400 const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400 const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
let videoId = {}; let videoId = {};
@ -101,10 +101,14 @@ function InfoVideo (props) {
} }
function fetchReviewvideos() { function fetchReviewvideos() {
const fetchUrl = `/users/${username}/videos/review.json` const fetchUrl = `/users/${username}/videos/review.json`
const sorts = sortKey.split('-')
setLoading(true) setLoading(true)
axios.get(fetchUrl, { axios.get(fetchUrl, {
params: { params: {
per_page: 100 page: pageObj.current,
per_page: PAGE_SIZE,
sort_by: sorts[0],
sort_direction: sorts[1],
} }
}) })
.then((response) => { .then((response) => {
@ -119,8 +123,16 @@ function InfoVideo (props) {
} }
useEffect(() => { useEffect(() => {
fetchvideos() if (pageObj.current == 1) {
}, [pageObj.current, sortKey]) if (categoryObj.category == 'all') {
fetchvideos()
} else {
fetchReviewvideos()
}
} else {
pageObj.onChange(1)
}
}, [categoryObj.category])
useEffect(() => { useEffect(() => {
if (categoryObj.category == 'all') { if (categoryObj.category == 'all') {
@ -128,7 +140,7 @@ function InfoVideo (props) {
} else { } else {
fetchReviewvideos() fetchReviewvideos()
} }
}, [categoryObj.category]) }, [ pageObj.current, sortKey ])
useEffect(() => { useEffect(() => {
if (videoModalObj.visible == false) { if (videoModalObj.visible == false) {
@ -327,9 +339,9 @@ function InfoVideo (props) {
} }
{/* categoryObj.category == 'all' && */}
{ {
categoryObj.category == 'all' && count > PAGE_SIZE && count > PAGE_SIZE &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={count} pageSize={PAGE_SIZE} <Pagination showQuickJumper total={count} pageSize={PAGE_SIZE}
{...pageObj} {...pageObj}

@ -422,7 +422,7 @@ function VideoUploadList (props) {
</div> </div>
{/* windows video/* 不管用 TODO */} {/* windows video/* 不管用 TODO */}
<input type="file" id="fileUpload" style={{display: 'none'}} onChange={onUploadChange} <input type="file" id="fileUpload" style={{display: 'none'}} onChange={onUploadChange}
accept="video/*" accept=".flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"
></input> ></input>
</div> </div>
) )

Loading…
Cancel
Save