This commit is contained in:
2026-07-28 18:05:08 +08:00
parent 24bfe66773
commit 3f9f95b5ef
3 changed files with 22 additions and 20 deletions

View File

@@ -80,7 +80,14 @@ async function openDetail(pid) {
// 删除按钮仅管理员可见
const isAdmin = localStorage.getItem('isAdmin') === 'true';
document.getElementById('delete-purchase-btn').style.display = isAdmin ? '' : 'none';
const delBtn = document.getElementById('delete-purchase-btn');
if (isAdmin) {
delBtn.style.display = '';
delBtn.style.marginLeft = '';
} else {
delBtn.style.display = 'none';
delBtn.style.marginLeft = '0';
}
document.getElementById('detail-modal').classList.remove('hidden');
}