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:
parent
e6ebac8dc1
commit
54b44f5cf4
@ -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;
|
||||
}
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user