From 21c2410b2055a2372826833b41b78bd5d3d20c67 Mon Sep 17 00:00:00 2001 From: Default User Date: Fri, 6 Feb 2026 11:07:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E6=97=B6=E9=97=B4=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E7=9A=84=E7=82=B9=E5=87=BB=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E6=95=B4=E4=B8=AA=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supply.html | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/supply.html b/supply.html index 2d54f25..1996058 100644 --- a/supply.html +++ b/supply.html @@ -671,6 +671,84 @@ border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; + cursor: pointer; + width: 100%; + box-sizing: border-box; + /* 确保点击区域覆盖整个输入框 */ + position: relative; + z-index: 1; + } + + /* 确保日期输入框的日历图标覆盖整个输入框 */ + .datetime-picker-group input[type="date"] { + /* 针对不同浏览器的样式调整 */ + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + } + + /* 针对WebKit浏览器(Chrome, Safari) */ + .datetime-picker-group input[type="date"]::-webkit-calendar-picker-indicator { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + width: 100%; + height: 100%; + cursor: pointer; + opacity: 0; + z-index: 2; + } + + /* 针对Firefox浏览器 */ + .datetime-picker-group input[type="date"]::-moz-calendar-picker-indicator { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + width: 100%; + height: 100%; + cursor: pointer; + opacity: 0; + z-index: 2; + } + + /* 确保时间输入框的时钟图标覆盖整个输入框 */ + .datetime-picker-group input[type="time"] { + /* 针对不同浏览器的样式调整 */ + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + } + + /* 针对WebKit浏览器(Chrome, Safari) */ + .datetime-picker-group input[type="time"]::-webkit-calendar-picker-indicator { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + width: 100%; + height: 100%; + cursor: pointer; + opacity: 0; + z-index: 2; + } + + /* 针对Firefox浏览器 */ + .datetime-picker-group input[type="time"]::-moz-calendar-picker-indicator { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + width: 100%; + height: 100%; + cursor: pointer; + opacity: 0; + z-index: 2; } /* 日期时间选择器底部 */ @@ -2463,6 +2541,28 @@ // 添加到容器中 container.appendChild(picker); + // 为日期和时间输入框添加点击事件,确保点击整个输入框都能触发选择器 + setTimeout(() => { + const dateInput = document.getElementById('pickerDate'); + const timeInput = document.getElementById('pickerTime'); + + if (dateInput) { + dateInput.style.cursor = 'pointer'; + dateInput.addEventListener('click', function(e) { + // 阻止事件冒泡,防止关闭选择器 + e.stopPropagation(); + }); + } + + if (timeInput) { + timeInput.style.cursor = 'pointer'; + timeInput.addEventListener('click', function(e) { + // 阻止事件冒泡,防止关闭选择器 + e.stopPropagation(); + }); + } + }, 0); + // 点击其他地方关闭选择器 document.addEventListener('click', function closePicker(e) { if (!picker.contains(e.target) && e.target !== input && e.target !== input.nextElementSibling) {