完善截图和分析流程

This commit is contained in:
Zylan
2025-03-06 14:45:52 +08:00
parent 33cf23d462
commit 80d79375de
8 changed files with 1352 additions and 685 deletions

View File

@@ -47,6 +47,16 @@ class UIManager {
}
showToast(message, type = 'success') {
// 检查是否已经存在相同内容的提示
const existingToasts = this.toastContainer.querySelectorAll('.toast');
for (const existingToast of existingToasts) {
const existingMessage = existingToast.querySelector('span').textContent;
if (existingMessage === message) {
// 已经存在相同的提示,不再创建新的
return;
}
}
const toast = document.createElement('div');
toast.className = `toast ${type}`;
toast.innerHTML = `
@@ -55,10 +65,13 @@ class UIManager {
`;
this.toastContainer.appendChild(toast);
// 为不同类型的提示设置不同的显示时间
const displayTime = message === '截图成功' ? 1500 : 3000;
setTimeout(() => {
toast.style.opacity = '0';
setTimeout(() => toast.remove(), 300);
}, 3000);
}, displayTime);
}
closeAllPanels() {