Merge branch 'dev_aliyun' into dev_daiao

dev_daiao
daiao 5 years ago
commit 977bc3bb1a

@ -1503,7 +1503,7 @@ class PersonModal extends Component {
color: "#D0021B", color: "#D0021B",
fontSize: "12px", fontSize: "12px",
marginTop: "9px" marginTop: "9px"
}}>战队导师为{GetenrollmentAPI.teacher_staff.minimum}-{GetenrollmentAPI.teacher_staff.maximum},{Thecurrentnumber}</p> }}>导师{GetenrollmentAPI.teacher_staff.minimum}-{GetenrollmentAPI.teacher_staff.maximum},{Thecurrentnumber}</p>
: "" : ""
) : ) :
@ -1518,7 +1518,7 @@ class PersonModal extends Component {
color: "#D0021B", color: "#D0021B",
fontSize: "12px", fontSize: "12px",
marginTop: "9px" marginTop: "9px"
}}>战队队员{GetenrollmentAPI.member_staff.minimum}-{GetenrollmentAPI.member_staff.maximum},{Thecurrentnumberstu}</p> }}>战队成员需{GetenrollmentAPI.member_staff.minimum}-{GetenrollmentAPI.member_staff.maximum},{Thecurrentnumberstu}</p>
: "" : ""
) : ) :
@ -1551,4 +1551,4 @@ class PersonModal extends Component {
} }
} }
export default PersonModal; export default PersonModal;

@ -160,44 +160,7 @@ class Statistics extends Component{
derivefun=(url)=>{ derivefun=(url)=>{
let{group_ids}=this.state; let{group_ids}=this.state;
let data={ this.props.slowDownload(`${url}?group_id=${group_ids}`);
group_id:group_ids
}
axios.get(url,{params:
data,
paramsSerializer: function(params) {
return qs.stringify(params, {arrayFormat: 'brackets'})
}
}).then((response)=>{
if(response === undefined){
return
}
if(response.data.status&&response.data.status===-1){
this.props.showNotification(response.data.message);
}else if(response.data.status&&response.data.status===-2){
// if(response.data.message === "100"){
// // 已超出文件导出的上限数量100 ),建议:
//
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
this.props.showNotification(response.data.message);
}else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
this.props.slowDownload(url);
}
}).catch((error) => {
console.log(error)
});
} }

