import React, { Component } from 'react'; import { Redirect } from 'react-router'; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { getImageUrl, toPath } from 'educoder' import axios from 'axios'; const $ = window.$; class ShixunDiscuss extends Component { constructor(props) { super(props) this.state = { TPMRightSectionData: undefined } } getshixunsDetailsList = (id) => { let shixunsDetailsURL = `/shixuns/` + id + `/discusses.json`; axios.get(shixunsDetailsURL).then((response) => { if (response.status === 200) { this.setState({ TPMRightSectionData: response.data }); } }).catch((error) => { console.log(error) }); } componentDidMount() { let id = this.props.match.params.shixunId; setTimeout(this.getshixunsDetailsList(id), 1000); } render() { let { TPMRightSectionData } = this.state; return (
{ TPMRightSectionData===undefined?"":TPMRightSectionData.map((item,key)=>{ return(
用户头像
{item.user.name} {item.time} [第{item.round}关]

{item.content}

{ item.replies.map((i,k)=>{ return(

{i.content}

) }) }

3

调整高度
发送
) }) }
) } } export default ShixunDiscuss;