调整课堂体验

competitions
杨树明 5 years ago
parent 22457350b4
commit 71a8709fb4

@ -275,18 +275,19 @@ class Fileslistitem extends Component{
`
}
</style>
{discussMessage.course_groups.length===0?"":
<p className="color-grey panel-lightgrey mt8 fl lightgreybox ml30" style={{width:'100%'}}>
{discussMessage.course_groups.map((item,key)=>{
return(
<div className="mr50">
<span className="mr15 color-dark">{item.course_group_name}</span>
<span className="mr15 color-grey9 ">将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD HH:mm')}</span>
</div>
)
})}
</p>}
{/*资源分班*/}
{/*{discussMessage.course_groups.length===0?"":*/}
{/*<p className="color-grey panel-lightgrey mt8 fl lightgreybox ml30" style={{width:'100%'}}>*/}
{/*{discussMessage.course_groups.map((item,key)=>{*/}
{/*return(*/}
{/*<div className="mr50">*/}
{/*<span className="mr15 color-dark">{item.course_group_name}</span>*/}
{/*<span className="mr15 color-grey9 ">将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD HH:mm')}</span>*/}
{/*</div>*/}
{/*)*/}
{/*})}*/}
{/*</p>}*/}
<p className={this.props.isAdmin===true?"color-grey panel-lightgrey mt8 fl ml30":"color-grey panel-lightgrey mt8 fl ml13"} style={{width:'100%'}}>
<span className="mr50">

@ -181,23 +181,27 @@ class Fileslists extends Component{
course_second_category_id:id
}
}).then((result)=>{
// console.log(result)
if(result.status===200){
if(result.data.status===0){
let list=result.data.data;
this.setState({
total_count:list.total_count,
publish_count:list.publish_count,
unpublish_count:list.unpublish_count,
files:list.files,
filesId:list.id,
name:list.name,
course_is_public:result.data.data.course_is_public,
isSpin:false
})
}
}
if(result!=undefined){
if(result.status===200){
if(result.data.status===0){
let list=result.data.data;
this.setState({
total_count:list.total_count,
publish_count:list.publish_count,
unpublish_count:list.unpublish_count,
files:list.files,
filesId:list.id,
name:list.name,
course_is_public:result.data.data.course_is_public,
isSpin:false
})
}
}
}else{
this.setState({
isSpin:false
})
}
}).catch((error)=>{
console.log(error)
this.setState({

@ -400,11 +400,13 @@ class CoursesBanner extends Component {
if(sum===1){
let url =`/courses/${id}/switch_to_student.json`;
axios.post(url).then((response) => {
if(response.data.status===0){
// window.location.href = "/users/" + this.props.current_user.login;
// this.props.history.replace(newurl);
window.location.href=newurl
}
if(response!=undefined){
if(response.data.status===0){
// window.location.href = "/users/" + this.props.current_user.login;
// this.props.history.replace(newurl);
window.location.href=newurl
}
}
})
}
@ -412,11 +414,13 @@ class CoursesBanner extends Component {
if(sum===2){
let url =`/courses/${id}/switch_to_teacher.json`;
axios.post(url).then((response) => {
if(response.data.status===0){
// window.location.href = "/users/" + this.props.current_user.login;
// this.props.history.replace(newurl);
window.location.href=newurl
}
if(response!=undefined){
if(response.data.status===0){
// window.location.href = "/users/" + this.props.current_user.login;
// this.props.history.replace(newurl);
window.location.href=newurl
}
}
})
}

@ -238,6 +238,37 @@ class Coursesleftnav extends Component{
this.props.updataleftNavfun()
}
componentDidUpdate=(prevProps)=>{
if(prevProps!=this.props){
let courstype=this.props.match.url;
courstype = courstype.split('/');
courstype=courstype[3];
const query =this.props.location.search;
let category_id;
if(courstype==="board"){
category_id=parseInt(this.props.match.params.boardId);
}else{
category_id=parseInt(this.props.match.params.category_id);
}
if(query===""){
this.setState({
positiontype:courstype,
})
}else{
if(isNaN(category_id)){
this.setState({
positiontype:courstype,
})
}else{
this.setState({
positiontype:courstype,
})
}
}
}
}
setnavid=(e,key,id,type,url)=>{
// this.props.getleftNavid && this.props.getleftNavid(key,type);
// let {selectnavid,navid}=this.state;
@ -493,7 +524,8 @@ class Coursesleftnav extends Component{
navidtype=true
}
saveNavmodapost=(url,value)=>{
saveNavmodapost=(url,value,positiontype,coursesId)=>{
axios.post(url,
{name:value}).then((result)=>{
if(result.data.status===0){
@ -505,6 +537,10 @@ class Coursesleftnav extends Component{
description:result.data.message
});
trigger('updateNavSuccess')
if(positiontype==="files"){
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`;
// this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`)
}
}
}).catch((error)=>{
console.log(error)
@ -556,9 +592,8 @@ class Coursesleftnav extends Component{
}
if(Navmodaltypename===1){
let url="/course_modules/"+id+"/add_second_category.json"
this.saveNavmodapost(url,NavmodalValue)
this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId)
} else if(Navmodaltypename===2){

@ -121,6 +121,7 @@ class CommitSummary extends Component{
const {getFieldDecorator} = this.props.form;
let {contents,data}=this.state;
// console.log(this.props);
document.title=data === undefined ? "" :data.course_name===undefined?"": data.course_name;
return (
<div>
<div className="newMain clearfix">

@ -182,6 +182,7 @@ class ShixunHomeworkPage extends Component {
const isAdmin = this.props.isAdmin();
// console.log(119)
// console.log(jobsettingsdatapage);
document.title=jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name;
return (
<div className="newMain clearfix ">
<Modals

@ -133,10 +133,16 @@ class ShixunHomework extends Component{
category:id
}
}).then((result)=>{
this.setState({
isSpin:false,
datas:result.data,
})
if(result!=undefined){
this.setState({
isSpin:false,
datas:result.data,
})
}else{
this.setState({
isSpin:false,
})
}
}).catch((error)=>{
console.log(error);
})
@ -188,19 +194,18 @@ class ShixunHomework extends Component{
category: category_id===undefined?undefined:category_id
}
}).then((result)=>{
if(result.status===200){
// if(checkedtype===true&&page>1){
// for(var value of result.data.homeworks){
// checkBoxValues.push(value.homework_id)
// }
// }
this.setState({
datas:result.data,
isSpin:false
})
}
if(result!=undefined){
if(result.status===200){
this.setState({
datas:result.data,
isSpin:false
})
}
}else{
this.setState({
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
})

Loading…
Cancel
Save