杨树林 5 years ago
commit 5a92b9920c

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

@ -13,21 +13,13 @@ function locationurl(list){
if (window.location.port === "3007") {
} else {
if(list===402){
SetAppModel(402)
}else if(list===407){
}else{
window.location.replace(list)
}
}
}
// TODO 开发期多个身份切换
const debugType =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;
export function initAxiosInterceptors(props) {
@ -153,16 +145,16 @@ export function initAxiosInterceptors(props) {
locationurl('/500');
}
if (response.data.status === 402) {
console.log(response.data.status);
console.log(response.data);
// locationurl(402);
}
// if (response.data.status === 402) {
// console.log(response.data.status);
// console.log(response.data);
// // locationurl(402);
// }
if (response.data.status === 401) {
return config;
}
if (response.data.status === 401) {
return config;
}
// if (response.data.status === 407) {
// 在app js 中解决 Trialapplication
// // </Trialapplication>

@ -146,12 +146,22 @@ class ShixunModal extends Component{
}
savecouseShixunModal=()=>{
this.setState({
hometypepvisible:true
})
let {coursesId,patheditarry,datas}=this.props;
let{category_id}=this.state;
if(patheditarry.length===0){
this.setState({
shixunmodelchke:true,
chekicmessage:"请先选择实训",
hometypepvisible:false
})
return
}
if (this.props.chooseShixun) {
this.props.chooseShixun(patheditarry)
this.setState({
@ -159,15 +169,7 @@ class ShixunModal extends Component{
})
return;
}
if(patheditarry.length===0){
this.setState({
shixunmodelchke:true,
chekicmessage:"请先选择实训",
hometypepvisible:false
})
return
}
let url="/courses/"+coursesId+"/homework_commons/create_shixun_homework.json";
axios.post(url, {
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>
</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">
<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>

@ -257,7 +257,13 @@ class CoursesNew extends Component {
}
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) => {

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

@ -683,9 +683,12 @@ submittojoinclass=(value)=>{
</li>
{/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a></li>
<li className="">
<a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a>
<img className="roundedRectangles" src="/images/educoder/roundedRectangle.png" />
</li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.moop_cases_url}>教学案例</a></li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.crowdsourcing_url}>众包社区</a></li>
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.crowdsourcing_url}>众包创新</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
<li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
@ -717,7 +720,7 @@ submittojoinclass=(value)=>{
// onSearch={value => console.log(value)}
onPressEnter={this.onKeywordSearchKeyDown}
style={{ width: 295 }}
style={{ width: 300 }}
/>
</div>
@ -743,11 +746,11 @@ submittojoinclass=(value)=>{
<%= link_to '注册', user_join_path, :className => "ml5" %>
</span>*/}
{ user===undefined?
<span className="font-15 fr mt17">
<span className="font-15 fr mt17 ml20">
<a onClick={()=>this.educoderlogin()} className="mr5 color-white">登录</a>
<em className="vertical-line"></em>
<a href={"/register"} className="mr5 color-white">注册</a>
</span> :user.login===""?<span className="font-15 fr mt17">
</span> :user.login===""?<span className="font-15 fr mt17 ml20">
<a onClick={()=>this.educoderlogin()} className="mr5 color-white">登录</a>
<em className="vertical-line"></em>
<a href={"/register"} className="mr5 color-white">注册</a>
@ -780,7 +783,7 @@ submittojoinclass=(value)=>{
</div>
}
{/*href="https://www.educoder.net/login"*/}
{ user===undefined?"":user.login===""?"":<div className="fr head-right">
<div className="fr head-right ">
{ loadHeader()}
<a id="search-open" className="fl mr30 headIcon">
{/*"/images/educoder/icon/search.svg"
@ -868,7 +871,7 @@ submittojoinclass=(value)=>{
</div>
</div>
<div className="fl mr30 edu-menu-panel headIcon">
<div className="fl mr30 edu-menu-panel headIcon">
{ user===undefined?"":user.login===""?"": <a
href={this.props.Headertop===undefined?"":this.props.Headertop.message_url}
style={{position:'relative'}}
@ -911,7 +914,7 @@ submittojoinclass=(value)=>{
</div>
</Modal>
</div>}
</div>
</div>
</div>

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

@ -191,4 +191,10 @@ body>.-task-title {
.HeaderSearch .ant-input-search .ant-input-suffix{
background: transparent !important;
}
.roundedRectangles{
position: absolute;
top: 10px;
right: -22px;
}
Loading…
Cancel
Save