dev_forum
杨树明 5 years ago
parent 7a73f04bf1
commit c2962c9612

@ -26,10 +26,9 @@ function locationurl(list){
} }
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
const debugType ="" const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
// window.location.search.indexOf('debug=t') != -1 ? 'teacher' : window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' window._debugType = debugType;
// window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {
@ -44,6 +43,7 @@ export function initAxiosInterceptors(props) {
proxy="http://47.96.87.25:48080" proxy="http://47.96.87.25:48080"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求 // 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制 // 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制
const requestMap = {}; const requestMap = {};

@ -146,19 +146,12 @@ class ShixunModal extends Component{
} }
savecouseShixunModal=()=>{ savecouseShixunModal=()=>{
this.setState({ this.setState({
hometypepvisible:true hometypepvisible:true
}) })
let {coursesId,patheditarry,datas}=this.props; let {coursesId,patheditarry,datas}=this.props;
let{category_id}=this.state;
if (this.props.chooseShixun) {
this.props.chooseShixun(patheditarry)
this.setState({
hometypepvisible:false
})
return;
}
if(patheditarry.length===0){ if(patheditarry.length===0){
this.setState({ this.setState({
shixunmodelchke:true, shixunmodelchke:true,
@ -168,6 +161,15 @@ class ShixunModal extends Component{
return return
} }
if (this.props.chooseShixun) {
this.props.chooseShixun(patheditarry)
this.setState({
hometypepvisible:false
})
return;
}
let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json"; let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json";
axios.post(url, { axios.post(url, {
category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id), category_id:this.props.category_id===null||this.props.category_id===undefined?undefined:parseInt(this.props.category_id),
@ -378,7 +380,7 @@ class ShixunModal extends Component{
</div> </div>
</div> </div>
</Spin> </Spin>
<span className={this.state.shixunmodelchke===true?"none":"color-red"}>{this.state.chekicmessage}</span> <span className={this.state.shixunmodelchke===true?"color-red":"none"}>{this.state.chekicmessage}</span>
<div className="mt20 marginauto clearfix edu-txt-center"> <div className="mt20 marginauto clearfix edu-txt-center">
<a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a> <a className="pop_close task-btn mr30 margin-tp26" onClick={this.hidecouseShixunModal}>取消</a>
<a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a> <a className="task-btn task-btn-orange margin-tp26" id="submit_send_shixun" onClick={this.savecouseShixunModal}>确定</a>

@ -257,7 +257,13 @@ class CoursesNew extends Component {
} }
goback = () => { goback = () => {
window.history.go(-1)
if(this.props.match.params.coursesId===undefined){
this.props.history.push("/courses");
}else{
this.props.history.push(`/courses/${this.props.match.params.coursesId}`);
}
// window.history.go(-1)
} }
onCheckAllChange = (e) => { onCheckAllChange = (e) => {

@ -361,7 +361,7 @@ class ShixunsHome extends Component {
<img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'images/'+item.image_url} />
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )
@ -375,7 +375,7 @@ class ShixunsHome extends Component {
<img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'images/'+item.image_url} />
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )
@ -389,7 +389,7 @@ class ShixunsHome extends Component {
<img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'images/'+item.image_url} />
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )
@ -405,7 +405,7 @@ class ShixunsHome extends Component {
<li key={key}> <li key={key}>
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url}/> <img src={'images/'+item.image_url}/>
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )
@ -437,7 +437,7 @@ class ShixunsHome extends Component {
<img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'images/'+item.image_url} />
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )
@ -451,7 +451,7 @@ class ShixunsHome extends Component {
<img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'images/'+item.image_url} />
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )
@ -465,7 +465,7 @@ class ShixunsHome extends Component {
<img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" /> <img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url} /> <img src={'images/'+item.image_url} />
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )
@ -481,7 +481,7 @@ class ShixunsHome extends Component {
<li key={key}> <li key={key}>
<a href={"/users/"+item.login} className="color-dark"> <a href={"/users/"+item.login} className="color-dark">
<img src={'images/'+item.image_url}/> <img src={'images/'+item.image_url}/>
<span className="task-hide rankName">{item.name}</span> <span className="task-hide rankName">{item.username}</span>
</a> </a>
</li> </li>
) )

@ -39,7 +39,7 @@ class TPMBanner extends Component {
this.state={ this.state={
Forkvisible: false, Forkvisible: false,
Senttothetype:false, Senttothetype:false,
Senttothevcalue:1, Senttothevcalue:undefined,
courses_count:1, courses_count:1,
course_list:[], course_list:[],
pagenum:1, pagenum:1,
@ -62,6 +62,7 @@ class TPMBanner extends Component {
isIE:false, isIE:false,
Forkvisibletype: false, Forkvisibletype: false,
isSpin:false, isSpin:false,
Senttothevcaluetype:false
} }
} }
@ -233,12 +234,21 @@ class TPMBanner extends Component {
}); });
} }
sendeSenttothevcalue=()=>{ sendeSenttothevcalue=()=>{
let {Senttothevcalue}=this.state; let {Senttothevcalue}=this.state;
if(Senttothevcalue===undefined){
this.setState({
Senttothevcaluetype:true
})
return
}
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/send_to_course.json"; let url="/shixuns/" + id +"/send_to_course.json";
axios.post(url,{ axios.post(url,{
course_id:Senttothevcalue course_id:Senttothevcalue
}).then((response) => { }).then((response) => {
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
this.setState({ this.setState({
Senttothetype:false, Senttothetype:false,
@ -466,6 +476,7 @@ class TPMBanner extends Component {
shixunsreplace, shixunsreplace,
hidestartshixunsreplacevalue, hidestartshixunsreplacevalue,
Forkvisibletype, Forkvisibletype,
Senttothevcaluetype,
isIE} = this.state; isIE} = this.state;
let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let {shixunsDetails, shixunId, star_info, star_infos} = this.props;
let challengeBtnTipText = ''; let challengeBtnTipText = '';
@ -839,7 +850,7 @@ class TPMBanner extends Component {
/> />
</div> </div>
<div id="search_course_list" className={courses_count > 12?"cdefault mb20":"cdefault mb50"}> <div id="search_course_list" className={courses_count > 12?"cdefault ":"cdefault "}>
<div className="clearfix mb5 edu-bg-light-blue edu-h315"> <div className="clearfix mb5 edu-bg-light-blue edu-h315">
<ul> <ul>
<RadioGroup onChange={this.onChangeSenttothevcalue} value={Senttothevcalue}> <RadioGroup onChange={this.onChangeSenttothevcalue} value={Senttothevcalue}>
@ -855,8 +866,8 @@ class TPMBanner extends Component {
</ul> </ul>
</div> </div>
</div> </div>
{this.state.Senttothevcaluetype===true?<div className={"color-red"}>请选择你要发送的课堂</div>:""}
<div className="mt40 marginauto"> <div className="mt10 marginauto">
<Pagination size="small" style={{display: courses_count > 12 ? "block" : "none"}} <Pagination size="small" style={{display: courses_count > 12 ? "block" : "none"}}
showQuickJumper defaultCurrent={1} current={pages} pageSize={12} showQuickJumper defaultCurrent={1} current={pages} pageSize={12}
total={courses_count} onChange={this.onChangesendeSenttothe}/> total={courses_count} onChange={this.onChangesendeSenttothe}/>

Loading…
Cancel
Save