提交 31a19c40 authored 作者: lidongxu's avatar lidongxu

refactor(inspectiontask): 修改:取消右上角复制地址功能

上级 a87d39ff
......@@ -3,8 +3,6 @@
<div class="wrap">
<van-nav-bar left-arrow
left-text="返回"
right-text="去浏览器打开"
@click-right="handleCopyAddress"
@click-left="router.back()">
</van-nav-bar>
<div class="content">
......@@ -488,35 +486,6 @@ const deleteLongTimePictureArr = async (file, { name, index }) => {
})
showNotify({ type: 'success', message: '大日期产品照片,删除成功' })
}
// 右上角 浏览器打开
const handleCopyAddress = async () => {
const url = window.location.href
try {
// 使用现代的 Clipboard API
if (navigator.clipboard && window.isSecureContext) {
await navigator.clipboard.writeText(url);
showToast('地址已复制,请到浏览器粘贴');
} else {
// 降级方案:使用传统的document.execCommand
const textArea = document.createElement('textarea');
textArea.value = url;
textArea.style.position = 'fixed';
textArea.style.left = '-999999px';
textArea.style.top = '-999999px';
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
document.body.removeChild(textArea);
showToast('地址已复制,请到浏览器粘贴');
}
} catch (error) {
console.error('复制地址失败:', error);
showToast('复制地址失败,请联系技术中心-李东旭');
}
}
</script>
<style scoped
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论