//初始化请求
componentWillMount() {
const { location } = this.props;
const parse = queryString.parse(location.search.replace('?', ''));
this.setState({ id: parseFloat(parse.id) })
}
//页面挂载请求
componentDidMount(){
home.Gonggao({id:this.state.id}).then((result)=>{
if(result.code===1){
this.setState({
data:result.data[0]
})
}else{Toast.offline(result.msg,1)}
})
}