22203fd8f4
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m18s
- Store/Products.razor: aspect-ratio:1/1 instead of height:60% - DiscountStore/Products.razor: same square ratio - Store/ProductDetail.razor: aspect-ratio:1/1 instead of max-height:400px - DiscountStore/ProductDetail.razor: ObjectFit.Cover + aspect-ratio:1/1 - Store/Cart.razor: rounded-lg instead of rounded-circle (desktop+mobile) - Store/CheckoutSummary.razor: rounded-lg + ObjectFit.Cover - Store/OrderDetail.razor: rounded-lg + ObjectFit.Cover (desktop+mobile) - DiscountStore/Cart.razor: rounded-lg + ObjectFit.Cover (desktop+mobile) - DiscountStore/Checkout.razor: rounded-lg + ObjectFit.Cover
119 lines
6.3 KiB
Plaintext
119 lines
6.3 KiB
Plaintext
@attribute [Route(RouteConstants.Store.OrderDetail + "{id:long}")]
|
|
@* Injection is handled in code-behind *@
|
|
|
|
<PageTitle>جزئیات سفارش</PageTitle>
|
|
|
|
@if (_loading)
|
|
{
|
|
<MudContainer MaxWidth="MaxWidth.Medium" Class="py-6">
|
|
<LoadingState />
|
|
</MudContainer>
|
|
}
|
|
else if (_order is null)
|
|
{
|
|
<MudContainer MaxWidth="MaxWidth.Medium" Class="py-6">
|
|
<EmptyState Icon="@Icons.Material.Filled.SearchOff"
|
|
Title="سفارش یافت نشد."
|
|
ActionText="بازگشت"
|
|
ActionHref="@RouteConstants.Store.Orders" />
|
|
</MudContainer>
|
|
}
|
|
else
|
|
{
|
|
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
|
<PageHeader Title="@($"جزئیات سفارش #{_order.Id}")" BackHref="@RouteConstants.Store.Orders" />
|
|
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
|
<MudStack Spacing="2">
|
|
@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">آدرس: @_order.UserAddressText</MudText>
|
|
<MudDivider Class="my-2" />
|
|
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
|
|
<MudTable Items="_order.FactorDetails">
|
|
<HeaderContent>
|
|
<MudTh>محصول</MudTh>
|
|
<MudTh>قیمت واحد</MudTh>
|
|
<MudTh>تعداد</MudTh>
|
|
<MudTh>قیمت کل</MudTh>
|
|
</HeaderContent>
|
|
<RowTemplate>
|
|
<MudTd>
|
|
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
|
<AppImage Path="@GetProductImageUrl(context.ProductThumbnailPath)" Alt="@context.ProductTitle"
|
|
ImgWidth="60" ImgHeight="60" Class="rounded-lg" ObjectFit="ObjectFit.Cover" />
|
|
<MudText>@context.ProductTitle</MudText>
|
|
</MudStack>
|
|
</MudTd>
|
|
<MudTd>@FormatPrice(context.UnitPrice ?? 0)</MudTd>
|
|
<MudTd>@context.Count</MudTd>
|
|
<MudTd>@FormatPrice((context.UnitPrice ?? 0) * (context.Count ?? 0))</MudTd>
|
|
</RowTemplate>
|
|
</MudTable>
|
|
</MudHidden>
|
|
|
|
<MudHidden Breakpoint="Breakpoint.MdAndUp">
|
|
<MudStack Spacing="2">
|
|
@foreach (var it in _order.FactorDetails)
|
|
{
|
|
<MudPaper Class="pa-3 rounded-lg" Outlined="true">
|
|
<MudStack Spacing="1">
|
|
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
|
<AppImage Path="@GetProductImageUrl(it.ProductThumbnailPath)" Alt="@it.ProductTitle"
|
|
ImgWidth="60" ImgHeight="60" Class="rounded-lg" ObjectFit="ObjectFit.Cover" />
|
|
<MudText>@it.ProductTitle</MudText>
|
|
</MudStack>
|
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
|
<MudText Class="mud-text-secondary">@FormatPrice(it.UnitPrice ?? 0) واحد</MudText>
|
|
<MudText>تعداد: @it.Count</MudText>
|
|
</MudStack>
|
|
<MudText>جمع: @FormatPrice((it.UnitPrice ?? 0) * (it.Count ?? 0))</MudText>
|
|
</MudStack>
|
|
</MudPaper>
|
|
}
|
|
</MudStack>
|
|
</MudHidden>
|
|
<MudDivider Class="my-2" />
|
|
|
|
@* نمایش جزئیات مالی *@
|
|
@{
|
|
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">
|
|
<MudText Typo="Typo.body2">جمع کالاها:</MudText>
|
|
<MudText Typo="Typo.body2">@FormatPrice(subtotal)</MudText>
|
|
</MudStack>
|
|
|
|
@if (_order.VatInfo is not null)
|
|
{
|
|
var vatPercent = (int)(_order.VatInfo.VatRate * 100);
|
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">مالیات بر ارزش افزوده (@vatPercent%):</MudText>
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">@FormatPrice(_order.VatInfo.VatAmount)</MudText>
|
|
</MudStack>
|
|
<MudDivider Class="my-1" />
|
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
|
<MudText Typo="Typo.subtitle1" Class="fw-bold">مبلغ قابل پرداخت:</MudText>
|
|
<MudText Typo="Typo.subtitle1" Color="Color.Primary" Class="fw-bold">@FormatPrice(_order.VatInfo.TotalAmount)</MudText>
|
|
</MudStack>
|
|
}
|
|
else
|
|
{
|
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
|
<MudText Typo="Typo.subtitle1" Class="fw-bold">مبلغ قابل پرداخت:</MudText>
|
|
<MudText Typo="Typo.subtitle1" Color="Color.Primary" Class="fw-bold">@FormatPrice(subtotal)</MudText>
|
|
</MudStack>
|
|
}
|
|
</MudStack>
|
|
</MudStack>
|
|
</MudPaper>
|
|
</MudContainer>
|
|
}
|