@ -148,7 +148,7 @@ class Infos extends Component{
}).catch((error)=>{ }).catch((error)=>{
console.log(error) console.log(error)
}) })
} }
changeType=(e)=>{ changeType=(e)=>{
this.setState({ this.setState({
@ -165,7 +165,7 @@ class Infos extends Component{
axios.post(url).then((result)=>{ axios.post(url).then((result)=>{
if(result){ if(result){
// this.setState( // this.setState(
// (prevState) => ({ // (prevState) => ({
// data : update(prevState.data, {attendance_signed: {$set: true} }) // data : update(prevState.data, {attendance_signed: {$set: true} })
// }) // })
// ) // )
@ -225,7 +225,7 @@ class Infos extends Component{
} }
render(){ render(){
let { let {
data , data ,
is_edit, is_edit,
sign, sign,
@ -243,7 +243,7 @@ class Infos extends Component{
currentLogin = this.props.current_user.login; currentLogin = this.props.current_user.login;
} }
const _commonProps = { const _commonProps = {
is_current: isCurrent, is_current: isCurrent,
login: currentLogin login: currentLogin
} }
return( return(
@ -254,16 +254,16 @@ class Infos extends Component{
{ {
isRenders && <Trialapplication {...this.props} {...this.state} Cancel={() => this.cancelModulationModels()}/> isRenders && <Trialapplication {...this.props} {...this.state} Cancel={() => this.cancelModulationModels()}/>
} }
<InfosBanner <InfosBanner
{...this.props} {...this.props}
{...this.state} {...this.state}
{..._commonProps} {..._commonProps}
signFor={this.signFor} signFor={this.signFor}
followPerson={this.followPerson} followPerson={this.followPerson}
></InfosBanner> ></InfosBanner>
<Switch {...this.props}> <Switch {...this.props}>
{/* --------------------------------------------------------------------- */} {/* --------------------------------------------------------------------- */}
{/* 题库 */} {/* 题库 */}
<Route exact path="/users/:username/topics/:topicstype" <Route exact path="/users/:username/topics/:topicstype"
@ -274,8 +274,8 @@ class Infos extends Component{
{/* 课堂 */} {/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */} {/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/courses" <Route exact path="/users/:username/courses"
render={ render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps}/>) (props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps}/>)
} }
></Route> ></Route>
@ -287,7 +287,7 @@ class Infos extends Component{
} }
></Route> ></Route>
{/* 实训课程 */} {/* 实践课程 */}
<Route exact path="/users/:username/paths" <Route exact path="/users/:username/paths"
render={ render={
(props) => (<InfosPath {...this.props} {...props} {...this.state} {..._commonProps}/>) (props) => (<InfosPath {...this.props} {...props} {...this.state} {..._commonProps}/>)
@ -317,17 +317,16 @@ class Infos extends Component{
></Route> ></Route>
<Route exact path="/users/:username"
<Route exact path="/users/:username" render={
render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps}/>) (props) => (<InfosCourse {...this.props} {...props} {...this.state} {..._commonProps}/>)
} }
></Route> ></Route>
</Switch> </Switch>
</div> </div>
) )
} }
} }
// CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC)) // CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC))
export default (Infos) ; export default (Infos) ;

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin} from 'antd'; import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../../Loading'; import Loading from '../../../Loading';
import axios from 'axios'; import axios from 'axios';
@ -20,7 +20,8 @@ class InfosCourse extends Component{
status:undefined, status:undefined,
page:1, page:1,
per_page:16, per_page:16,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined, totalCount:undefined,
data:undefined, data:undefined,
isSpin:false isSpin:false
@ -31,27 +32,35 @@ class InfosCourse extends Component{
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
let{category,status,page}=this.state; let {category, status, page, sort_by, sort_direction} = this.state;
this.getCourses(category,status,page); this.getCourses(category, status, page, sort_by, sort_direction);
} }
getCourses=(category,status,page)=>{ getCourses = (category, status, page, sort_by, sort_direction) => {
let url=`/users/${this.props.match.params.username}/courses.json`; let url=`/users/${this.props.match.params.username}/courses.json`;
axios.get((url),{params:{ axios.get((url),{params:{
category, category,
status, status,
page, page,
sort_by,
sort_direction,
per_page: this.props.is_current && category && page ==1?17:16 per_page: this.props.is_current && category && page ==1?17:16
}}).then((result)=>{ }}).then((result)=>{
if(result){ if(result){
console.log("请求成功");
this.setState({ this.setState({
totalCount:result.data.count, totalCount:result.data.count,
data:result.data, data:result.data,
sort_direction: sort_direction,
sort_by: sort_by,
isSpin:false isSpin:false
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
this.setState({
isSpin: false
})
}) })
} }
@ -92,6 +101,27 @@ class InfosCourse extends Component{
} }
} }
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, 1, sort_by, "desc");
}
updatedlists(sort_direction, i) {
// console.log("updatedlistssort_direction");
// console.log(sort_direction);
// console.log(i);
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
render(){ render(){
let{ let{
category, category,
@ -99,11 +129,25 @@ class InfosCourse extends Component{
page, page,
data, data,
totalCount, totalCount,
isSpin isSpin,
sort_by,
sort_direction
} = this.state; } = this.state;
let is_current=this.props.is_current; let is_current=this.props.is_current;
// console.log(this.props.current_user&&this.props.current_user.user_identity==="学生") // console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
最新动态
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_at")}>
最新创建
</Menu.Item>
</Menu>
);
return( return(
<div className="educontent"> <div className="educontent">
<Spin size="large" spinning={isSpin}> <Spin size="large" spinning={isSpin}>
@ -113,17 +157,73 @@ class InfosCourse extends Component{
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li> <li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div> </div>
{ {
is_current && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE"> <div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li> <li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>正在进行</a></li> <li className={status=="processing" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("processing")}>正在进行</a></li>
<li className={status=="end" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("end")}>已结束</a></li> <li className={status=="end" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("end")}>已结束</a></li>
</div> </div>
} }
<p className="pl25 pr25 clearfix font-12 mb20 mt20"> <p className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"课堂"}</span> <span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"课堂"}</span>
<span className="fr color-grey-9">时间最新</span> <sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc", 1)}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc", 2)}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '最新创建' : ""}</span>
</span>
</Dropdown>
</p> </p>
<style>
{
`
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
`
}
</style>
<div className="square-list clearfix"> <div className="square-list clearfix">
{/* 289 */} {/* 289 */}
{ {
@ -138,7 +238,7 @@ class InfosCourse extends Component{
return( return(
<div className="square-Item" onClick={()=>this.turnToCourses(`${item.first_category_url}`,item.can_visited)} style={{"cursor": "pointer",height:"289px"}}> <div className="square-Item" onClick={()=>this.turnToCourses(`${item.first_category_url}`,item.can_visited)} style={{"cursor": "pointer",height:"289px"}}>
{ {
item.is_public == 1 && item.is_public == 1 &&
<React.Fragment> <React.Fragment>
<div className={key == 0 ?"publicpart orangeBlack":"publicpart"}></div> <div className={key == 0 ?"publicpart orangeBlack":"publicpart"}></div>
<span className="smalltrangle"></span> <span className="smalltrangle"></span>
@ -152,7 +252,7 @@ class InfosCourse extends Component{
<p className="font-14 color-white">非成员不能访问</p> <p className="font-14 color-white">非成员不能访问</p>
</div>:"" </div>:""
} }
<div className="substance"> <div className="substance">
<p className="subName font-16"> <p className="subName font-16">
<span>{item.name}</span> <span>{item.name}</span>
@ -171,14 +271,14 @@ class InfosCourse extends Component{
</span>:""} </span>:""}
{ {
item.members_count > 0 && item.members_count > 0 &&
<Tooltip placement="bottom" title="成员"> <Tooltip placement="bottom" title="成员">
<span className="fl ml10 mr10 squareIconSpan"> <span className="fl ml10 mr10 squareIconSpan">
<i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span> <i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span>
</Tooltip> </Tooltip>
} }
{ {
item.homework_commons_count > 0 && item.homework_commons_count > 0 &&
<Tooltip placement="bottom" title="作业"> <Tooltip placement="bottom" title="作业">
<span className="fl ml10 mr10 squareIconSpan"> <span className="fl ml10 mr10 squareIconSpan">
<i className="iconfont icon-zuoye fl mr3" data-tip-down="作业"></i>{item.homework_commons_count}</span> <i className="iconfont icon-zuoye fl mr3" data-tip-down="作业"></i>{item.homework_commons_count}</span>
@ -199,7 +299,7 @@ class InfosCourse extends Component{
} }
</div> </div>
{ {
totalCount > 15 && totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div> </div>
@ -209,4 +309,4 @@ class InfosCourse extends Component{
) )
} }
} }
export default InfosCourse; export default InfosCourse;

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination, Spin} from 'antd'; import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../../Loading'; import Loading from '../../../Loading';
import NoneData from '../../courses/coursesPublic/NoneData' import NoneData from '../../courses/coursesPublic/NoneData'
@ -19,11 +19,11 @@ class InfosPath extends Component{
this.state={ this.state={
category:undefined, category:undefined,
page:1, page:1,
sort_by:'time',
status:undefined, status:undefined,
per_page:16, per_page:16,
isSpin:false, isSpin:false,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined, totalCount:undefined,
data:undefined data:undefined
} }
@ -33,28 +33,34 @@ class InfosPath extends Component{
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
let{category,status,sort_by,page,per_page}=this.state; let {category, status, sort_by, page, per_page, sort_direction} = this.state;
this.getCourses(category,status,sort_by,page,per_page); this.getCourses(category, status, sort_by, page, sort_direction);
} }
getCourses=(category,status,sort_by,page,per_page)=>{ getCourses = (category, status, sort_by, page, sort_direction) => {
let url=`/users/${this.props.match.params.username}/subjects.json`; let url=`/users/${this.props.match.params.username}/subjects.json`;
axios.get((url),{params:{ axios.get((url),{params:{
category, category,
status, status,
sort_by, sort_by,
page, page,
sort_direction,
per_page:this.props.is_current && category && page ==1?17:16 per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{ }}).then((result)=>{
if(result){ if(result){
this.setState({ this.setState({
totalCount:result.data.count, totalCount:result.data.count,
data:result.data, data:result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false isSpin:false
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
this.setState({
isSpin: false
})
}) })
} }
@ -66,18 +72,18 @@ class InfosPath extends Component{
page:1, page:1,
isSpin:true isSpin:true
}) })
let{sort_by}=this.state; let {sort_by, sort_direction} = this.state;
this.getCourses(cate,undefined,sort_by,1); this.getCourses(cate, undefined, sort_by, 1, sort_direction);
} }
// 切换状态 // 切换状态
changeStatus=(status)=>{ changeStatus=(status)=>{
let{category,sort_by}=this.state; let {category, sort_by, sort_direction} = this.state;
this.setState({ this.setState({
status, status,
page:1, page:1,
isSpin:true isSpin:true
}) })
this.getCourses(category,status,sort_by,1); this.getCourses(category, status, sort_by, 1, sort_direction);
} }
//切换页数 //切换页数
changePage=(page)=>{ changePage=(page)=>{
@ -85,8 +91,8 @@ class InfosPath extends Component{
page, page,
isSpin:true isSpin:true
}) })
let{category,sort_by,status}=this.state; let {category, sort_by, status, sort_direction} = this.state;
this.getCourses(category,status,sort_by,page); this.getCourses(category, status, sort_by, page, sort_direction);
} }
// 进入课堂 // 进入课堂
@ -101,15 +107,38 @@ class InfosPath extends Component{
sort_by:sort, sort_by:sort,
isSpin:true isSpin:true
}) })
let{category,status,page}=this.state; let {category, status, page, sort_direction} = this.state;
this.getCourses(category,status,sort,page); this.getCourses(category, status, sort, page, sort_direction);
}
//切换种类
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, sort_by, 1, "desc");
}
//排序
updatedlists(sort_direction) {
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
} }
render(){ render(){
let{ let{
category, category,
status, status,
sort_by, sort_by,
sort_direction,
page, page,
data, data,
totalCount, totalCount,
@ -117,6 +146,17 @@ class InfosPath extends Component{
} = this.state; } = this.state;
let isStudent = this.props.isStudent(); let isStudent = this.props.isStudent();
let is_current=this.props.is_current; let is_current=this.props.is_current;
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
最近更新
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_at")}>
最新创建
</Menu.Item>
</Menu>
);
return( return(
<div className="educontent"> <div className="educontent">
<Spin size="large" spinning={isSpin}> <Spin size="large" spinning={isSpin}>
@ -142,10 +182,65 @@ class InfosPath extends Component{
<li className={status=="finished" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("finished")}>已完成</a></li> <li className={status=="finished" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("finished")}>已完成</a></li>
</div> </div>
} }
<div className="pl25 pr25 clearfix font-12 mb20 mt20"> <div className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实践课程"}</span> <span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实践课程"}</span>
<span className="fr color-grey-9">时间最新</span> <sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最近更新' : sort_by === "created_at" ? '最新创建' : ""}</span>
</span>
</Dropdown>
</div> </div>
<style>
{
`
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
`
}
</style>
<div className="square-list clearfix"> <div className="square-list clearfix">
{/* 295 */} {/* 295 */}
{ {
@ -163,7 +258,7 @@ class InfosPath extends Component{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span> item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/>*/} {/*<img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/>*/}
</div> </div>
} }
<a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)}/></a> <a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)}/></a>
<div className="square-main"> <div className="square-main">
<p className="task-hide"> <p className="task-hide">
@ -190,7 +285,7 @@ class InfosPath extends Component{
} }
</div> </div>
{ {
totalCount > 15 && totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div> </div>
@ -200,4 +295,4 @@ class InfosPath extends Component{
) )
} }
} }
export default InfosPath; export default InfosPath;

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Pagination,Spin} from 'antd'; import {Tooltip, Pagination, Spin, Dropdown, Menu} from 'antd';
import axios from 'axios'; import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData' import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
@ -16,7 +16,8 @@ class InfosProject extends Component{
status:undefined, status:undefined,
page:1, page:1,
per_page:16, per_page:16,
sort_by: "updated_on",
sort_direction: "desc",
totalCount:undefined, totalCount:undefined,
data:undefined, data:undefined,
isSpin:false isSpin:false
@ -27,16 +28,18 @@ class InfosProject extends Component{
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
let{category,status,page}=this.state; let {category, status, page, sort_by, sort_direction} = this.state;
this.getCourses(category,status,page); this.getCourses(category, status, page, sort_by, sort_direction);
} }
getCourses=(category,status,page)=>{ getCourses = (category, status, page, sort_by, sort_direction) => {
let url=`/users/${this.props.match.params.username}/projects.json`; let url=`/users/${this.props.match.params.username}/projects.json`;
axios.get((url),{params:{ axios.get((url),{params:{
category, category,
status, status,
page, page,
sort_by,
sort_direction,
per_page:this.props.is_current && category && page ==1?17:16 per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{ }}).then((result)=>{
if(result){ if(result){
@ -49,6 +52,8 @@ class InfosProject extends Component{
this.setState({ this.setState({
totalCount:result.data.count, totalCount:result.data.count,
data:result.data, data:result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false isSpin:false
}) })
} }
@ -56,6 +61,9 @@ class InfosProject extends Component{
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
this.setState({
isSpin: false
})
}) })
} }
@ -66,8 +74,9 @@ class InfosProject extends Component{
page:1, page:1,
isSpin:true isSpin:true
}) })
let{status}=this.state; let {status, sort_by, sort_direction} = this.state;
this.getCourses(cate,status,1); this.getCourses(cate, status, 1, sort_by,
sort_direction);
} }
//切换状态 //切换状态
changeStatus=(status)=>{ changeStatus=(status)=>{
@ -76,8 +85,12 @@ class InfosProject extends Component{
page:1, page:1,
isSpin:true isSpin:true
}) })
let{category}=this.state; let {
this.getCourses(category,status,1); category, sort_by,
sort_direction
} = this.state;
this.getCourses(category, status, 1, sort_by,
sort_direction);
} }
//切换页数 //切换页数
changePage=(page)=>{ changePage=(page)=>{
@ -85,8 +98,12 @@ class InfosProject extends Component{
page, page,
isSpin:true isSpin:true
}) })
let{category,status}=this.state; let {
this.getCourses(category,status,page); category, status, sort_by,
sort_direction
} = this.state;
this.getCourses(category, status, page, sort_by,
sort_direction);
} }
// 进入项目 // 进入项目
@ -96,6 +113,27 @@ class InfosProject extends Component{
} }
} }
//切换种类
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, 1, sort_by, "desc");
}
//排序
updatedlists(sort_direction) {
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
render(){ render(){
let{ let{
category, category,
@ -103,12 +141,24 @@ class InfosProject extends Component{
page, page,
data, data,
totalCount, totalCount,
isSpin isSpin,
sort_by,
sort_direction
} = this.state; } = this.state;
let isStudent = this.props.isStudent(); let isStudent = this.props.isStudent();
let is_current=this.props.is_current; let is_current=this.props.is_current;
console.log(data) const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_on")}>
最新动态
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_on")}>
最新创建
</Menu.Item>
</Menu>
);
return( return(
<div className="educontent"> <div className="educontent">
<Spin size="large" spinning={isSpin}> <Spin size="large" spinning={isSpin}>
@ -118,21 +168,76 @@ class InfosProject extends Component{
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li> <li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}学习的</a></li>
</div> </div>
{ {
is_current && is_current &&
<div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE"> <div className="edu-back-white padding20-30 clearfix secondNav bor-top-greyE">
<li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li> <li className={status ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeStatus()}>全部</a></li>
<li className={status=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("publicly")}>公开</a></li> <li className={status=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("publicly")}>公开</a></li>
<li className={status=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("personal")}>私有</a></li> <li className={status=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("personal")}>私有</a></li>
</div> </div>
} }
<p className="pl25 pr25 clearfix font-12 mb20 mt20"> <p className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"项目"}</span> <span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"项目"}</span>
<span className="fr color-grey-9">时间最新</span> <sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_on" ? '最近更新' : sort_by === "created_on" ? '最新创建' : ""}</span>
</span>
</Dropdown>
</p> </p>
<style>
{
`
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
`
}
</style>
<div className="square-list clearfix"> <div className="square-list clearfix">
{/* 289 */} {/* 289 */}
{ {
page == 1 && is_current && this.props.current_user && !category && this.props.current_user.user_identity != "学生" ? page == 1 && is_current && this.props.current_user && !category && this.props.current_user.user_identity != "学生" ?
<Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建开发项目"} index="4" Createtype={"projects"} <Create href={`${this.props.Headertop && this.props.Headertop.old_url}/projects/new`} name={"新建开发项目"} index="4" Createtype={"projects"}
{...this.props} {...this.state} {...this.props} {...this.state}
></Create>:"" ></Create>:""
@ -174,17 +279,17 @@ class InfosProject extends Component{
<div className="edu-txt-center course-bottom"> <div className="edu-txt-center course-bottom">
<div className="inline color-grey-6"> <div className="inline color-grey-6">
{ {
item.members_count> 0 && item.members_count > 0 &&
<span className="mr10 ml10 fl squareIconSpan"> <span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span> <i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span>
} }
{ {
item.issues_count> 0 && item.issues_count > 0 &&
<span className="mr10 ml10 fl squareIconSpan"> <span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-issue fl mr3" data-tip-down="issues数"></i>{item.issues_count}</span> <i className="iconfont icon-issue fl mr3" data-tip-down="issues数"></i>{item.issues_count}</span>
} }
{ {
item.changesets_count> 0 && item.changesets_count > 0 &&
<span className="mr10 ml10 fl squareIconSpan"> <span className="mr10 ml10 fl squareIconSpan">
<i className="iconfont icon-banbenku fl mr3" data-tip-down="版本库"></i>{item.changesets_count}</span> <i className="iconfont icon-banbenku fl mr3" data-tip-down="版本库"></i>{item.changesets_count}</span>
} }
@ -196,7 +301,7 @@ class InfosProject extends Component{
} }
</div> </div>
{ {
totalCount > 15 && totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div> </div>
@ -206,4 +311,4 @@ class InfosProject extends Component{
) )
} }
} }
export default InfosProject; export default InfosProject;

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Pagination , Spin } from 'antd'; import {Pagination, Spin, Dropdown, Menu} from 'antd';
import NoneData from '../../courses/coursesPublic/NoneData' import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios'; import axios from 'axios';
@ -16,11 +16,11 @@ class InfosShixun extends Component{
this.state={ this.state={
category:undefined, category:undefined,
page:1, page:1,
sort_by:'time',
status:undefined, status:undefined,
per_page:16, per_page:16,
isSpin:false, isSpin:false,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined, totalCount:undefined,
data:undefined data:undefined
} }
@ -30,11 +30,15 @@ class InfosShixun extends Component{
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
let{category,status,sort_by,page}=this.state; let {category, status, sort_by, page, sort_direction} = this.state;
this.getCourses(category,status,sort_by,page); this.getCourses(category, status, sort_by, page, sort_direction);
} }
getCourses=(category,status,sort_by,page)=>{ getCourses = (category, status, sort_by, page, sort_direction) => {
// console.log("请求数据成功");
// console.log("getCourses");
// console.log(sort_by);
// console.log(sort_direction);
let url=`/users/${this.props.match.params.username}/shixuns.json`; let url=`/users/${this.props.match.params.username}/shixuns.json`;
axios.get((url),{params:{ axios.get((url),{params:{
category, category,
@ -44,14 +48,21 @@ class InfosShixun extends Component{
per_page:this.props.is_current && category && page ==1?17:16 per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{ }}).then((result)=>{
if(result){ if(result){
console.log("请求数据成功");
console.log(sort_by);
this.setState({ this.setState({
totalCount:result.data.count, totalCount:result.data.count,
data:result.data, data:result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false isSpin:false
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
this.setState({
isSpin: false
})
}) })
} }
@ -63,8 +74,8 @@ class InfosShixun extends Component{
page:1, page:1,
isSpin:true isSpin:true
}) })
let{sort_by}=this.state; let {sort_by, sort_direction} = this.state;
this.getCourses(cate,undefined,sort_by,1); this.getCourses(cate, undefined, sort_by, 1, sort_direction);
} }
// 切换状态 // 切换状态
changeStatus=(status)=>{ changeStatus=(status)=>{
@ -73,8 +84,8 @@ class InfosShixun extends Component{
page:1, page:1,
isSpin:true isSpin:true
}) })
let{category,sort_by}=this.state; let {category, sort_by, sort_direction} = this.state;
this.getCourses(category,status,sort_by,1); this.getCourses(category, status, sort_by, 1, sort_direction);
} }
//切换页数 //切换页数
changePage=(page)=>{ changePage=(page)=>{
@ -82,8 +93,8 @@ class InfosShixun extends Component{
page, page,
isSpin:true isSpin:true
}) })
let{category,sort_by,status}=this.state; let {category, sort_by, status, sort_direction} = this.state;
this.getCourses(category,status,sort_by,page); this.getCourses(category, status, sort_by, page, sort_direction);
} }
// 进入课堂 // 进入课堂
@ -98,8 +109,28 @@ class InfosShixun extends Component{
sort_by:sort, sort_by:sort,
isSpin:true isSpin:true
}) })
let{category,status,page}=this.state; let {category, status, page, sort_direction} = this.state;
this.getCourses(category,status,sort,page); this.getCourses(category, status, sort, page, sort_direction);
}
//切换种类
updatedlist(sort_by) {
//按照什么样子排序
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
this.getCourses(category, status, sort_by, 1, "desc");
}
//排序
updatedlists(sort_direction) {
//是否是倒序
this.setState({
isSpin: true
});
let {category, status, page, sort_by} = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
} }
render(){ render(){
@ -110,10 +141,22 @@ class InfosShixun extends Component{
page, page,
data, data,
totalCount, totalCount,
sort_direction,
isSpin isSpin
} = this.state; } = this.state;
let is_current=this.props.is_current; let is_current=this.props.is_current;
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
最新动态
</Menu.Item>
<Menu.Item onClick={() => this.updatedlist("created_at")}>
语言类别
</Menu.Item>
</Menu>
);
return( return(
<div className="educontent"> <div className="educontent">
<Spin size="large" spinning={isSpin}> <Spin size="large" spinning={isSpin}>
@ -140,17 +183,57 @@ class InfosShixun extends Component{
<li className={status=="passed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("passed")}>已通关</a></li> <li className={status=="passed" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeStatus("passed")}>已通关</a></li>
</div> </div>
} }
<div className="pl25 pr25 clearfix font-12 mb20 mt20"> <div className="pl25 pr25 clearfix font-12 " style={{
lineHeight: "41px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实训"}</span> <span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实训"}</span>
<div className="fr"> <sapn className="relativef fr"
<li className="drop_down"> style={{
<span className="color-grey-9 font-12">{sort_by=="time"?"时间最新":"语言类别"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i> display: "flex",
<ul className="drop_down_normal"> flexDirection: "column",
<li onClick={()=>this.changeOrder("time")}>时间最新</li> height: "40px",
<li onClick={()=>this.changeOrder("language")}>语言类别</li> lineHeight: "40px",
</ul> }}
</li> >
</div> <span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '语言类别' : ""}</span>
</span>
</Dropdown>
</div> </div>
<style> <style>
{ {
@ -160,13 +243,14 @@ class InfosShixun extends Component{
left: 10px; left: 10px;
bottom: 100px; bottom: 100px;
} }
.square-list{width: 100%;box-sizing: border-box;margin-top:10px}
` `
} }
</style> </style>
<div className="square-list clearfix"> <div className="square-list clearfix">
{/* 298 */} {/* 298 */}
{ {
page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ? page == 1 && is_current && !category && this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:"" <Create href={"/shixuns/new"} name={"新建实训"} index="2"></Create>:""
} }
{ {
@ -201,7 +285,7 @@ class InfosShixun extends Component{
} }
</div> </div>
{ {
totalCount > 15 && totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
</div> </div>
@ -211,4 +295,4 @@ class InfosShixun extends Component{
) )
} }
} }
export default InfosShixun; export default InfosShixun;

