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 })
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' })

View File

@ -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;
}

View File

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