feat(cart): 購物車上限 8->3

CartViewModel.hasMinimumCartItems() 與 DialogProductDetail +數量上限 由 8 改為 3,
購物車整車最多 3 件。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
terrylee 2026-06-26 14:52:32 +08:00
parent e6ebac8dc1
commit 54b44f5cf4
2 changed files with 4 additions and 4 deletions

View File

@ -132,12 +132,12 @@ public class DialogProductDetail extends DialogAbstract {
});
binding.buttonPlus.setOnClickListener(v -> {
// 上限貨道庫存與購物車總量上限8
// 上限貨道庫存與購物車總量上限3
if (quantity >= slot.getCount()) {
ToastUtils.showShort(R.string.cart_out_of_stock);
return;
}
if (quantity >= 8) {
if (quantity >= 3) {
ToastUtils.showShort(R.string.cart_max_items);
return;
}

View File

@ -40,9 +40,9 @@ class CartViewModel : ViewModel() {
}
}
/** 購物車最多 8 件 */
/** 購物車最多 3 件(全車總件數上限) */
fun hasMinimumCartItems(): Boolean {
return getAllCartItems().totalCount >= 8
return getAllCartItems().totalCount >= 3
}
fun getCartItemsSnapshot(): List<SlotStructure> = _cartItems.value ?: emptyList()