Add OtpDialogService for mobile-friendly OTP authentication dialog
This commit is contained in:
38
src/FrontOffice.Main/Pages/Store/Cart.razor.cs
Normal file
38
src/FrontOffice.Main/Pages/Store/Cart.razor.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using FrontOffice.Main.Utilities;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Store;
|
||||
|
||||
public partial class Cart : ComponentBase, IDisposable
|
||||
{
|
||||
[Inject] private CartService CartService { get; set; } = default!;
|
||||
// Navigation and Snackbar are available via _Imports.razor
|
||||
private CartService CartData => CartService;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
CartService.OnChange += StateHasChanged;
|
||||
}
|
||||
|
||||
private void ChangeQty(long productId, int value)
|
||||
{
|
||||
CartService.UpdateQuantity(productId, value);
|
||||
}
|
||||
|
||||
private void Remove(long productId)
|
||||
{
|
||||
CartService.Remove(productId);
|
||||
}
|
||||
|
||||
private void ProceedCheckout()
|
||||
{
|
||||
Navigation.NavigateTo(RouteConstants.Store.CheckoutSummary);
|
||||
}
|
||||
|
||||
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CartService.OnChange -= StateHasChanged;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user