Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

chromesetting
cxt 5 years ago
commit f88b1ec393

@ -414,7 +414,7 @@ class commonWork extends Component{
<Menu.Item key="2">补交中</Menu.Item> <Menu.Item key="2">补交中</Menu.Item>
<Menu.Item key="3">匿评中</Menu.Item> <Menu.Item key="3">匿评中</Menu.Item>
<Menu.Item key="4">申诉中</Menu.Item> <Menu.Item key="4">申诉中</Menu.Item>
<Menu.Item key="5">评阅中</Menu.Item> <Menu.Item key="5">已截止</Menu.Item>
</Menu> </Menu>
</div> </div>
} }

@ -736,18 +736,37 @@ submittojoinclass=(value)=>{
}); });
}; };
matchpaths=(url)=>{
const {match} = this.props;
if (url=== '/forums'&&match.path === '/forums') {
return true
} else if (url.startsWith('/shixuns')&&match.path.startsWith('/shixuns')) {
return true
}else if (url.startsWith('/paths')&&match.path.startsWith('/paths')) {
return true
} else if (url.startsWith('/courses')&&match.path.startsWith('/courses')) {
return true
}else if (url.startsWith('/competitions')&&match.path.startsWith('/crowdsourcing')) {
return true
}else if (url.startsWith('/crowdsourcing')&&match.path.startsWith('/crowdsourcing')) {
return true
}else if(url.startsWith('/moop_cases')&&match.path.startsWith('/moop_cases')){
return true
}else if(url.startsWith('/developer')&&match.path.startsWith('/developer')){
return true
}else {
return false
}
}
render() { render() {
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
const {match,} = this.props; const {match} = this.props;
let {Addcoursestypes, let {Addcoursestypes,
tojoinitemtype, tojoinitemtype,
tojoinclasstitle, tojoinclasstitle,
Checkboxteacherchecked,
Checkboxstudentchecked,
Checkboxteachingchecked,
Checkboxteachertype,
Checkboxteachingtype,
code_notice, code_notice,
checked_notice, checked_notice,
AccountProfiletype, AccountProfiletype,
@ -792,90 +811,29 @@ submittojoinclass=(value)=>{
// console.log("mygetHelmetapi2"); // console.log("mygetHelmetapi2");
// console.log(mygetHelmetapi2); // console.log(mygetHelmetapi2);
if(mygetHelmetapi2){ if(mygetHelmetapi2) {
if(mygetHelmetapi2.navbar){ if (mygetHelmetapi2.navbar) {
if(mygetHelmetapi2.navbar.length>0){ if (mygetHelmetapi2.navbar.length > 0) {
// console.log("mygetHelmetapi2.navbar.length>0====-=-=--=-=-=-="); // console.log("mygetHelmetapi2.navbar.length>0====-=-=--=-=-=-=");
// //
// console.log(match.path); // console.log(match.path);
if(match.path==='/'){ if (match.path === '/') {
if(headtypesonClickbool===false){ if (headtypesonClickbool === false) {
headtypes=undefined; headtypes = undefined;
}else{ } else {
headtypes=headtypess; headtypes = headtypess;
} }
} else {
}else { for (var i = 0; i < mygetHelmetapi2.navbar.length; i++) {
for(var i=0;i<mygetHelmetapi2.navbar.length;i++){ if (match.path === mygetHelmetapi2.navbar[i].link) {
if(match.path===mygetHelmetapi2.navbar[i].link){ headtypes = mygetHelmetapi2.navbar[i].link;
headtypes=mygetHelmetapi2.navbar[i].link;
break; break;
} }
} }
} }
}else{
if (match.path === '/forums') {
headtypes = '/forums';
} else if (match.path.startsWith('/shixuns')) {
headtypes = '/shixuns';
}else if (match.path.startsWith('/paths')) {
headtypes = '/paths';
} else if (match.path.startsWith('/courses')) {
headtypes = '/courses';
}else if (match.path.startsWith('/competitions')) {
headtypes = '/competitions';
}else if (match.path.startsWith('/crowdsourcing')) {
headtypes = '/crowdsourcing';
}else if(match.path.startsWith('/moop_cases')){
headtypes = '/moop_cases';
}else if(match.path.startsWith('/developer')){
headtypes = '/developer'
}else {
headtypes = '/';
} }
} }
}else{
if (match.path === '/forums') {
headtypes = '/forums';
} else if (match.path.startsWith('/shixuns')) {
headtypes = '/shixuns';
}else if (match.path.startsWith('/paths')) {
headtypes = '/paths';
} else if (match.path.startsWith('/courses')) {
headtypes = '/courses';
}else if (match.path.startsWith('/competitions')) {
headtypes = '/competitions';
}else if (match.path.startsWith('/crowdsourcing')) {
headtypes = '/crowdsourcing';
}else if(match.path.startsWith('/moop_cases')){
headtypes = '/moop_cases';
}else if(match.path.startsWith('/developer')){
headtypes = '/developer'
}else {
headtypes = '/';
}
}
}else{
if (match.path === '/forums') {
headtypes = '/forums';
} else if (match.path.startsWith('/shixuns')) {
headtypes = '/shixuns';
}else if (match.path.startsWith('/paths')) {
headtypes = '/paths';
} else if (match.path.startsWith('/courses')) {
headtypes = '/courses';
}else if (match.path.startsWith('/competitions')) {
headtypes = '/competitions';
}else if (match.path.startsWith('/crowdsourcing')) {
headtypes = '/crowdsourcing';
}else if(match.path.startsWith('/moop_cases')){
headtypes = '/moop_cases';
}else if(match.path.startsWith('/developer')){
headtypes = '/developer'
}else {
headtypes = '/';
}
} }
// console.log(mygetHelmetapi2); // console.log(mygetHelmetapi2);
@ -907,6 +865,8 @@ submittojoinclass=(value)=>{
} }
}) })
} }
return ( return (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
@ -969,7 +929,7 @@ submittojoinclass=(value)=>{
} }
// console.log(item.hidden); // console.log(item.hidden);
return( return(
<li key={key} onClick={()=>this.headtypesonClick(item.link,true)} className={`${headtypes===undefined?'pr':headtypes===item.link?'pr active':'pr'}`} style={item.hidden==false?{display: 'block'}:{display: 'none'}}> <li key={key} onClick={()=>this.headtypesonClick(item.link,true)} className={`${this.matchpaths(item.link)===true?'pr active':'pr'}`} style={item.hidden==false?{display: 'block'}:{display: 'none'}}>
{ {
strbool===true? strbool===true?
<a href={item.link}>{item.name}</a> <a href={item.link}>{item.name}</a>
@ -1109,6 +1069,8 @@ submittojoinclass=(value)=>{
<Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link> <Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link>
</li> </li>
{}
{console.log(activeShixuns)}
<li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}> <li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>
<Link to="/shixuns">实训项目</Link> <Link to="/shixuns">实训项目</Link>
{/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/} {/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}

Loading…
Cancel
Save