fix(ui): 调整容器高度为100vh并优化格口打开错误处理
修改产品容器高度从calc(100vh - 150px)为100vh以解决布局问题 在格口打开失败时增加错误提示和更长的显示时间
This commit is contained in:
parent
37b0a4522f
commit
9e5e175018
|
|
@ -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' })
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue