dev_sync_trustie
杨树明 5 years ago
parent 03230f3e18
commit b48bd3aabb

@ -17,7 +17,8 @@ class CompetitionCommon extends Component{
this.state={ this.state={
data:undefined, data:undefined,
bannerdata:undefined, bannerdata:undefined,
module_type:undefined module_type:undefined,
mdContentdata:undefined
} }
} }
@ -69,7 +70,7 @@ class CompetitionCommon extends Component{
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
this.setState({ this.setState({
mdContent:response.data mdContentdata:response.data
}) })
} }
}).catch((error) => { }).catch((error) => {
@ -80,7 +81,7 @@ class CompetitionCommon extends Component{
} }
render() { render() {
let {data,bannerdata,module_type,module_id,mdContent}=this.state; let {data,bannerdata,module_type,module_id,mdContentdata}=this.state;
console.log(module_type) console.log(module_type)
return ( return (
data===undefined?"":<div className={"educontent clearfix mt20 "}> data===undefined?"":<div className={"educontent clearfix mt20 "}>

@ -21,15 +21,18 @@ class CompetitionContents extends Component{
render() { render() {
let{mdContent}=this.props; let{mdContentdata}=this.props;
//
return ( return (
<div className={"fr"}> <div className={"fr"}>
<Button className={"fr"} type="primary" ghost> {this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?<Button className={"fr"} type="primary" ghost>
编辑 编辑
</Button> </Button>:""}
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("").replace(/▁/g, "▁▁▁")}}> <div className={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?"mt50":""}>
</Content> <Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(mdContentdata&&mdContentdata.md_contents[0]).replace(/▁/g, "▁▁▁")}}>
</Content>
</div>
</div> </div>
) )

@ -86,7 +86,7 @@ class CompetitionContents extends Component{
return ( return (
<div> <div>
<Tabs tabBarExtraContent={operations}> <Tabs tabBarExtraContent={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?operations:""}>
<TabPane tab="总排行榜" key="1"> <TabPane tab="总排行榜" key="1">
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("Content of tab 1").replace(/▁/g, "▁▁▁")}}> <Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML("Content of tab 1").replace(/▁/g, "▁▁▁")}}>
</Content> </Content>

Loading…
Cancel
Save