From 03cce04b7f1a952a5f235de0c01b1e449c941983 Mon Sep 17 00:00:00 2001 From: admin Date: Sat, 30 May 2026 22:18:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 商品项布局优化:复选框+图片+信息+小计在一行 - 数量选择器和删除按钮在下方单独一行 - 隐藏单价列,简化移动端显示 - 调整间距和字体大小 Co-Authored-By: Claude Opus 4.8 --- frontend/src/views/user/Cart.vue | 100 ++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 16 deletions(-) diff --git a/frontend/src/views/user/Cart.vue b/frontend/src/views/user/Cart.vue index ecd02fb..c5e1bbe 100644 --- a/frontend/src/views/user/Cart.vue +++ b/frontend/src/views/user/Cart.vue @@ -933,6 +933,8 @@ onMounted(() => { @media (max-width: 768px) { .cart-page { padding-bottom: 20px; + padding-left: 12px; + padding-right: 12px; } .cart-header { @@ -941,23 +943,56 @@ onMounted(() => { .cart-item { flex-wrap: wrap; - gap: 12px; - padding: 14px; + gap: 8px; + padding: 12px; + align-items: flex-start; - > .el-checkbox { width: 24px; order: 1; } - > .item-product { flex: 1; min-width: 0; order: 2; } - > .item-price { width: auto; order: 4; margin-left: 36px; } - > .item-quantity { width: auto; order: 5; } - > .item-subtotal { width: auto; order: 3; margin-left: auto; } - > .item-action { width: auto; order: 6; } + > .el-checkbox { + width: 24px; + order: 1; + margin-top: 24px; + } + > .item-product { + flex: 1; + min-width: 0; + order: 2; + width: calc(100% - 36px); + } + > .item-price { + display: none; + } + > .item-quantity { + order: 4; + width: 100%; + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + gap: 12px; + padding-left: 36px; + margin-top: 8px; + } + > .item-subtotal { + order: 3; + width: auto; + margin-left: auto; + padding-right: 8px; + } + > .item-action { + order: 5; + width: 100%; + padding-left: 36px; + margin-top: 4px; + } } .item-product { - gap: 12px; + gap: 10px; + flex-wrap: nowrap; .item-image { - width: 80px; - height: 80px; + width: 70px; + height: 70px; flex-shrink: 0; } } @@ -965,6 +1000,31 @@ onMounted(() => { .item-info { flex: 1; min-width: 0; + display: flex; + flex-direction: column; + justify-content: center; + gap: 4px; + } + + .item-name { + font-size: 14px; + line-height: 1.4; + } + + .item-quantity { + :deep(.el-input-number) { + width: 100px; + } + + .stock-tip { + font-size: 11px; + } + } + + .item-subtotal { + .subtotal-price { + font-size: 16px; + } } .payment-methods { @@ -972,25 +1032,33 @@ onMounted(() => { } .cart-left { - gap: 16px; + gap: 12px; } .checkout-section { - padding: 16px; + padding: 12px; } .cart-summary-panel { - padding: 16px; + padding: 12px; } .summary-title { font-size: 16px; - margin-bottom: 16px; - padding-bottom: 12px; + margin-bottom: 12px; + padding-bottom: 10px; } .summary-total .total-amount { font-size: 20px; } + + .address-item { + padding: 12px; + } + + .payment-item { + padding: 12px 8px; + } }