From c7963cec6ee00b51b1f677450dac16eaeab0370e Mon Sep 17 00:00:00 2001
From: Zhukj <3262118957>
Date: Sat, 25 Apr 2026 16:51:27 +0800
Subject: [PATCH] =?UTF-8?q?feat(qr):=20=E6=B7=BB=E5=8A=A0=E4=BA=8C?=
=?UTF-8?q?=E7=BB=B4=E7=A0=81=E5=B7=A5=E5=85=B7=E6=A0=8F=E5=B9=B6=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E4=BA=A4=E4=BA=92=E4=BD=93=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
添加二维码编辑工具栏,支持透明度和缩放调整
优化选中状态和拖拽交互,增强用户体验
重构代码结构,提高可维护性
---
css/qr.css | 29 +++-
index.html | 14 ++
js/qr.js | 381 ++++++++++++++++++++++++++++++++++++++-------------
js/script.js | 38 ++++-
4 files changed, 363 insertions(+), 99 deletions(-)
diff --git a/css/qr.css b/css/qr.css
index fe0dc40..900b6a9 100644
--- a/css/qr.css
+++ b/css/qr.css
@@ -1,6 +1,6 @@
/* 二维码功能样式 */
-/* 悬浮按钮 */
+/* ========== 悬浮按钮 ========== */
#qr-btn {
position: fixed;
bottom: 100px;
@@ -29,7 +29,7 @@
background: #3a7bc8;
}
-/* 弹窗 */
+/* ========== 弹窗 ========== */
#qr-modal {
display: none;
position: fixed;
@@ -128,9 +128,32 @@
color: #fff;
}
-/* 画布上的二维码 */
+/* ========== 画布上的二维码 ========== */
.qr-item {
position: absolute;
cursor: move;
user-select: none;
+ touch-action: none;
+}
+
+/* 选中状态 */
+.qr-item.qr-selected {
+ outline: 2px solid #4a90e2;
+ outline-offset: 2px;
+}
+
+/* ========== 二维码工具栏 - 与背景图工具栏保持一致 ========== */
+.qr-tools {
+ display: none;
+}
+
+.qr-tools.active {
+ display: flex;
+}
+
+/* 数值显示固定宽度,单独占位 */
+#qrOpacityValue, #qrScaleValue {
+ display: inline-block;
+ min-width: 40px;
+ text-align: center;
}
diff --git a/index.html b/index.html
index b6d58ce..8535679 100644
--- a/index.html
+++ b/index.html
@@ -74,6 +74,20 @@
+
+