Merge branches 'dev_Ysl', 'dev_Ysm' and 'dev_hjm_a' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

dev_oauth
杨树明 6 years ago
commit 9e01ccc7ee

@ -445,7 +445,7 @@ class CoursesBanner extends Component {
<style> <style>
{ {
` `
.tag-orangces .tag-name{ .tag-orangces .tag-names{
display: block; display: block;
width: auto; width: auto;
background-color: #FF6800; background-color: #FF6800;
@ -462,7 +462,7 @@ class CoursesBanner extends Component {
} }
</style> </style>
{excellent===true? {excellent===true?
<span className="tag-orangces fl"><span className="tag-name mt10 ml10">国家精品</span></span> <span className="tag-orangces fl"><span className="tag-names mt10 ml15">开发课程</span></span>
:""} :""}
<span className={"TabsWarp"}> <span className={"TabsWarp"}>
<CoursesListType <CoursesListType

@ -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 :

@ -100,12 +100,12 @@ class InfosBanner extends Component{
onClick={() => this.setState({moduleName: 'package'})} onClick={() => this.setState({moduleName: 'package'})}
to={`/users/${username}/package`}>众包</Link> to={`/users/${username}/package`}>众包</Link>
</li> </li>
{/* {((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)
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}> && <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'videos'})} onClick={() => this.setState({moduleName: 'videos'})}
to={`/users/${username}/videos`}>视频</Link> to={`/users/${username}/videos`}>视频</Link>
</li>} */} </li>}
</div> </div>
</div> </div>
</div> </div>

@ -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