fix(ui): 调整容器高度为100vh并优化格口打开错误处理

修改产品容器高度从calc(100vh - 150px)为100vh以解决布局问题
在格口打开失败时增加错误提示和更长的显示时间
This commit is contained in:
dzq 2026-01-04 15:06:46 +08:00
parent 37b0a4522f
commit 9e5e175018
3 changed files with 21 additions and 10 deletions

View File

@ -203,15 +203,23 @@ async function performOpenByPassword(password: string, action: 'deposit' | 'retr
transitionTo({ type: 'processing', action }) transitionTo({ type: 'processing', action })
try { try {
await openByPassword({ const res = await openByPassword({
shopId: props.shopId, shopId: props.shopId,
password: String(password) password: String(password)
}) })
if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '格口已打开', title: '格口已打开',
icon: 'success' icon: 'success'
}) })
} else {
console.error('打开格口失败:', res)
uni.showToast({
title: '密码错误',
icon: 'error',
duration: 5000
})
}
// //
await refresh() await refresh()
@ -220,7 +228,7 @@ async function performOpenByPassword(password: string, action: 'deposit' | 'retr
uni.showToast({ uni.showToast({
title: (error as any)?.message || '操作失败', title: (error as any)?.message || '操作失败',
icon: 'error', icon: 'error',
duration: 3000 duration: 5000
}) })
} finally { } finally {
transitionTo({ type: 'idle' }) transitionTo({ type: 'idle' })

View File

@ -228,7 +228,8 @@ function handleCheckout() {
.product-container { .product-container {
display: flex; display: flex;
// height: 100%; // height: 100%;
height: calc(100vh - 150px); // height: calc(100vh - 150px);
height: 100vh;
background: #f7f8fa; background: #f7f8fa;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@ -273,7 +274,8 @@ function handleCheckout() {
.product-list { .product-list {
flex: 1; flex: 1;
height: calc(100vh - 150px); // height: calc(100vh - 150px);
height: 100vh;
padding: 10px; padding: 10px;
background: #ffffff; background: #ffffff;
} }

View File

@ -192,7 +192,8 @@ function switchCellImage(cellType: number) {
<style scoped lang="scss"> <style scoped lang="scss">
.product-container { .product-container {
display: flex; display: flex;
height: calc(100vh - 150px); // height: calc(100vh - 150px);
height: 100vh;
background: #f7f8fa; background: #f7f8fa;
position: relative; position: relative;
overflow: hidden; overflow: hidden;