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