let H5copyLink = () => {
if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
window.getSelection().removeAllRanges();
var Url2 = document.getElementById("copy");
var range = document.createRange();
range.selectNode(Url2);
window.getSelection().addRange(range);
var successful = document.execCommand("copy");
window.getSelection().removeAllRanges();
} else {
let inputZ = document.createElement("input");
inputZ.setAttribute("id", "inputCopy");
inputZ.value = con;
document.body.appendChild(inputZ);
document.getElementById("inputCopy").select();
try {
document.execCommand("Copy");
uni.showToast({
title: "复制成功",
duration: 3000
});
} catch (err) {
uni.showToast({
title: "此设备暂不支持复制操作,您可以长按文本内容选择复制",
duration: 2000
});
}
document.body.removeChild(inputZ);
}
return;
};
H5copyLink(con);