fix: 修复购物车移动端删除按钮位置

- 删除按钮绝对定位在右上角
- 复选框绝对定位在左上角
- 商品信息占整行
- 数量选择器单独一行显示

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 22:38:15 +08:00
parent 03cce04b7f
commit 56672ac3de
+32 -55
View File
@@ -942,90 +942,67 @@ onMounted(() => {
} }
.cart-item { .cart-item {
flex-wrap: wrap; display: block;
gap: 8px;
padding: 12px; padding: 12px;
align-items: flex-start; position: relative;
}
> .el-checkbox { .cart-item > .el-checkbox {
position: absolute;
top: 12px;
left: 12px;
width: 24px; width: 24px;
order: 1;
margin-top: 24px;
} }
> .item-product {
flex: 1; .cart-item > .item-product {
min-width: 0; display: flex;
order: 2; gap: 10px;
width: calc(100% - 36px); padding-left: 32px;
padding-right: 60px;
} }
> .item-price {
.cart-item > .item-price {
display: none; display: none;
} }
> .item-quantity {
order: 4; .cart-item > .item-quantity {
width: 100%;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: space-between;
gap: 12px; margin-top: 10px;
padding-left: 36px; padding-left: 32px;
}
.cart-item > .item-subtotal {
text-align: right;
margin-top: 8px; margin-top: 8px;
} }
> .item-subtotal {
order: 3; .cart-item > .item-action {
position: absolute;
top: 12px;
right: 12px;
width: auto; width: auto;
margin-left: auto;
padding-right: 8px;
}
> .item-action {
order: 5;
width: 100%;
padding-left: 36px;
margin-top: 4px;
}
} }
.item-product { .item-product .item-image {
gap: 10px;
flex-wrap: nowrap;
.item-image {
width: 70px; width: 70px;
height: 70px; height: 70px;
flex-shrink: 0; flex-shrink: 0;
} }
}
.item-info { .item-info {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
display: flex;
flex-direction: column;
justify-content: center;
gap: 4px;
} }
.item-name { .item-quantity :deep(.el-input-number) {
font-size: 14px;
line-height: 1.4;
}
.item-quantity {
:deep(.el-input-number) {
width: 100px; width: 100px;
} }
.stock-tip { .item-subtotal .subtotal-price {
font-size: 11px;
}
}
.item-subtotal {
.subtotal-price {
font-size: 16px; font-size: 16px;
} }
}
.payment-methods { .payment-methods {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);