@ -162,7 +162,7 @@
float:left; float:left;
} }
.userpost label{ .userpost label{
display:block; display: block;
height: 18px; height: 18px;
line-height:18px; line-height:18px;
} }
@ -434,4 +434,8 @@
/* 防抖 */ /* 防抖 */
.educontent .square-list { .educontent .square-list {
min-height: 400px; min-height: 400px;
} }
.h10 {
height: 10px;
}

@ -1,6 +1,6 @@
import React, { useState, useEffect, useContext, useRef, memo } from 'react'; import React, { useState, useEffect, useContext, useRef, memo } from 'react';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import { Pagination, Input, Button } from 'antd' import {Pagination, Input, Button} from 'antd'
import { getUrl2, isDev, ThemeContext, ActionBtn, NoneData } from 'educoder' import { getUrl2, isDev, ThemeContext, ActionBtn, NoneData } from 'educoder'
import axios from 'axios' import axios from 'axios'
import VideoInReviewItem from './VideoInReviewItem' import VideoInReviewItem from './VideoInReviewItem'
@ -55,7 +55,7 @@ function InfoVideo (props) {
const [count, setCount] = useState(0) const [count, setCount] = useState(0)
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
const [sortKey, setSortKey] = useState(_items[0].key) const [sortKey, setSortKey] = useState(_items[0].key)
const editModalObj = useModal(false) const editModalObj = useModal(false)
const videoModalObj = useModal(false) const videoModalObj = useModal(false)
const categoryObj = useCategory('all') const categoryObj = useCategory('all')
@ -64,7 +64,7 @@ function InfoVideo (props) {
const theme = useContext(ThemeContext); const theme = useContext(ThemeContext);
const editModalEl = useRef(null); const editModalEl = useRef(null);
const videoEl = useRef(null); const videoEl = useRef(null);
const { showNotification, history } = props; const { showNotification, history } = props;
const username = props.match.params.username const username = props.match.params.username
@ -74,19 +74,19 @@ function InfoVideo (props) {
} else { } else {
props.showProfessionalCertificationDialog() props.showProfessionalCertificationDialog()
} }
} }
function fetchvideos() { function fetchvideos() {
const fetchUrl = `/users/${username}/videos.json` const fetchUrl = `/users/${username}/videos.json`
const sorts = sortKey.split('-') const sorts = sortKey.split('-')
setLoading(true) setLoading(true)
axios.get(fetchUrl, { axios.get(fetchUrl, {
params: { params: {
page: pageObj.current, page: pageObj.current,
per_page: PAGE_SIZE, per_page: PAGE_SIZE,
sort_by: sorts[0], sort_by: sorts[0],
sort_direction: sorts[1], sort_direction: sorts[1],
// //
} }
}) })
.then((response) => { .then((response) => {
@ -96,14 +96,14 @@ function InfoVideo (props) {
setCount(response.data.count) setCount(response.data.count)
} }
}).catch(() => { }).catch(() => {
setLoading(false)
}) })
} }
function fetchReviewvideos() { function fetchReviewvideos() {
const fetchUrl = `/users/${username}/videos/review.json` const fetchUrl = `/users/${username}/videos/review.json`
const sorts = sortKey.split('-') const sorts = sortKey.split('-')
setLoading(true) setLoading(true)
axios.get(fetchUrl, { axios.get(fetchUrl, {
params: { params: {
page: pageObj.current, page: pageObj.current,
per_page: PAGE_SIZE, per_page: PAGE_SIZE,
@ -121,7 +121,7 @@ function InfoVideo (props) {
}) })
} }
useEffect(() => { useEffect(() => {
if (pageObj.current == 1) { if (pageObj.current == 1) {
if (categoryObj.category == 'all') { if (categoryObj.category == 'all') {
@ -158,22 +158,22 @@ function InfoVideo (props) {
_clipboard = new ClipboardJS('.copybtn'); _clipboard = new ClipboardJS('.copybtn');
_clipboard.on('success', (e) => { _clipboard.on('success', (e) => {
showNotification('复制成功') showNotification('复制成功')
}); });
} }
}, 200) }, 200)
} }
}, [videoModalObj.visible]) }, [videoModalObj.visible])
useEffect(() => { useEffect(() => {
}, []) }, [])
function editSuccess() { function editSuccess() {
fetchvideos() fetchvideos()
} }
function onEditVideo(item) { function onEditVideo(item) {
videoId = { videoId = {
videoId: item.id, videoId: item.id,
title: item.title title: item.title
} }
@ -182,12 +182,12 @@ function InfoVideo (props) {
// this.refs['editVideoModal'].setVisible(true, video); // this.refs['editVideoModal'].setVisible(true, video);
} }
function onMaskClick(item) { function onMaskClick(item) {
videoId = { videoId = {
videoId: item.id, videoId: item.id,
title: item.title, title: item.title,
file_url: item.file_url, file_url: item.file_url,
cover_url: item.cover_url cover_url: item.cover_url
} }
videoModalObj.setVisible(true) videoModalObj.setVisible(true)
} }
@ -201,20 +201,23 @@ function InfoVideo (props) {
function getCopyText (file_url, cover_url) { function getCopyText (file_url, cover_url) {
return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>` return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
} }
const _inputValue = getCopyText(videoId.file_url, videoId.cover_url)
const _inputValue = getCopyText(videoId.file_url, videoId.cover_url);
const sorts = sortKey.split('-')
return ( return (
<div className="educontent infoVideo"> <div className="educontent infoVideo">
<EditVideoModal {...props} {...editModalObj} <EditVideoModal {...props} {...editModalObj}
editSuccess={editSuccess} editSuccess={editSuccess}
{...videoId} {...videoId}
></EditVideoModal> ></EditVideoModal>
<HeadlessModal <HeadlessModal
{...videoModalObj} {...videoModalObj}
className="showVideoModal" className="showVideoModal"
width={800 - 1} width={800 - 1}
> >
<video <video
autoplay="true" autoplay="true"
ref={videoEl} ref={videoEl}
src={videoId.file_url} controls="true" controlslist="nodownload"> src={videoId.file_url} controls="true" controlslist="nodownload">
@ -274,14 +277,16 @@ function InfoVideo (props) {
<Button type="primary" icon="upload" <Button type="primary" icon="upload"
onClick={() => { toUpload() }} onClick={() => { toUpload() }}
className="toUploadBtn" className="toUploadBtn"
> >
上传视频 上传视频
</Button> </Button>
} }
></InfoTab> ></InfoTab>
<div className="toolbarRow mt20 df"> <div className="toolbarRow df" style={{
lineHeight: "40px",
}}>
<span> <span>
<span style={{color: theme.foreground_orange1}}> {count} </span> <span style={{color: theme.foreground_orange1}}> {count} </span>
@ -297,21 +302,58 @@ function InfoVideo (props) {
{categoryObj.category == 'all' &&<div className="fr"> {categoryObj.category == 'all' &&<div className="fr">
<li className="drop_down"> <li className="drop_down">
<span className="color-grey-9 font-12">{sortKey=="published_at-desc"?"最新上传":"最早上传"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i> <span className="color-grey-9 font-12" style={{
<ul className="drop_down_normal"> marginRight: " 5px",
<li onClick={()=>onSortChange("published_at-desc",0)}>最新上传</li> }}>{"最新上传"}</span>
<li onClick={()=>onSortChange("published_at-asc",1)}>最早上传</li>
</ul> <sapn className="relativef fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sorts[1] === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => onSortChange("published_at-asc", 0)}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sorts[1] === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => onSortChange("published_at-desc", 0)}></i>
</span>
</sapn>
</li> </li>
</div>} </div>}
</div> </div>
{categoryObj.category == 'all' ? {categoryObj.category == 'all' ?
<div className="itemWrap"> <div className="itemWrap">
{ {
videos == undefined ? '' : videos == undefined ? '' :
videos.length ? videos.length ?
videos.map((item, index) => { videos.map((item, index) => {
return (<VideoInReviewItem return (<VideoInReviewItem
{...props} {...props}
@ -321,8 +363,8 @@ function InfoVideo (props) {
onEditVideo={onEditVideo} onEditVideo={onEditVideo}
onMaskClick={onMaskClick} onMaskClick={onMaskClick}
getCopyText={getCopyText} getCopyText={getCopyText}
> >
</VideoInReviewItem>) </VideoInReviewItem>)
}) })
: <NoneData style={{width: '100%'}}></NoneData> : <NoneData style={{width: '100%'}}></NoneData>
@ -332,7 +374,7 @@ function InfoVideo (props) {
<div className="itemWrap"> <div className="itemWrap">
{ {
reviewvideos == undefined ? '' : reviewvideos == undefined ? '' :
reviewvideos.length ? reviewvideos.length ?
reviewvideos.map((item, index) => { reviewvideos.map((item, index) => {
return (<VideoInReviewItem return (<VideoInReviewItem
{...props} {...props}
@ -348,18 +390,18 @@ function InfoVideo (props) {
</div> </div>
} }
{/* 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}
/> />
</div> </div>
} }
</div> </div>
) )
} }
@ -370,4 +412,4 @@ export default InfoVideo
您的浏览器不支持 video 标签 您的浏览器不支持 video 标签
</video> </video>
*/ */

Loading…
Cancel
Save