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 {Icon, 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 console.log(this.props) return (
{ TPMRightSectionData === undefined ? "" :

创建者

头像
{TPMRightSectionData === undefined ? "" : TPMRightSectionData.creator === undefined ? "" : TPMRightSectionData.creator.name}
{TPMRightSectionData.user_shixuns_count}
发布实训项目 {/*粉丝 {TPMRightSectionData.fans_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) => { 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) => { return (
69?1526971094
{item.name}

{item.stu_num} 人学习

{item.level}

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