diff --git a/server/public/css/style.css b/server/public/css/style.css index 5635a56..db79353 100644 --- a/server/public/css/style.css +++ b/server/public/css/style.css @@ -110,17 +110,17 @@ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans- /* 可编辑详情弹窗 */ .detail-modal { max-height: 90vh; overflow-y: auto; padding: 0; } -.detail-modal .modal-close-btn { display: none; } -.detail-header { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); color: #fff; padding: 8px 16px; display: flex; align-items: center; gap: 8px; border-radius: 12px 12px 0 0; margin: -16px -16px 0 -16px; } -.detail-header .icon-btn { flex-shrink: 0; } +.detail-modal input, .detail-modal select, .detail-modal textarea { margin: 0; } +.detail-header { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); color: #fff; padding: 8px 12px 8px 16px; display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 1; } +.detail-header .icon-btn { flex-shrink: 0; margin-left: auto; } .detail-header .icon-btn svg { stroke: #fff; } .detail-title-input { flex: 1; font-size: 18px; font-weight: 600; color: #fff; background: transparent; border: none; outline: none; padding: 4px 0; min-width: 0; } .detail-title-input::placeholder { color: rgba(255,255,255,0.6); } -.detail-title-input:focus { border-bottom: 2px solid rgba(255,255,255,0.5); } -.edit-form { padding: 12px 0 0 0; } -.edit-row { display: flex; align-items: center; margin-bottom: 6px; gap: 8px; } -.edit-row label { min-width: 48px; font-size: 13px; color: #777; text-align: right; } -.edit-row input, .edit-row select, .edit-row textarea { flex: 1; padding: 6px 8px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; outline: none; } +.detail-title-input:focus { border: none; outline: none; } +.edit-form { padding: 12px 16px 16px 16px; } +.edit-row { display: flex; align-items: center; margin-bottom: 8px; gap: 8px; } +.edit-row label { min-width: 48px; font-size: 13px; color: #777; text-align: right; flex-shrink: 0; } +.edit-row input, .edit-row select, .edit-row textarea { flex: 1; padding: 7px 8px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; outline: none; margin: 0; } .edit-row input:focus, .edit-row select:focus, .edit-row textarea:focus { border-color: #3b82f6; } .edit-row select { appearance: auto; } .edit-row textarea { resize: vertical; min-height: 40px; } @@ -137,13 +137,13 @@ details[open] .history-summary::after { content: '收起'; } .attach-gallery { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .attach-thumb-wrap { position: relative; display: inline-block; } .attach-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid #eee; } -.attach-del-btn { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #e53e3e; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; } -.attach-del-btn svg { width: 11px; height: 11px; stroke: #fff; fill: none; stroke-width: 2; } +.attach-del-btn { position: absolute; top: -4px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.5); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; } +.attach-del-btn svg { width: 10px; height: 10px; stroke: #fff; fill: none; stroke-width: 2.5; } .attach-add-btn { cursor: pointer; display: flex; align-items: center; } .attach-add-btn svg { width: 18px; height: 18px; stroke: #3b82f6; fill: none; stroke-width: 2; } -.edit-buttons { display: flex; gap: 8px; margin-top: 12px; } -.save-btn { flex: 1; background: #3b82f6; color: #fff; border: none; padding: 8px 0; border-radius: 6px; font-size: 15px; cursor: pointer; font-weight: 500; } -.danger-btn { background: transparent; color: #e53e3e; border: 1px solid #e53e3e; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; } +.edit-buttons { display: flex; margin-top: 12px; } +.save-btn { flex: 1; background: #3b82f6; color: #fff; border: none; padding: 10px 0; border-radius: 6px; font-size: 15px; cursor: pointer; font-weight: 500; } +.danger-btn { background: transparent; color: #e53e3e; border: 1px solid #e53e3e; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; flex-shrink: 0; margin-left: 8px; } .white-list-tag { font-size: 12px; diff --git a/server/public/js/purchases.js b/server/public/js/purchases.js index c45e514..0a66e39 100644 --- a/server/public/js/purchases.js +++ b/server/public/js/purchases.js @@ -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'); } diff --git a/server/public/js/store.js b/server/public/js/store.js index 7ceb524..fc6fc82 100644 --- a/server/public/js/store.js +++ b/server/public/js/store.js @@ -27,11 +27,6 @@ const Store = { logout() { if (Store.ws) { Store.ws.close(); Store.ws = null; } Store.clearAuth(); - document.getElementById('login-page').classList.remove('hidden'); - document.getElementById('main-page').classList.add('hidden'); - Store.currentRoom = null; - Store.rooms = []; - document.getElementById('chat-list-container').innerHTML = ''; - document.getElementById('messages-container').innerHTML = ''; + location.reload(); }, };