Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cd92a2f7b0 | |||
| 2874b931df |
@@ -63,49 +63,58 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<!-- Price & Discount -->
|
<!-- Price & Discount -->
|
||||||
<MudPaper Class="pa-4 rounded-lg discount-price-box" Elevation="0">
|
@if (_isAuthenticated)
|
||||||
<MudStack Spacing="2">
|
{
|
||||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
<MudPaper Class="pa-4 rounded-lg discount-price-box" Elevation="0">
|
||||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">قیمت محصول:</MudText>
|
<MudStack Spacing="2">
|
||||||
<MudText Typo="Typo.body1" Class="fw-bold">
|
|
||||||
@($"{_product.Price:N0}") تومان
|
|
||||||
</MudText>
|
|
||||||
</MudStack>
|
|
||||||
@if (VAT.IsEnabled)
|
|
||||||
{
|
|
||||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">مالیات ارزش افزوده (@VAT.VatPercentage%):</MudText>
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">قیمت محصول:</MudText>
|
||||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">
|
<MudText Typo="Typo.body1" Class="fw-bold">
|
||||||
@($"{VAT.CalculateVAT(_product.Price):N0}") تومان
|
|
||||||
</MudText>
|
|
||||||
</MudStack>
|
|
||||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
|
||||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">قیمت با مالیات:</MudText>
|
|
||||||
<MudText Typo="Typo.h5" Color="Color.Primary" Class="fw-bold">
|
|
||||||
@($"{VAT.AddVAT(_product.Price):N0}") تومان
|
|
||||||
</MudText>
|
|
||||||
</MudStack>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
|
||||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">قیمت نهایی:</MudText>
|
|
||||||
<MudText Typo="Typo.h5" Color="Color.Primary" Class="fw-bold">
|
|
||||||
@($"{_product.Price:N0}") تومان
|
@($"{_product.Price:N0}") تومان
|
||||||
</MudText>
|
</MudText>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
}
|
@if (VAT.IsEnabled)
|
||||||
@if (_product.MaxDiscountPercent > 0)
|
{
|
||||||
{
|
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">مالیات ارزش افزوده (@VAT.VatPercentage%):</MudText>
|
||||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">اعتبار از کیف اعتباری:</MudText>
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">
|
||||||
<MudChip T="string" Color="Color.Error" Variant="Variant.Filled" Size="Size.Small">
|
@($"{VAT.CalculateVAT(_product.Price):N0}") تومان
|
||||||
@_product.MaxDiscountPercent% (@($"{_product.Price * _product.MaxDiscountPercent / 100:N0}") تومان)
|
</MudText>
|
||||||
</MudChip>
|
</MudStack>
|
||||||
</MudStack>
|
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||||
}
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">قیمت با مالیات:</MudText>
|
||||||
</MudStack>
|
<MudText Typo="Typo.h5" Color="Color.Primary" Class="fw-bold">
|
||||||
</MudPaper>
|
@($"{VAT.AddVAT(_product.Price):N0}") تومان
|
||||||
|
</MudText>
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||||
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">قیمت نهایی:</MudText>
|
||||||
|
<MudText Typo="Typo.h5" Color="Color.Primary" Class="fw-bold">
|
||||||
|
@($"{_product.Price:N0}") تومان
|
||||||
|
</MudText>
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
@if (_product.MaxDiscountPercent > 0)
|
||||||
|
{
|
||||||
|
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||||
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">اعتبار از کیف اعتباری:</MudText>
|
||||||
|
<MudChip T="string" Color="Color.Error" Variant="Variant.Filled" Size="Size.Small">
|
||||||
|
@_product.MaxDiscountPercent% (@($"{_product.Price * _product.MaxDiscountPercent / 100:N0}") تومان)
|
||||||
|
</MudChip>
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
</MudStack>
|
||||||
|
</MudPaper>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudAlert Severity="Severity.Info" Dense="true" Variant="Variant.Outlined" Icon="@Icons.Material.Filled.Lock">
|
||||||
|
برای مشاهده قیمت ابتدا وارد شوید
|
||||||
|
</MudAlert>
|
||||||
|
}
|
||||||
|
|
||||||
<!-- Stock & Stats -->
|
<!-- Stock & Stats -->
|
||||||
<MudStack Row="true" Spacing="3" Class="flex-wrap">
|
<MudStack Row="true" Spacing="3" Class="flex-wrap">
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ public partial class ProductDetail
|
|||||||
[Inject] private DiscountCartService DiscountCartService { get; set; } = default!;
|
[Inject] private DiscountCartService DiscountCartService { get; set; } = default!;
|
||||||
[Inject] private VATService VAT { get; set; } = default!;
|
[Inject] private VATService VAT { get; set; } = default!;
|
||||||
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
||||||
|
[Inject] private AuthService AuthService { get; set; } = default!;
|
||||||
|
|
||||||
|
private bool _isAuthenticated;
|
||||||
|
|
||||||
private DiscountProductDetail? _product;
|
private DiscountProductDetail? _product;
|
||||||
private string _selectedImage = string.Empty;
|
private string _selectedImage = string.Empty;
|
||||||
@@ -20,6 +23,7 @@ public partial class ProductDetail
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
_isAuthenticated = await AuthService.IsAuthenticatedAsync();
|
||||||
await LoadProductAsync();
|
await LoadProductAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,10 +103,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
||||||
<MudText Typo="Typo.subtitle1">@p.Title</MudText>
|
<MudText Typo="Typo.subtitle1">@p.Title</MudText>
|
||||||
<div>
|
@if (_isAuthenticated)
|
||||||
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatPrice(p.Price)</MudText>
|
{
|
||||||
<MudText Typo="Typo.overline" Class="mud-text-secondary" Style="font-size:0.6rem;line-height:1;">(+ ارزش افزوده)</MudText>
|
<div>
|
||||||
</div>
|
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatPrice(p.Price)</MudText>
|
||||||
|
<MudText Typo="Typo.overline" Class="mud-text-secondary" Style="font-size:0.6rem;line-height:1;">(+ ارزش افزوده)</MudText>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Lock" Size="Size.Small" Class="me-1"/>برای مشاهده قیمت وارد شوید
|
||||||
|
</MudText>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
<MudCardActions Class="mt-auto d-flex justify-space-between pa-2">
|
<MudCardActions Class="mt-auto d-flex justify-space-between pa-2">
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ public partial class Products : ComponentBase, IDisposable
|
|||||||
[Inject] private DiscountProductService ProductService { get; set; } = default!;
|
[Inject] private DiscountProductService ProductService { get; set; } = default!;
|
||||||
[Inject] private DiscountCartService DiscountCart { get; set; } = default!;
|
[Inject] private DiscountCartService DiscountCart { get; set; } = default!;
|
||||||
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
||||||
|
[Inject] private AuthService AuthService { get; set; } = default!;
|
||||||
|
|
||||||
|
private bool _isAuthenticated;
|
||||||
private string _search = string.Empty;
|
private string _search = string.Empty;
|
||||||
private long? _selectedCategoryId;
|
private long? _selectedCategoryId;
|
||||||
private int _currentPage = 1;
|
private int _currentPage = 1;
|
||||||
@@ -24,6 +26,7 @@ public partial class Products : ComponentBase, IDisposable
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
_isAuthenticated = await AuthService.IsAuthenticatedAsync();
|
||||||
_loading = true;
|
_loading = true;
|
||||||
await DiscountCart.EnsureInitializedAsync();
|
await DiscountCart.EnsureInitializedAsync();
|
||||||
DiscountCart.OnChange += StateHasChanged;
|
DiscountCart.OnChange += StateHasChanged;
|
||||||
|
|||||||
@@ -144,7 +144,16 @@ else
|
|||||||
</div>
|
</div>
|
||||||
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
||||||
<MudText Typo="Typo.subtitle1" Style="display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;">@p.Title</MudText>
|
<MudText Typo="Typo.subtitle1" Style="display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;">@p.Title</MudText>
|
||||||
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatPrice(p.Price)</MudText>
|
@if (_isAuthenticated)
|
||||||
|
{
|
||||||
|
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatPrice(p.Price)</MudText>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Lock" Size="Size.Small" Class="me-1"/>برای مشاهده قیمت وارد شوید
|
||||||
|
</MudText>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
<MudCardActions Class="mt-auto pa-2" @onclick:stopPropagation="true">
|
<MudCardActions Class="mt-auto pa-2" @onclick:stopPropagation="true">
|
||||||
@@ -217,10 +226,19 @@ else
|
|||||||
</div>
|
</div>
|
||||||
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
||||||
<MudText Typo="Typo.subtitle1" Style="display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;">@p.Title</MudText>
|
<MudText Typo="Typo.subtitle1" Style="display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;">@p.Title</MudText>
|
||||||
<div>
|
@if (_isAuthenticated)
|
||||||
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatDiscountPrice(p.Price)</MudText>
|
{
|
||||||
<MudText Typo="Typo.overline" Class="mud-text-secondary" Style="font-size:0.6rem;line-height:1;">(+ ارزش افزوده)</MudText>
|
<div>
|
||||||
</div>
|
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatDiscountPrice(p.Price)</MudText>
|
||||||
|
<MudText Typo="Typo.overline" Class="mud-text-secondary" Style="font-size:0.6rem;line-height:1;">(+ ارزش افزوده)</MudText>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Lock" Size="Size.Small" Class="me-1"/>برای مشاهده قیمت وارد شوید
|
||||||
|
</MudText>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
<MudCardActions Class="mt-auto pa-2" @onclick:stopPropagation="true">
|
<MudCardActions Class="mt-auto pa-2" @onclick:stopPropagation="true">
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ public partial class Index : IDisposable
|
|||||||
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
||||||
[Inject] private VATService VAT { get; set; } = default!;
|
[Inject] private VATService VAT { get; set; } = default!;
|
||||||
|
|
||||||
|
private bool _isAuthenticated;
|
||||||
|
|
||||||
// ── CMS page data ──
|
// ── CMS page data ──
|
||||||
private PageSettingsDto? _pageData;
|
private PageSettingsDto? _pageData;
|
||||||
private LandingSettings? _settings;
|
private LandingSettings? _settings;
|
||||||
@@ -44,6 +46,7 @@ public partial class Index : IDisposable
|
|||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
MainService.OnChangeHandler += OnStateChanged;
|
MainService.OnChangeHandler += OnStateChanged;
|
||||||
|
_isAuthenticated = await AuthService.IsAuthenticatedAsync();
|
||||||
|
|
||||||
// Load landing page settings from CMS
|
// Load landing page settings from CMS
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -78,15 +78,24 @@ else
|
|||||||
@* </MudStack> *@
|
@* </MudStack> *@
|
||||||
@* } *@
|
@* } *@
|
||||||
<MudDivider Class="my-2"/>
|
<MudDivider Class="my-2"/>
|
||||||
<MudStack Spacing="1">
|
@if (_isAuthenticated)
|
||||||
<MudText Typo="Typo.h5" Color="Color.Primary">@FormatPrice(_product.Price)</MudText>
|
{
|
||||||
@if (VAT.IsEnabled)
|
<MudStack Spacing="1">
|
||||||
{
|
<MudText Typo="Typo.h5" Color="Color.Primary">@FormatPrice(_product.Price)</MudText>
|
||||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
@if (VAT.IsEnabled)
|
||||||
(شامل @VAT.VatPercentage% مالیات بر ارزش افزوده)
|
{
|
||||||
</MudText>
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||||
}
|
(شامل @VAT.VatPercentage% مالیات بر ارزش افزوده)
|
||||||
</MudStack>
|
</MudText>
|
||||||
|
}
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudAlert Severity="Severity.Info" Dense="true" Variant="Variant.Outlined" Icon="@Icons.Material.Filled.Lock">
|
||||||
|
برای مشاهده قیمت ابتدا وارد شوید
|
||||||
|
</MudAlert>
|
||||||
|
}
|
||||||
|
|
||||||
<!-- نمایش وضعیت موجودی -->
|
<!-- نمایش وضعیت موجودی -->
|
||||||
@if (IsInStock)
|
@if (IsInStock)
|
||||||
@@ -141,18 +150,27 @@ else
|
|||||||
{
|
{
|
||||||
<MudGrid Class="align-center" Justify="Justify.SpaceBetween">
|
<MudGrid Class="align-center" Justify="Justify.SpaceBetween">
|
||||||
<MudItem xs="6">
|
<MudItem xs="6">
|
||||||
<MudStack Spacing="1">
|
@if (_isAuthenticated)
|
||||||
@if (HasDiscount && OriginalPrice is not null)
|
{
|
||||||
{
|
<MudStack Spacing="1">
|
||||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
|
@if (HasDiscount && OriginalPrice is not null)
|
||||||
<MudText Typo="Typo.caption"
|
{
|
||||||
Class="mud-text-secondary mud-line-through">@FormatPrice(OriginalPrice.Value)</MudText>
|
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
|
||||||
<MudChip T="string" Color="Color.Error" Variant="Variant.Filled" Size="Size.Small"
|
<MudText Typo="Typo.caption"
|
||||||
Label="true">@($"٪{_product!.Discount}")</MudChip>
|
Class="mud-text-secondary mud-line-through">@FormatPrice(OriginalPrice.Value)</MudText>
|
||||||
</MudStack>
|
<MudChip T="string" Color="Color.Error" Variant="Variant.Filled" Size="Size.Small"
|
||||||
}
|
Label="true">@($"٪{_product!.Discount}")</MudChip>
|
||||||
<MudText Typo="Typo.h6" Color="Color.Primary">@FormatPrice(TotalPrice)</MudText>
|
</MudStack>
|
||||||
</MudStack>
|
}
|
||||||
|
<MudText Typo="Typo.h6" Color="Color.Primary">@FormatPrice(TotalPrice)</MudText>
|
||||||
|
</MudStack>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Lock" Size="Size.Small" Class="me-1"/>برای مشاهده قیمت وارد شوید
|
||||||
|
</MudText>
|
||||||
|
}
|
||||||
</MudItem>
|
</MudItem>
|
||||||
|
|
||||||
@if (IsInCart)
|
@if (IsInCart)
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ public partial class ProductDetail : ComponentBase, IDisposable
|
|||||||
[Inject] private CartService Cart { get; set; } = default!;
|
[Inject] private CartService Cart { get; set; } = default!;
|
||||||
[Inject] private VATService VAT { get; set; } = default!;
|
[Inject] private VATService VAT { get; set; } = default!;
|
||||||
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
||||||
|
[Inject] private AuthService AuthService { get; set; } = default!;
|
||||||
|
|
||||||
|
private bool _isAuthenticated;
|
||||||
|
|
||||||
[Parameter] public long id { get; set; }
|
[Parameter] public long id { get; set; }
|
||||||
|
|
||||||
@@ -52,7 +55,7 @@ public partial class ProductDetail : ComponentBase, IDisposable
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
// لود سبد خرید (فقط اگر کاربر لاگین کرده باشد)
|
_isAuthenticated = await AuthService.IsAuthenticatedAsync();
|
||||||
await Cart.EnsureInitializedAsync();
|
await Cart.EnsureInitializedAsync();
|
||||||
Cart.OnChange += HandleCartChanged;
|
Cart.OnChange += HandleCartChanged;
|
||||||
|
|
||||||
|
|||||||
@@ -141,8 +141,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
<div class="pa-1 flex-grow-1 d-flex flex-column justify-space-between">
|
||||||
<MudText Typo="Typo.subtitle1">@p.Title</MudText>
|
<MudText Typo="Typo.subtitle1">@p.Title</MudText>
|
||||||
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatPrice(p.Price)</MudText>
|
@if (_isAuthenticated)
|
||||||
|
{
|
||||||
|
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatPrice(p.Price)</MudText>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||||
|
<MudIcon Icon="@Icons.Material.Filled.Lock" Size="Size.Small" Class="me-1"/>برای مشاهده قیمت وارد شوید
|
||||||
|
</MudText>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
<MudCardActions Class="mt-auto d-flex justify-space-between pa-2">
|
<MudCardActions Class="mt-auto d-flex justify-space-between pa-2">
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ public partial class Products : ComponentBase, IDisposable
|
|||||||
[Inject] private CartService Cart { get; set; } = default!;
|
[Inject] private CartService Cart { get; set; } = default!;
|
||||||
[Inject] private VATService VAT { get; set; } = default!;
|
[Inject] private VATService VAT { get; set; } = default!;
|
||||||
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
[Inject] private GuestActionGate GuestGate { get; set; } = default!;
|
||||||
|
[Inject] private AuthService AuthService { get; set; } = default!;
|
||||||
|
|
||||||
|
private bool _isAuthenticated;
|
||||||
private string _query = string.Empty;
|
private string _query = string.Empty;
|
||||||
private bool _loading;
|
private bool _loading;
|
||||||
private bool _loadingMore;
|
private bool _loadingMore;
|
||||||
@@ -38,7 +40,7 @@ public partial class Products : ComponentBase, IDisposable
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
// لود سبد خرید (فقط اگر کاربر لاگین کرده باشد)
|
_isAuthenticated = await AuthService.IsAuthenticatedAsync();
|
||||||
await Cart.EnsureInitializedAsync();
|
await Cart.EnsureInitializedAsync();
|
||||||
Cart.OnChange += StateHasChanged;
|
Cart.OnChange += StateHasChanged;
|
||||||
Navigation.LocationChanged += HandleLocationChanged;
|
Navigation.LocationChanged += HandleLocationChanged;
|
||||||
|
|||||||
Reference in New Issue
Block a user