fix(uniapp): 选规格按钮

This commit is contained in:
Kroytz committed 2026-07-31 14:46:17 +08:00
1 parent 3d72f6c714
commit dc57b10d37
1 file changed
+15 -10
+15 -10
View File
@@ -1009,21 +1009,26 @@ $menu-divider-height: 2rpx;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
} }
@mixin quantity-control($size) { // $fix-btn: 是否把按钮锁成固定尺寸的小圆钮。
// 纯数量加减(详情弹窗、购物车弹窗)用 true;
// 商品列表这类混有“选规格”等宽按钮的地方用 false,靠 .quantity-btn 自己锁尺寸。
@mixin quantity-control($size, $fix-btn: true) {
.btn, .btn,
.number { .number {
line-height: $size; line-height: $size;
text-align: center; text-align: center;
} }
.btn { @if $fix-btn {
box-sizing: border-box; .btn {
flex: 0 0 $size; box-sizing: border-box;
width: $size; flex: 0 0 $size;
min-width: $size; width: $size;
height: $size; min-width: $size;
padding: 0; height: $size;
border-radius: $border-radius-circle; padding: 0;
border-radius: $border-radius-circle;
}
} }
.number { .number {
@@ -1381,7 +1386,7 @@ page {
border-radius: $border-radius-circle; border-radius: $border-radius-circle;
} }
@include quantity-control(var(--menu-control-size-sm)); @include quantity-control(var(--menu-control-size-sm), false);
.number { .number {
min-width: 38rpx; min-width: 38rpx;