优化入仓码查询入口与卡片交互

This commit is contained in:
2026-11-04 19:37:17 +08:00
parent f17f355366
commit a9404f01e2
9 changed files with 407 additions and 53 deletions
+21
View File
@@ -1,5 +1,26 @@
// Shared controls for the customer page and service workspace.
var SupportUI = {
async copyText(text){
try{
if(navigator.clipboard && navigator.clipboard.writeText){
await navigator.clipboard.writeText(text);
return true;
}
}catch(error){}
const field = document.createElement('textarea');
field.value=text; field.readOnly=true;
field.style.position='fixed'; field.style.opacity='0';
const previous=document.activeElement;
document.body.appendChild(field);
try{
field.focus({preventScroll:true}); field.select();
return Boolean(document.execCommand('copy'));
}catch(error){ return false; }
finally{
field.remove();
if(previous && previous.isConnected) previous.focus({preventScroll:true});
}
},
initAttachments(container, label){
container.addEventListener('error', function(event){
const image = event.target;