import React, { Component } from 'react'; import { CopyToClipboard } from 'react-copy-to-clipboard'; import './index.less'; import Assets from '@src/components/Assets'; import { asyncSMessage } from '@src/services/AsyncTools'; import { Icon } from 'antd'; import Button from '../Button'; import { Input } from '../Login'; import { Main } from '../../stores/main'; import { My } from '../../stores/my'; import { PcUrl, H5Url } from '../../../Constant'; export default class Invite extends Component { constructor(props) { super(props); this.state = { data: this.props.data || {}, qr: Main.qrCode(`${H5Url}/id/${(this.props.data || {}).inviteCode}`) }; } changeData(field, value) { let { data } = this.state; data = data || {}; data[field] = value; this.setState({ data, error: null }); } send() { const { data } = this.state; if (!data.emails) return; My.inviteEmail(data.emails.replace(/;/g, ';').split(';')) .then(() => { data.emails = ''; this.setState({ success: true, data }); }); } render() { const { data } = this.props; const { success, qr } = this.state; return (