From 8108f5520ebd9610627dc812b4bfcd47646d3d40 Mon Sep 17 00:00:00 2001 From: zhangyan Date: Mon, 27 Jul 2026 11:31:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B4=B4=E6=A0=87=E7=A7=A4=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=8F=91=E8=B4=A7=E5=8A=9F=E8=83=BD=20+=20=E8=90=A5?= =?UTF-8?q?=E5=85=BB=E7=A7=A4=E8=AE=BE=E7=BD=AE=E9=A1=B5=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=97=AD=E9=A4=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 贴标秤:待发货/已发货Tab改造,发货弹窗支持三方配送/自主配送/商家自取 - 营养秤设置页:新增闭餐卡片与处理方式选择弹窗(捐赠/员工福利/废弃/加工再利用) - 营养秤导航页:修复营养秤卡片缺图标和名称的样式问题 Co-Authored-By: Claude Opus 4.6 --- .../canteen-nutrition-scale/04-settings.html | 177 +++++++++- .../canteen-nutrition-scale/doc/CHANGELOG.md | 13 +- .../01-orders.html | 305 ++++++++++++++++-- .../doc/CHANGELOG.md | 11 + other-module/canteen-device/index.html | 4 +- 5 files changed, 487 insertions(+), 23 deletions(-) diff --git a/other-module/canteen-device/canteen-nutrition-scale/04-settings.html b/other-module/canteen-device/canteen-nutrition-scale/04-settings.html index 83428aa..7dd1f03 100644 --- a/other-module/canteen-device/canteen-nutrition-scale/04-settings.html +++ b/other-module/canteen-device/canteen-nutrition-scale/04-settings.html @@ -61,11 +61,14 @@ display: flex; flex-direction: column; align-items: center; - justify-content: center; + justify-content: flex-start; height: calc(100% - 44px); gap: 24px; padding: 24px; + overflow-y: auto; + scrollbar-width: none; } + .main-content::-webkit-scrollbar { display: none; } /* ---- 按钮卡片 ---- */ .settings-card { @@ -177,6 +180,36 @@ color: #fff; } + /* ===== 闭餐弹窗 — 处理方式选择 ===== */ + .disposal-option-group { display: flex; flex-direction: column; gap: 10px; } + .disposal-option { + display: flex; align-items: center; gap: 12px; + padding: 12px 16px; border-radius: 8px; + border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); + cursor: pointer; transition: all 0.2s; + } + .disposal-option:hover { border-color: rgba(74,144,217,0.3); background: rgba(74,144,217,0.05); } + .disposal-option.active { border-color: #4a90d9; background: rgba(74,144,217,0.1); } + .disposal-option__radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; } + .disposal-option.active .disposal-option__radio { border-color: #4a90d9; } + .disposal-option.active .disposal-option__radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #4a90d9; } + .disposal-option__icon { font-size: 22px; flex-shrink: 0; } + .disposal-option__label { font-size: 14px; color: rgba(255,255,255,0.85); font-weight: 500; } + .disposal-option__hint { font-size: 11px; color: rgba(255,255,255,0.35); } + + /* 确认/取消按钮 */ + .modal-actions { display: flex; gap: 12px; margin-top: 0; } + .btn-confirm-danger { + flex: 1; padding: 12px; background: rgba(255,77,79,0.8); color: #fff; + border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; + } + .btn-confirm-danger:hover { background: #ff4d4f; } + + /* 系统状态标识 */ + .status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 4px; } + .status-dot--open { background: #52c41a; } + .status-dot--closed { background: rgba(255,255,255,0.3); } + /* ===== 减重弹窗 — 秤体重量显示 ===== */ .tare-weight-display { background: rgba(255, 255, 255, 0.03); @@ -318,6 +351,16 @@ + + +
+ 🛑 +
+
闭餐
+
当前状态:开餐中
+
+ +
@@ -364,6 +407,63 @@ + + +
@@ -521,6 +621,81 @@ spoonTareModal.addEventListener('click', function(e) { if (e.target === spoonTareModal) closeSpoonTareModal(); }); + + /* ===== 闭餐逻辑 ===== */ + var isMealOpen = true; + var selectedDisposal = 'donate'; + var closeMealModal = document.getElementById('closeMealModal'); + + function updateCloseMealStatus() { + var descEl = document.getElementById('closeMealStatusDesc'); + if (isMealOpen) { + descEl.innerHTML = '当前状态:开餐中'; + } else { + descEl.innerHTML = '当前状态:已闭餐'; + } + } + + function handleCloseMeal() { + if (!isMealOpen) { + showToast('未开餐设备不能执行闭餐操作'); + return; + } + selectedDisposal = 'donate'; + document.querySelectorAll('#disposalGroup .disposal-option').forEach(function(opt) { opt.classList.remove('active'); }); + var firstOpt = document.querySelector('#disposalGroup .disposal-option[data-disposal="donate"]'); + if (firstOpt) firstOpt.classList.add('active'); + closeMealModal.classList.add('active'); + } + + function closeCloseMealModal() { + closeMealModal.classList.remove('active'); + document.getElementById('closeMealRemark').value = ''; + } + + function selectDisposal(method, el) { + selectedDisposal = method; + document.querySelectorAll('#disposalGroup .disposal-option').forEach(function(opt) { opt.classList.remove('active'); }); + el.classList.add('active'); + } + + function confirmCloseMeal() { + var disposalLabels = { donate: '捐赠', welfare: '员工福利', discard: '废弃', reprocess: '加工再利用' }; + var label = disposalLabels[selectedDisposal] || selectedDisposal; + var remark = document.getElementById('closeMealRemark').value.trim(); + isMealOpen = false; + updateCloseMealStatus(); + closeCloseMealModal(); + var msg = '闭餐成功 - 处理方式:' + label; + if (remark) msg += ',备注:' + remark; + showToast(msg); + } + + closeMealModal.addEventListener('click', function(e) { + if (e.target === closeMealModal) closeCloseMealModal(); + }); + + /* 开始开餐时恢复开餐状态 */ + (function() { + var startCard = document.querySelector('.settings-card[href="01-meal-start.html"]'); + if (startCard) { + startCard.addEventListener('click', function() { + isMealOpen = true; + updateCloseMealStatus(); + /* 用 localStorage 跨页面传递状态 */ + localStorage.setItem('mealOpen', 'true'); + }); + } + })(); + + /* 页面加载时从 localStorage 恢复状态 */ + (function() { + var saved = localStorage.getItem('mealOpen'); + if (saved === 'false') { + isMealOpen = false; + updateCloseMealStatus(); + } + })(); diff --git a/other-module/canteen-device/canteen-nutrition-scale/doc/CHANGELOG.md b/other-module/canteen-device/canteen-nutrition-scale/doc/CHANGELOG.md index d0cbcc1..43c5421 100644 --- a/other-module/canteen-device/canteen-nutrition-scale/doc/CHANGELOG.md +++ b/other-module/canteen-device/canteen-nutrition-scale/doc/CHANGELOG.md @@ -1,6 +1,17 @@ # 餐线营养秤 - 变更记录 -## [2026-06-17] refactor: 全局返回路径改为三级优先级机制 +## [2026-07-27] feat: 设置页新增闭餐功能 + +### 新增 +- **闭餐卡片**(`04-settings.html`):设置页底部新增「闭餐」卡片,显示当前开餐/闭餐状态 +- **闭餐弹窗**:点击闭餐卡片弹出处理方式选择弹窗,支持四种方式:捐赠、员工福利、废弃、加工再利用,支持备注文本框 +- **状态联动**:点击"开始开餐"卡片自动恢复开餐状态,状态通过 localStorage 持久化 +- **滚动支持**:设置页 `main-content` 新增 `overflow-y: auto`,卡片过多时可滚动 + +### 调整 +- `04-settings.html` — `main-content` 的 `justify-content` 从 `center` 改为 `flex-start` + +--- [2026-06-17] refactor: 全局返回路径改为三级优先级机制 ### 调整 - **PRD 1.4 节**:返回按钮实现由 `history.back()` 改为三级优先级机制: diff --git a/other-module/canteen-device/clean-veg-packaging-labeler/01-orders.html b/other-module/canteen-device/clean-veg-packaging-labeler/01-orders.html index 7e90672..0e273b1 100644 --- a/other-module/canteen-device/clean-veg-packaging-labeler/01-orders.html +++ b/other-module/canteen-device/clean-veg-packaging-labeler/01-orders.html @@ -97,6 +97,44 @@ .toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-20px); background: rgba(0,0,0,0.85); color: #fff; padding: 12px 28px; border-radius: 8px; font-size: 13px; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s, transform 0.3s, visibility 0.3s; white-space: nowrap; pointer-events: none; } .toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); } .toast--warn { background: rgba(250,173,22,0.92); } + + /* 弹窗遮罩 */ + .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; } + .modal-overlay.show { opacity: 1; visibility: visible; } + .modal-overlay.hidden { display: none; } + + /* 弹窗 */ + .modal { background: #1a2b4a; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); width: 480px; max-height: 560px; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,0.5); } + .modal__header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); } + .modal__title { font-size: 15px; font-weight: 600; color: #fff; } + .modal__close { width: 28px; height: 28px; border-radius: 6px; background: rgba(255,255,255,0.06); border: none; color: rgba(255,255,255,0.5); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; } + .modal__close:hover { background: rgba(255,77,79,0.15); color: #ff4d4f; } + .modal__body { padding: 20px; } + .modal__footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.06); } + + /* 配送方式选择 */ + .ship-method-group { display: flex; gap: 10px; margin-bottom: 18px; } + .ship-method-option { flex: 1; padding: 12px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); text-align: center; cursor: pointer; transition: all 0.2s; } + .ship-method-option:hover { border-color: rgba(74,144,217,0.3); background: rgba(74,144,217,0.05); } + .ship-method-option.active { border-color: #4a90d9; background: rgba(74,144,217,0.1); } + .ship-method-option__icon { font-size: 24px; margin-bottom: 6px; } + .ship-method-option__label { font-size: 12px; color: rgba(255,255,255,0.7); font-weight: 500; } + .ship-method-option.active .ship-method-option__label { color: #4a90d9; } + + /* 表单字段 */ + .form-group { margin-bottom: 14px; } + .form-group__label { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 6px; display: block; } + .form-group__select, .form-group__input { width: 100%; padding: 9px 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); color: #fff; font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.2s; } + .form-group__select:focus, .form-group__input:focus { border-color: #4a90d9; } + .form-group__select option { background: #1a2b4a; color: #fff; } + + /* 按钮 */ + .btn { padding: 8px 20px; border-radius: 6px; font-size: 13px; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; font-family: inherit; } + .btn--primary { background: #4a90d9; color: #fff; } + .btn--primary:hover { background: #5ba0e9; } + .btn--cancel { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.1); } + .btn--cancel:hover { background: rgba(255,255,255,0.1); color: #fff; } + .btn:disabled { opacity: 0.4; cursor: not-allowed; } @@ -115,7 +153,8 @@
待包装 0
-
已包装 0
+
待发货 0
+
已发货 0
@@ -124,6 +163,70 @@
+ + +