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 (
方法一: 将邀请链接发送给好友
http://
{PcUrl.replace('http://', '')}/id/{data.inviteCode}
asyncSMessage('已复制')}>
方法二: 微信扫码分享
方法三: 向好友发送邀请邮件
{ this.changeData('emails', e.target.value); }} /> {success &&
邀请已发送
}
); } }