refactor: update user address models and methods to use CustomerAddressModel across multiple components
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m8s
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 3m8s
This commit is contained in:
@@ -16,8 +16,8 @@ public partial class CheckoutSummary : ComponentBase
|
||||
[Inject] private UserOrderContract.UserOrderContractClient UserOrderContract { get; set; } = default!;
|
||||
// Snackbar and Navigation are injected via _Imports.razor
|
||||
|
||||
private List<GetAllUserAddressByFilterResponseModel> _addresses = new();
|
||||
private GetAllUserAddressByFilterResponseModel? _selectedAddress;
|
||||
private List<CustomerAddressModel> _addresses = new();
|
||||
private CustomerAddressModel? _selectedAddress;
|
||||
private bool _loadingAddresses;
|
||||
private long walletBalance;
|
||||
|
||||
@@ -56,7 +56,7 @@ public partial class CheckoutSummary : ComponentBase
|
||||
_loadingAddresses = true;
|
||||
try
|
||||
{
|
||||
var response = await UserAddressContract.GetAllUserAddressByFilterAsync(new());
|
||||
var response = await UserAddressContract.GetCustomerAddressesAsync(new());
|
||||
if (response?.Models?.Any() == true)
|
||||
{
|
||||
_addresses = response.Models.ToList();
|
||||
|
||||
@@ -24,9 +24,15 @@ else
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="2">
|
||||
<MudText Typo="Typo.h5">سفارش #@_order.Id</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">تاریخ: @_order.PaymentDate.ToDateTime().MiladiToJalaliWithTime()</MudText>
|
||||
@if (_order.PaymentDate != null)
|
||||
{
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">تاریخ پرداخت: @_order.PaymentDate.ToDateTime().MiladiToJalaliWithTime()</MudText>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">تاریخ ثبت: @DateTime.Now.MiladiToJalaliWithTime()</MudText>
|
||||
}
|
||||
<MudText Typo="Typo.body2">وضعیت: @GetStatusText(_order.PaymentStatus)</MudText>
|
||||
<MudText Typo="Typo.body2">روش پرداخت: @GetPaymentMethodText(_order.PaymentMethod)</MudText>
|
||||
<MudText Typo="Typo.body2">آدرس: @_order.UserAddressText</MudText>
|
||||
<MudDivider Class="my-2" />
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
|
||||
@@ -42,12 +48,12 @@ else
|
||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
||||
<MudImage Src="@GetProductImageUrl(context.ProductThumbnailPath)" Alt="@context.ProductTitle"
|
||||
Width="60" Height="60" Class="rounded-circle" />
|
||||
<MudText>@context.ProductThumbnailPath</MudText>
|
||||
<MudText>@context.ProductTitle</MudText>
|
||||
</MudStack>
|
||||
</MudTd>
|
||||
<MudTd>@FormatPrice(context.UnitPrice.Value)</MudTd>
|
||||
<MudTd>@FormatPrice(context.UnitPrice ?? 0)</MudTd>
|
||||
<MudTd>@context.Count</MudTd>
|
||||
<MudTd>@FormatPrice(context.UnitPrice.Value*context.Count.Value)</MudTd>
|
||||
<MudTd>@FormatPrice((context.UnitPrice ?? 0) * (context.Count ?? 0))</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
</MudHidden>
|
||||
@@ -64,10 +70,10 @@ else
|
||||
<MudText>@it.ProductTitle</MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Class="mud-text-secondary">@FormatPrice(it.UnitPrice.Value) واحد</MudText>
|
||||
<MudText Class="mud-text-secondary">@FormatPrice(it.UnitPrice ?? 0) واحد</MudText>
|
||||
<MudText>تعداد: @it.Count</MudText>
|
||||
</MudStack>
|
||||
<MudText>جمع: @FormatPrice(it.UnitPrice.Value*it.Count.Value)</MudText>
|
||||
<MudText>جمع: @FormatPrice((it.UnitPrice ?? 0) * (it.Count ?? 0))</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
}
|
||||
@@ -77,7 +83,7 @@ else
|
||||
|
||||
@* نمایش جزئیات مالی *@
|
||||
@{
|
||||
var subtotal = _order.FactorDetails.Sum(s => s.UnitPrice.Value * s.Count.Value);
|
||||
var subtotal = _order.FactorDetails.Sum(s => (s.UnitPrice ?? 0) * (s.Count ?? 0));
|
||||
}
|
||||
<MudStack Spacing="1" Class="pa-2" Style="background-color: var(--mud-palette-background-grey); border-radius: 8px;">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
|
||||
@@ -28,9 +28,18 @@
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd>@context.Id</MudTd>
|
||||
<MudTd>@context.PaymentDate.ToDateTime().MiladiToJalaliWithTime()</MudTd>
|
||||
<MudTd>
|
||||
@if (context.PaymentDate != null)
|
||||
{
|
||||
@context.PaymentDate.ToDateTime().MiladiToJalaliWithTime()
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>در انتظار پرداخت</text>
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>@GetStatusText(context.PaymentStatus)</MudTd>
|
||||
<MudTd>@FormatPrice(context.FactorDetails.Sum(s=>s.UnitPrice.Value*s.Count.Value))</MudTd>
|
||||
<MudTd>@FormatPrice(context.FactorDetails.Sum(s=>(s.UnitPrice ?? 0) * (s.Count ?? 0)))</MudTd>
|
||||
<MudTd>
|
||||
<MudButton Variant="Variant.Text" Href="@($"{RouteConstants.Store.OrderDetail}{context.Id}")" StartIcon="@Icons.Material.Filled.Receipt">جزئیات</MudButton>
|
||||
</MudTd>
|
||||
@@ -46,11 +55,20 @@
|
||||
<MudStack Spacing="1">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText>سفارش #@o.Id</MudText>
|
||||
<MudText Class="mud-text-secondary">@o.PaymentDate.ToDateTime().MiladiToJalaliWithTime()</MudText>
|
||||
<MudText Class="mud-text-secondary">
|
||||
@if (o.PaymentDate != null)
|
||||
{
|
||||
@o.PaymentDate.ToDateTime().MiladiToJalaliWithTime()
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>در انتظار پرداخت</text>
|
||||
}
|
||||
</MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText>وضعیت: @GetStatusText(o.PaymentStatus)</MudText>
|
||||
<MudText Color="Color.Primary">@FormatPrice(o.FactorDetails.Sum(s=>s.UnitPrice.Value*s.Count.Value))</MudText>
|
||||
<MudText Color="Color.Primary">@FormatPrice(o.FactorDetails.Sum(s=>(s.UnitPrice ?? 0) * (s.Count ?? 0)))</MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.FlexEnd">
|
||||
<MudButton Size="Size.Small" Variant="Variant.Outlined" Href="@($"{RouteConstants.Store.OrderDetail}{o.Id}")" StartIcon="@Icons.Material.Filled.Receipt">جزئیات</MudButton>
|
||||
|
||||
Reference in New Issue
Block a user