fix: 强制修复购物车移动端布局
- 使用!important确保样式优先级 - flex-direction: column让元素垂直排列 - 商品信息、数量、小计各占一行 - 复选框左上角、删除按钮右上角 - 隐藏商品标签简化显示 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -933,130 +933,176 @@ onMounted(() => {
|
|||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.cart-page {
|
.cart-page {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
padding-left: 12px;
|
padding-left: 8px;
|
||||||
padding-right: 12px;
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cart-header {
|
.cart-header {
|
||||||
display: none;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 商品项整体容器 */
|
.cart-list {
|
||||||
|
max-height: none;
|
||||||
|
overflow-y: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 商品项容器 */
|
||||||
.cart-item {
|
.cart-item {
|
||||||
display: flex;
|
display: flex !important;
|
||||||
flex-wrap: wrap;
|
flex-direction: column !important;
|
||||||
align-items: flex-start;
|
flex-wrap: nowrap !important;
|
||||||
padding: 12px;
|
padding: 10px !important;
|
||||||
padding-left: 44px;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
gap: 0;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 复选框 - 左侧固定 */
|
/* 复选框 - 左上角 */
|
||||||
.cart-item > .el-checkbox {
|
.cart-item > .el-checkbox {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 10px;
|
||||||
left: 12px;
|
left: 10px;
|
||||||
transform: translateY(-50%);
|
width: 24px !important;
|
||||||
width: 24px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 删除按钮 - 右上角固定 */
|
/* 删除按钮 - 右上角 */
|
||||||
.cart-item > .item-action {
|
.cart-item > .item-action {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 12px;
|
top: 10px;
|
||||||
right: 12px;
|
right: 10px;
|
||||||
width: auto;
|
width: auto !important;
|
||||||
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 商品图片+信息 - 占满一行 */
|
/* 商品信息行 */
|
||||||
.cart-item > .item-product {
|
.cart-item > .item-product {
|
||||||
width: 100%;
|
display: flex !important;
|
||||||
display: flex;
|
flex-direction: row !important;
|
||||||
gap: 10px;
|
width: 100% !important;
|
||||||
padding-right: 50px;
|
padding-left: 28px !important;
|
||||||
margin-bottom: 12px;
|
padding-right: 40px !important;
|
||||||
|
margin-bottom: 8px !important;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 隐藏单价 */
|
/* 隐藏单价 */
|
||||||
.cart-item > .item-price {
|
.cart-item > .item-price {
|
||||||
display: none;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 数量行 - 占满一行 */
|
/* 数量行 */
|
||||||
.cart-item > .item-quantity {
|
.cart-item > .item-quantity {
|
||||||
width: 100%;
|
width: 100% !important;
|
||||||
display: flex;
|
flex-direction: row !important;
|
||||||
align-items: center;
|
align-items: center !important;
|
||||||
gap: 8px;
|
justify-content: flex-start !important;
|
||||||
margin-bottom: 8px;
|
padding-left: 28px !important;
|
||||||
|
margin-bottom: 4px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 小计行 - 占满一行 */
|
/* 小计行 */
|
||||||
.cart-item > .item-subtotal {
|
.cart-item > .item-subtotal {
|
||||||
width: 100%;
|
width: 100% !important;
|
||||||
text-align: left;
|
text-align: left !important;
|
||||||
|
padding-left: 28px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 商品图片 */
|
|
||||||
.item-product .item-image {
|
.item-product .item-image {
|
||||||
width: 50px;
|
width: 50px !important;
|
||||||
height: 50px;
|
height: 50px !important;
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 商品信息 */
|
|
||||||
.item-info {
|
.item-info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
gap: 4px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-name {
|
||||||
|
font-size: 13px !important;
|
||||||
|
-webkit-line-clamp: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-tags {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 数量输入框 */
|
|
||||||
.item-quantity :deep(.el-input-number) {
|
.item-quantity :deep(.el-input-number) {
|
||||||
width: 100px;
|
width: 90px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-quantity .stock-tip {
|
||||||
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 小计金额样式 */
|
|
||||||
.item-subtotal .subtotal-price {
|
.item-subtotal .subtotal-price {
|
||||||
font-size: 16px;
|
font-size: 15px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #f56c6c;
|
color: #f56c6c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 支付方式2列 */
|
/* 支付方式 */
|
||||||
.payment-methods {
|
.payment-methods {
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cart-left {
|
.cart-left {
|
||||||
gap: 12px;
|
gap: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checkout-section {
|
.checkout-section {
|
||||||
padding: 12px;
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 14px !important;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cart-summary-panel {
|
.cart-summary-panel {
|
||||||
padding: 12px;
|
padding: 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary-title {
|
.summary-title {
|
||||||
font-size: 16px;
|
font-size: 15px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-row {
|
||||||
|
font-size: 13px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary-total .total-amount {
|
.summary-total .total-amount {
|
||||||
font-size: 20px;
|
font-size: 18px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkout-btn {
|
||||||
|
height: 40px !important;
|
||||||
|
font-size: 14px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.address-item {
|
.address-item {
|
||||||
padding: 12px;
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address-name {
|
||||||
|
font-size: 14px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address-detail {
|
||||||
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.payment-item {
|
.payment-item {
|
||||||
padding: 12px 8px;
|
padding: 10px 6px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.payment-icon {
|
||||||
|
font-size: 22px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.payment-name {
|
||||||
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user