Przeglądaj źródła

♻️ refactor(cart): 移除自定义商品数量选择器组件

- 删除 `goods-stepper` 相关 CSS 样式定义
- 在骨架屏中将类名 `goods-stepper` 替换为 `cart-quantity-controls`
- 移除已注释的商品数量增减按钮的 JSX 代码块
yourname 1 miesiąc temu
rodzic
commit
818b2c8d6e
2 zmienionych plików z 1 dodań i 71 usunięć
  1. 0 44
      mini/src/pages/cart/index.css
  2. 1 27
      mini/src/pages/cart/index.tsx

+ 0 - 44
mini/src/pages/cart/index.css

@@ -314,50 +314,6 @@
   opacity: 0.5;
 }
 
-.goods-stepper {
-  display: flex;
-  align-items: center;
-  background: #f5f5f5;
-  border-radius: 8rpx;
-  height: 44rpx;
-  width: fit-content;
-}
-
-.stepper-btn {
-  width: 44rpx;
-  height: 44rpx;
-  min-width: auto;
-  padding: 0;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  background: transparent;
-  border: none;
-  color: #666;
-}
-
-.stepper-btn:disabled {
-  color: #ccc;
-}
-
-.stepper-btn.minus {
-  border-top-left-radius: 8rpx;
-  border-bottom-left-radius: 8rpx;
-}
-
-.stepper-btn.plus {
-  border-top-right-radius: 8rpx;
-  border-bottom-right-radius: 8rpx;
-}
-
-.stepper-value {
-  min-width: 60rpx;
-  text-align: center;
-  font-size: 28rpx;
-  color: #333;
-  font-weight: 500;
-  padding: 0 8rpx;
-}
 
 /* 删除按钮样式 */
 .delete-btn {

+ 1 - 27
mini/src/pages/cart/index.tsx

@@ -123,7 +123,7 @@ export default function CartPage() {
                     <View className="goods-title skeleton" />
                     <View className="goods-specs skeleton" />
                     <View className="goods-price skeleton" />
-                    <View className="goods-stepper skeleton" />
+                    <View className="cart-quantity-controls skeleton" />
                   </View>
                 </View>
               </View>
@@ -493,32 +493,6 @@ export default function CartPage() {
                             </Button>
                           </View>
 
-                          {/* <View className="goods-stepper">
-                            <Button
-                              size="sm"
-                              variant="ghost"
-                              className="stepper-btn minus"
-                              onClick={(e) => {
-                                e.stopPropagation(); // 阻止事件冒泡
-                                updateQuantity(item.id, Math.max(1, item.quantity - 1));
-                              }}
-                              disabled={item.quantity <= 1}
-                            >
-                              <View className="i-heroicons-minus-20-solid w-3 h-3" />
-                            </Button>
-                            <Text className="stepper-value">{item.quantity}</Text>
-                            <Button
-                              size="sm"
-                              variant="ghost"
-                              className="stepper-btn plus"
-                              onClick={(e) => {
-                                e.stopPropagation(); // 阻止事件冒泡
-                                updateQuantity(item.id, item.quantity + 1);
-                              }}
-                            >
-                              <View className="i-heroicons-plus-20-solid w-3 h-3" />
-                            </Button>
-                          </View> */}
 
                         </View>
                       </View>