t');
console.log(toast)
wechatIds.forEach(function (wechatId) {
wechatId.addEventListener('click', function () {
const wechat = this.getAttribute('data-wechat');
// 创建临时textarea元素用于复制
const textarea = document.createElement('textarea');
textarea.value = wechat;
textarea.style.position = 'fixed';
textarea.style.opacity = 0;
document.body.appendChild(textarea);
textarea.select();
try {
var bd_vid = $('#bd_vid').val()
if (bd_vid) {
$.post('/index/copySuccess', {bd_vid}, () => {
})
}
// 执行复制命令
document.execCommand('copy');
alert('微信号已复制: ' + wechat)
// // 更新提示文本
// toast.textContent = '微信号已复制: ' + wechat;
//
// // 显示提示
// toast.classList.add('show');
// setTimeout(() => {
// toast.classList.remove('show');
// }, 1500);
} catch (err) {
console.error('复制失败:', err);
}
// 移除临时元素
document.body.removeChild(textarea);
});
});
// });
}
});
})
