copy(){
var input = document.createElement('input');
input.setAttribute('id', 'copyInput');
input.setAttribute('value', this.inviteCode);
document.getElementsByTagName('body')[0].appendChild(input);
document.getElementById('copyInput').select();
if (document.execCommand('copy')) {
Toast('复制成功',500);
duration = isNaN(500) ? 2000 : 500;
var m = document.createElement('div');
m.innerHTML = "复制成功";
m.style.cssText = "font-family:siyuan;max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 28px;";
document.body.appendChild(m);
setTimeout(function() {
var d = 0.5;
m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
m.style.opacity = '0';
setTimeout(function() {
document.body.removeChild(m)
}, d * 1000);
}, duration);
}
document.getElementById('copyInput').remove();
}