From df8d0d7c254b4260be78610643989cd2d0cb9bf5 Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Wed, 10 Dec 2025 20:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=91=A8?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9=E5=99=A8=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除CSS :has()选择器(兼容性问题) - 改用JavaScript控制.selected类 - 添加点击事件处理器 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- templates/index.html | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/templates/index.html b/templates/index.html index cb28864..9fa9b43 100644 --- a/templates/index.html +++ b/templates/index.html @@ -204,9 +204,9 @@ .modal-footer { padding: 16px 24px; border-top: 1px solid var(--md-divider); display: flex; justify-content: flex-end; gap: 8px; } .weekday-selector { display: flex; flex-wrap: wrap; gap: 8px; } - .weekday-chip { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--md-divider); border-radius: 999px; cursor: pointer; transition: all 0.2s; font-size: 13px; } - .weekday-chip:has(input:checked) { background: var(--md-primary); border-color: var(--md-primary); color: white; } - .weekday-chip input { display: none; } + .weekday-chip { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--md-divider); border-radius: 999px; cursor: pointer; transition: all 0.2s; font-size: 13px; user-select: none; } + .weekday-chip.selected { background: var(--md-primary); border-color: var(--md-primary); color: white; } + .weekday-chip input { position: absolute; opacity: 0; pointer-events: none; } .account-select-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--md-divider); border-radius: 4px; } .account-select-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--md-divider); } @@ -724,6 +724,15 @@ checkAccountLimit(); setInterval(loadStats, 30000); setupImagePreviewEvents(); + // 周日期选择器点击事件 + document.querySelectorAll('#weekdaySelector .weekday-chip').forEach(function(chip) { + chip.addEventListener('click', function(e) { + e.preventDefault(); + var input = this.querySelector('input'); + input.checked = !input.checked; + this.classList.toggle('selected', input.checked); + }); + }); }); function initTabs() { @@ -1270,7 +1279,10 @@ document.getElementById('scheduleBrowseType').value = scheduleData ? (scheduleData.browse_type || '应读') : '应读'; document.getElementById('scheduleScreenshot').checked = scheduleData ? (scheduleData.enable_screenshot !== 0) : true; const weekdays = scheduleData ? (scheduleData.weekdays || '').split(',') : ['1','2','3','4','5']; - document.querySelectorAll('#weekdaySelector input').forEach(function(input) { input.checked = weekdays.includes(input.value); }); + document.querySelectorAll('#weekdaySelector input').forEach(function(input) { + input.checked = weekdays.includes(input.value); + input.parentElement.classList.toggle('selected', input.checked); + }); const selectedAccountIds = scheduleData ? (scheduleData.account_ids || []) : []; let accountListHtml = ''; Object.values(accounts).forEach(function(acc) {