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

dev_home
杨树林 5 years ago
commit 3dc73194b2

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map", // devtool: "cheap-module-eval-source-map",
// 开启调试 // 开启调试
devtool: "source-map", // 开启调试 //devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle. // This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS. // The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -112,13 +112,27 @@ class ShixunsHome extends Component {
} }
const MyRate = ({ defaultValue, ...rest }) => { const MyRate = ({ defaultValue, ...rest }) => {
let myValue = defaultValue; let myValue = defaultValue;
// console.log(myValue-Math.floor(myValue))
// if (myValue < Math.ceil(myValue)) {
// myValue = Math.floor(myValue) + 0.5;
// }
return <Rating {...rest} value={myValue} />; return <Rating {...rest} value={myValue} />;
}; };
let shixuntype=false;
let pathstype=false;
if(this.props&&this.props.mygetHelmetapi!=null){
console.log(this.props.mygetHelmetapi.navbar)
let shixun="/shixuns";
let paths="/paths";
this.props.mygetHelmetapi.navbar.map((item,key)=>{
var reg = RegExp(item.link);
if(shixun.match(reg)){
shixuntype=true
}
if(paths.match(reg)){
pathstype=true
}
})
}
return ( return (
<div className="newMain clearfix backFAFAFA shixunsHome"> <div className="newMain clearfix backFAFAFA shixunsHome">
{this.state.updata===undefined?"":<UpgradeModals {this.state.updata===undefined?"":<UpgradeModals
@ -162,7 +176,7 @@ class ShixunsHome extends Component {
))} ))}
</Slider> </Slider>
} }
<div className="user_navlist"> {this.props.user&&this.props.user.main_site===true?<div className="user_navlist">
<div className="user_navlist_black"> <div className="user_navlist_black">
<ul className="black_nav_list"> <ul className="black_nav_list">
{homedatalist === undefined ? "" :homedatalistreps.map((item,key)=>{ {homedatalist === undefined ? "" :homedatalistreps.map((item,key)=>{
@ -212,13 +226,13 @@ class ShixunsHome extends Component {
} }
</ul> </ul>
</div> </div>
</div> </div>:""}
</div> </div>
</div> </div>
{/*实训路径*/} {/*实训路径*/}
<div className="clearfix pt20 educontent pr pb20"> {pathstype===true?<div className="clearfix pt20 educontent pr pb20">
<div className="edu-txt-center"> <div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实践课程</p> <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实践课程</p>
<p className="color-grey-cd font-12">TRAINING COURSE</p> <p className="color-grey-cd font-12">TRAINING COURSE</p>
@ -294,10 +308,10 @@ class ShixunsHome extends Component {
} }
</div> </div>
</div> </div>:""}
{/*精选实训 改为 开发社区*/} {/*精选实训 改为 开发社区*/}
<div className="clearfix pt20 educontent pr pb20"> {shixuntype===true?<div className="clearfix pt20 educontent pr pb20">
<div className="edu-txt-center"> <div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实训项目</p> <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实训项目</p>
<p className="color-grey-cd font-12">DEVELOPMENT COMMUNITY</p> <p className="color-grey-cd font-12">DEVELOPMENT COMMUNITY</p>
@ -389,13 +403,13 @@ class ShixunsHome extends Component {
</div> </div>
</div> </div>:""}
{/*导师排行榜*/} {/*导师排行榜*/}
{ homedatalist !== undefined && homedatalist.teachers !== undefined && ( { homedatalist !== undefined && homedatalist.teachers !== undefined && (
<div className="pt60 pb60 mb30 mentor-ranking"> this.props.user&&this.props.user.main_site===true?<div className="pt60 pb60 mb30 mentor-ranking">
<div className="educontent"> <div className="educontent">
<div className="edu-txt-center"> <div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>导师排行榜</p> <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>导师排行榜</p>
@ -470,12 +484,12 @@ class ShixunsHome extends Component {
</div> </div>
</div> </div>:""
)} )}
{/*程序员排行榜*/} {/*程序员排行榜*/}
{ homedatalist !== undefined && homedatalist.students !== undefined && ( { homedatalist !== undefined && homedatalist.students !== undefined && (
<div className="pt60 pb60 mb30 pro-ranking"> this.props.user&&this.props.user.main_site===true?<div className="pt60 pb60 mb30 pro-ranking">
<div className="educontent"> <div className="educontent">
<div className="edu-txt-center"> <div className="edu-txt-center">
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>程序员排行榜</p> <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>程序员排行榜</p>
@ -546,7 +560,7 @@ class ShixunsHome extends Component {
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>:""
)} )}
</div> </div>
</Spin> </Spin>

@ -876,7 +876,7 @@ submittojoinclass=(value)=>{
// console.log(mygetHelmetapi2); // console.log(mygetHelmetapi2);
// console.log("NewHeadermygetHelmetapi123123123123"); // console.log("NewHeadermygetHelmetapi123123123123");
// console.log(mygetHelmetapi2); // console.log(mygetHelmetapi2);
// console.log(this.props);
return ( return (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
@ -1244,12 +1244,12 @@ submittojoinclass=(value)=>{
{/*href="https://www.educoder.net/login"*/} {/*href="https://www.educoder.net/login"*/}
<div className="fr head-right"> <div className="fr head-right">
{/*{ loadHeader()}*/} {/*{ loadHeader()}*/}
{showSearchOpentype===true?"":<a id="search-open" className="fl mr30 headIcon" onClick={(e)=>this.showSearchOpen(e)}> {showSearchOpentype===true?"":this.props.user&&this.props.user.main_site===true?<a id="search-open" className="fl mr30 headIcon" onClick={(e)=>this.showSearchOpen(e)}>
{/*"/images/educoder/icon/search.svg" {/*"/images/educoder/icon/search.svg"
<img src={getImageUrl(`images/educoder/icon/search.svg`)} /> */} <img src={getImageUrl(`images/educoder/icon/search.svg`)} /> */}
<i className="iconfont icon-sousuo color-white"></i> <i className="iconfont icon-sousuo color-white"></i>
</a>} </a>:""}
{/*</div>*/} {/*</div>*/}
<div className="fl mr30 edu-menu-panel headIcon"> <div className="fl mr30 edu-menu-panel headIcon">

@ -216,5 +216,6 @@ body>.-task-title {
.logoimg{ .logoimg{
float: left; float: left;
width: 40px; min-width: 40px;
height:40px;
} }

@ -118,7 +118,7 @@ class TPMRightSection extends Component {
} }
<div className="padding20 edu-back-white mb10 mt10" style={{ {this.props.user&&this.props.user.main_site===true?<div className="padding20 edu-back-white mb10 mt10" style={{
display: TPMRightSectionData === undefined?"none":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block" display: TPMRightSectionData === undefined?"none":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "none" : "block"
}}> }}>
<p className="mb20 font-16 clearfix">所属课程</p> <p className="mb20 font-16 clearfix">所属课程</p>
@ -159,10 +159,10 @@ class TPMRightSection extends Component {
}) })
} }
</div> </div>
</div> </div>:""}
{TPMRightSectionData === undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "" : {TPMRightSectionData === undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "" :
<div className="padding20 edu-back-white" this.props.user&&this.props.user.main_site===true?<div className="padding20 edu-back-white"
style={{ style={{
display: display:
TPMRightSectionData === undefined?"none":TPMRightSectionData.recommands===undefined?"none":TPMRightSectionData.recommands.length === 0 ? "none" : "block" TPMRightSectionData === undefined?"none":TPMRightSectionData.recommands===undefined?"none":TPMRightSectionData.recommands.length === 0 ? "none" : "block"
@ -191,8 +191,8 @@ class TPMRightSection extends Component {
}) })
} }
</div> </div>
</div> } </div>:""
}
</div> </div>
} }
</div> </div>

@ -34,7 +34,7 @@ class InfosBanner extends Component{
// console.log(is_current) // console.log(is_current)
// console.log(current_user) // console.log(current_user)
// console.log(current_user.is_teacher) // console.log(current_user.is_teacher)
// console.log(current_user.admin)
return( return(
<div className="bannerPanel mb60"> <div className="bannerPanel mb60">
<div className="educontent"> <div className="educontent">
@ -116,20 +116,20 @@ class InfosBanner extends Component{
{/* onClick={() => this.setState({moduleName: 'package'})}*/} {/* onClick={() => this.setState({moduleName: 'package'})}*/}
{/* to={`/users/${username}/package`}>众包</Link>*/} {/* to={`/users/${username}/package`}>众包</Link>*/}
{/*</li>*/} {/*</li>*/}
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) {this.props.user&&this.props.user.main_site===true?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}> && <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'videos'})} onClick={() => this.setState({moduleName: 'videos'})}
to={`/users/${username}/videos`}>视频</Link> to={`/users/${username}/videos`}>视频</Link>
</li>} </li>:""}
{/*自己的主页且不是学生显示题库按钮*/} {/*自己的主页且不是学生显示题库按钮*/}
{(is_current && current_user&& current_user.is_teacher ) {this.props.user&&this.props.user.main_site===true?(is_current && current_user&& current_user.is_teacher )
&&<li className={`${moduleName == 'topics' ? 'active' : '' }`}> &&<li className={`${moduleName == 'topics' ? 'active' : '' }`}>
<Link <Link
onClick={() => this.setState({moduleName: 'topics'})} onClick={() => this.setState({moduleName: 'topics'})}
to={`/users/${username}/topics/personal`}>题库</Link> to={`/users/${username}/topics/personal`}>题库</Link>
</li>} </li>:""}
</div> </div>
</div> </div>

Loading…
Cancel
Save