65 lines
3.0 KiB
Plaintext
65 lines
3.0 KiB
Plaintext
@attribute [Route(RouteConstants.Store.Orders)]
|
|
@* Injection is handled in code-behind *@
|
|
|
|
<PageTitle>سفارشات من</PageTitle>
|
|
|
|
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
|
<MudText Typo="Typo.h4" Class="mb-3">سفارشات من</MudText>
|
|
@if (_loading)
|
|
{
|
|
<MudStack AlignItems="AlignItems.Center" Class="py-4">
|
|
<MudProgressCircular Indeterminate="true" Color="Color.Primary" />
|
|
</MudStack>
|
|
}
|
|
else if (_orders.Count == 0)
|
|
{
|
|
<MudAlert Severity="Severity.Info">هنوز سفارشی ثبت نکردهاید.</MudAlert>
|
|
}
|
|
else
|
|
{
|
|
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
|
|
<MudTable Items="_orders" Dense="true">
|
|
<HeaderContent>
|
|
<MudTh>شناسه</MudTh>
|
|
<MudTh>تاریخ</MudTh>
|
|
<MudTh>وضعیت</MudTh>
|
|
<MudTh>مبلغ</MudTh>
|
|
<MudTh></MudTh>
|
|
</HeaderContent>
|
|
<RowTemplate>
|
|
<MudTd>@context.Id</MudTd>
|
|
<MudTd>@context.PaymentDate.ToDateTime().MiladiToJalaliWithTime()</MudTd>
|
|
<MudTd>@GetStatusText(context.PaymentStatus)</MudTd>
|
|
<MudTd>@FormatPrice(context.FactorDetails.Sum(s=>s.UnitPrice.Value*s.Count.Value))</MudTd>
|
|
<MudTd>
|
|
<MudButton Variant="Variant.Text" Href="@($"{RouteConstants.Store.OrderDetail}{context}")" StartIcon="@Icons.Material.Filled.Receipt">جزئیات</MudButton>
|
|
</MudTd>
|
|
</RowTemplate>
|
|
</MudTable>
|
|
</MudHidden>
|
|
|
|
<MudHidden Breakpoint="Breakpoint.MdAndUp">
|
|
<MudStack Spacing="2">
|
|
@foreach (var o in _orders)
|
|
{
|
|
<MudPaper Class="pa-3 rounded-lg" Outlined="true">
|
|
<MudStack Spacing="1">
|
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
|
<MudText>سفارش #@o.Id</MudText>
|
|
<MudText Class="mud-text-secondary">@o.PaymentDate.ToDateTime().MiladiToJalaliWithTime()</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>
|
|
</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>
|
|
</MudStack>
|
|
</MudStack>
|
|
</MudPaper>
|
|
}
|
|
</MudStack>
|
|
</MudHidden>
|
|
}
|
|
</MudContainer>
|