import React from 'react'; import PropTypes from 'prop-types'; import { Card, Row, Col } from "antd"; import axios from 'axios'; import './ContactUs.css'; class ContactUs extends React.Component { constructor (props) { super(props); this.state = { loading: true, contacts: null, address: null } } componentDidMount(){ window.document.title = "联系我们"; this.getData(); } getData(){ axios.get("/helps/contact.json").then((result) => { if(result){ this.setState({ contacts: result.data.contacts, address: result.data.address, loading: false }) } }).catch((error) => { console.log(error); this.setState({ loading: false }); }) } render() { let { loading, contacts, address } = this.state; return (
{ contacts && contacts.map((item, _key) => { return (
{ item.type }
{ item.name } QQ: { item.qq } Email: { item.mail }
) }) } { address && (
公司地址
{ address }
) }
) } } export default ContactUs;