import React from 'react'; import PropTypes from 'prop-types'; import { List, Card } from "antd"; import axios from 'axios'; import { getImageUrl } from 'educoder'; import './Cooperatives.css'; class Cooperatives extends React.Component { constructor (props) { super(props); this.state = { loading: true, data: [ { name: "产学联盟" }, { name: "知名企业" }, { name: "各类院校" } ] } } componentDidMount(){ window.document.title = "合作伙伴"; this.getCooperatives(); } getCooperatives(){ axios.get("/helps/cooperatives.json").then((result) => { if(result){ this.setState({ data: result.data.data, loading: false }) } }).catch((error) => { console.log(error); this.setState({ loading: false }); }) } render() { let { loading, data } = this.state; return (
{ data && data.length > 0 && data.map((item, _key) => { return (
{ item.name }
( )} />
) }) }
) } } export default Cooperatives;