From b1f46835b2ee0c63cdad97e8117d9e2ceea7e7c0 Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Thu, 27 Aug 2026 16:42:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/picking/picking.vue | 15 ++------------- styles/pda.scss | 24 ++++++++++++++---------- tests/picking-compact-layout.test.mjs | 21 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 23 deletions(-) create mode 100644 tests/picking-compact-layout.test.mjs diff --git a/pages/picking/picking.vue b/pages/picking/picking.vue index cb87fd3..e7155c1 100644 --- a/pages/picking/picking.vue +++ b/pages/picking/picking.vue @@ -40,7 +40,6 @@ - 支持硬件广播扫码,也可点击输入后按“完成”确认 {{ lastScanResult.type === 'success' ? '✓' : '!' }} @@ -58,18 +57,8 @@ 拣货进度 - - - - - + 已处理 {{ summary.processed }}/{{ summary.total }} 箱 + diff --git a/styles/pda.scss b/styles/pda.scss index badb5cd..a2bd6e6 100644 --- a/styles/pda.scss +++ b/styles/pda.scss @@ -415,8 +415,6 @@ gap: 10px; } - .scan-hardware-tip { display: block; margin-top: 9px; color: #41668f; font-size: 11px; font-weight: 600; line-height: 17px; } - .last-scan { display: flex; align-items: center; @@ -441,31 +439,37 @@ .progress-section { margin: 0 12px 10px; - padding: 13px 14px; + padding: 10px 12px; border-radius: 12px; background: $card; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); } .progress-header { - align-items: flex-start; + align-items: center; justify-content: space-between; - gap: 10px; + gap: 8px; } .progress-title { + flex-shrink: 0; font-size: 14px; font-weight: 700; } .progress-stats { color: $text-secondary; - font-size: 12px; + font-size: 11px; text-align: right; + white-space: nowrap; } - .progress-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; } - .box-tasks-btn { height: 48px; padding: 0 12px; border: 1px solid #cdd9e7; border-radius: 8px; color: #3f5f81; font-size: 12px; line-height: 46px; background: #f7faff; } + .progress-actions { display: flex; min-width: 0; flex: 1; align-items: center; justify-content: flex-end; gap: 8px; } + .box-tasks-btn { display: flex; height: 40px; flex-shrink: 0; align-items: center; gap: 3px; padding: 0 9px 0 11px; border: 0; border-radius: 999px; color: #245c9c; font-size: 11px; line-height: 40px; background: #edf5ff; } + .box-tasks-btn::after { border: 0; } + .box-tasks-btn:active { color: #0f4f9b; background: #dcecff; } + .box-tasks-count { color: $primary; font-weight: 700; } + .box-tasks-arrow { margin-left: 1px; color: $primary; font-size: 16px; line-height: 16px; } .progress-number { color: $success; @@ -474,8 +478,8 @@ .progress-bar-bg { overflow: hidden; - height: 7px; - margin-top: 10px; + height: 5px; + margin-top: 8px; border-radius: 999px; background: #e5e7eb; } diff --git a/tests/picking-compact-layout.test.mjs b/tests/picking-compact-layout.test.mjs new file mode 100644 index 0000000..9c604de --- /dev/null +++ b/tests/picking-compact-layout.test.mjs @@ -0,0 +1,21 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readFile } from 'node:fs/promises' + +const read = (path) => readFile(new URL(path, import.meta.url), 'utf8') + +test('picking header omits persistent scanner help and keeps progress compact', async () => { + const [page, styles] = await Promise.all([ + read('../pages/picking/picking.vue'), + read('../styles/pda.scss') + ]) + + assert.doesNotMatch(page, /支持硬件广播扫码,也可点击输入后按“完成”确认/) + assert.doesNotMatch(styles, /\.scan-hardware-tip/) + assert.match(page, /已处理[\s\S]*?summary\.processed[\s\S]*?summary\.total[\s\S]*?>柜次<[\s\S]*?box-tasks-count[\s\S]*?completedCount[\s\S]*?boxes\.length[\s\S]*?box-tasks-arrow/) + assert.match(styles, /\.progress-section \{[^}]*padding: 10px 12px/) + assert.match(styles, /\.progress-actions \{[^}]*align-items: center;[^}]*gap: 8px/) + assert.match(styles, /\.box-tasks-btn \{[^}]*height: 40px;[^}]*border: 0;[^}]*border-radius: 999px/) + assert.match(styles, /\.box-tasks-count \{[^}]*font-weight: 700;/) + assert.match(styles, /\.progress-bar-bg \{[^}]*height: 5px;[^}]*margin-top: 8px/) +})