import React, {Component} from 'react'; import {BrowserRouter as Router, Route, Link} from "react-router-dom"; import axios from 'axios'; import {getImageUrl,} from "educoder"; import './TPMright.css'; import {Progress, Tooltip} from 'antd'; // import "antd/dist/antd.css"; class TPMRightSection extends Component { constructor(props) { super(props) this.state = { TPMRightSection: false, clickNewsubscripttype: false } } // componentDidMount() { // let id=this.props.match.params.shixunId; // // let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; // // axios.get(shixunsDetailsURL).then((response)=> { // if(response.status===200){ // this.setState({ // TPMRightSectionData: response.data // }); // } // }).catch((error)=>{ // console.log(error) // }); // } // shouldComponentUpdate(nextProps, nextState) { // return nextProps.TPMRightSectionData !== this.state.TPMRightSectionData // } clickNewsubscript = (val) => { if (val === 0) { this.setState({ TPMRightSection: true, clickNewsubscripttype: true }) } else { this.setState({ TPMRightSection: false, clickNewsubscripttype: false }) } } render() { let {TPMRightSection, clickNewsubscripttype} = this.state; let {TPMRightSectionData} = this.props let Progresssum; if(TPMRightSectionData&&TPMRightSectionData.complete_count!=null){ Progresssum=(parseInt(TPMRightSectionData&&TPMRightSectionData.complete_count) / parseInt(TPMRightSectionData&&TPMRightSectionData.challenge_count))*100; } // console.log(this.props&&this.props.is_jupyter===true) return (
{ TPMRightSectionData === undefined ? "" :

创建者

头像
{TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : TPMRightSectionData.creator.name}
共发布实训 {TPMRightSectionData.user_shixuns_count}
{/*
*/} {/* 发布实训项目*/} {/* /!*粉丝 {TPMRightSectionData.fans_count}*!/*/} {/* /!* 取消关注 *!/*/} {/*
*/}
{this.props&&this.props.is_jupyter===true?"":this.props&&this.props.status>1?
学习统计 已完成 {TPMRightSectionData&&TPMRightSectionData.complete_count===null?0:TPMRightSectionData&&TPMRightSectionData.complete_count} 个 / 共 {TPMRightSectionData&&TPMRightSectionData.challenge_count} 关
:""} { TPMRightSectionData === undefined ? "" : TPMRightSectionData.tags === undefined ? "" : TPMRightSectionData.tags.length === 0 ? "" :

技能标签 已获得 {TPMRightSectionData&&TPMRightSectionData.user_tag_count} 个 / 共 {TPMRightSectionData&&TPMRightSectionData.tag_count} 个

{TPMRightSectionData.tags.map((item, key) => { return ( {item.tag_name} ) }) }
15 && clickNewsubscripttype === false ? "textcenter color-grey-9 mt20 rightjinengs" : "none"} onClick={() => this.clickNewsubscript(0)}>

展开全部

this.clickNewsubscript(1)}>

收起全部

}

所属课程

{ TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.map((i, k) => { if(k>2){ }else{ return (
实训
{i.name}

{i.stages_count} {/**/} {/*{i.score_count}*/} {/**/} {i.members_count}

) } }) }
{TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.length === 0 ? "" : this.props.user && this.props.user.main_site === true ?

推荐实训

{ TPMRightSectionData === undefined ? "" : TPMRightSectionData.recommands === undefined ? "" : TPMRightSectionData.recommands.map((item, key) => { if(key>2){ }else{ return (
69?1526971094
{item.name}

{item.stu_num} 人学习 {item.level}

) } }) }
: "" }
}
) } } export default TPMRightSection;