From 9e5e175018127fe96088be6690e251870c01de33 Mon Sep 17 00:00:00 2001 From: dzq Date: Sun, 4 Jan 2026 15:06:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E8=B0=83=E6=95=B4=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E4=B8=BA100vh=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=A0=BC=E5=8F=A3=E6=89=93=E5=BC=80=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改产品容器高度从calc(100vh - 150px)为100vh以解决布局问题 在格口打开失败时增加错误提示和更长的显示时间 --- .../storage-cells-summary/index.vue | 22 +++++++++++++------ .../index/components/product-container.vue | 6 +++-- .../components/renting-cabinet-container.vue | 3 ++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/components/storage-cells-summary/index.vue b/src/components/storage-cells-summary/index.vue index b7558c0..1bfd019 100644 --- a/src/components/storage-cells-summary/index.vue +++ b/src/components/storage-cells-summary/index.vue @@ -203,15 +203,23 @@ async function performOpenByPassword(password: string, action: 'deposit' | 'retr transitionTo({ type: 'processing', action }) try { - await openByPassword({ + const res = await openByPassword({ shopId: props.shopId, password: String(password) }) - - uni.showToast({ - title: '格口已打开', - icon: 'success' - }) + if (res.code === 0) { + uni.showToast({ + title: '格口已打开', + icon: 'success' + }) + } else { + console.error('打开格口失败:', res) + uni.showToast({ + title: '密码错误', + icon: 'error', + duration: 5000 + }) + } // 刷新数据 await refresh() @@ -220,7 +228,7 @@ async function performOpenByPassword(password: string, action: 'deposit' | 'retr uni.showToast({ title: (error as any)?.message || '操作失败', icon: 'error', - duration: 3000 + duration: 5000 }) } finally { transitionTo({ type: 'idle' }) diff --git a/src/pages/index/components/product-container.vue b/src/pages/index/components/product-container.vue index ee82199..65c0384 100644 --- a/src/pages/index/components/product-container.vue +++ b/src/pages/index/components/product-container.vue @@ -228,7 +228,8 @@ function handleCheckout() { .product-container { display: flex; // height: 100%; - height: calc(100vh - 150px); + // height: calc(100vh - 150px); + height: 100vh; background: #f7f8fa; position: relative; overflow: hidden; @@ -273,7 +274,8 @@ function handleCheckout() { .product-list { flex: 1; - height: calc(100vh - 150px); + // height: calc(100vh - 150px); + height: 100vh; padding: 10px; background: #ffffff; } diff --git a/src/pages/index/components/renting-cabinet-container.vue b/src/pages/index/components/renting-cabinet-container.vue index c6c59c7..3ad7b0c 100644 --- a/src/pages/index/components/renting-cabinet-container.vue +++ b/src/pages/index/components/renting-cabinet-container.vue @@ -192,7 +192,8 @@ function switchCellImage(cellType: number) {