feat: full FrontOffice updates - discount store, blog, payment gateway, UI improvements
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 4m55s
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 4m55s
- Discount store pages (products, cart, orders, order detail) - Blog pages and services - Payment gateway callback page - AppImage component, EmptyState, LoadingState, PageHeader - DiscountCartService, DiscountOrderService, DiscountProductService - BlogCategoryService, BlogPostService, SitePageService, ImageCacheService - PhoneVerifyForm component - Profile Hub page - UI/UX improvements across all pages - landing.js for homepage - Config and routing updates
This commit is contained in:
@@ -0,0 +1,198 @@
|
||||
@attribute [Route("/discount-store/order/{Id:long}")]
|
||||
|
||||
<PageTitle>جزئیات سفارش تخفیفی</PageTitle>
|
||||
|
||||
@if (!string.IsNullOrEmpty(_paymentMessage))
|
||||
{
|
||||
<MudContainer MaxWidth="MaxWidth.Medium" Class="pt-4">
|
||||
<MudAlert Severity="@_paymentSeverity" Variant="Variant.Filled" Class="mb-2"
|
||||
CloseIconClicked="() => _paymentMessage = null" ShowCloseIcon="true">
|
||||
@_paymentMessage
|
||||
</MudAlert>
|
||||
</MudContainer>
|
||||
}
|
||||
|
||||
@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.DiscountStore.Orders" />
|
||||
</MudContainer>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
||||
<!-- Header -->
|
||||
<PageHeader Title="@($"سفارش #{_order.OrderNumber}")" BackHref="@RouteConstants.DiscountStore.Orders" />
|
||||
<MudStack Row="true" Spacing="2" Class="flex-wrap mb-4">
|
||||
<MudChip T="string" Color="@(_order.PaymentCompleted ? Color.Success : Color.Warning)"
|
||||
Variant="Variant.Filled">
|
||||
@(_order.PaymentCompleted ? "پرداخت شده" : "در انتظار پرداخت")
|
||||
</MudChip>
|
||||
<MudChip T="string" Color="@DiscountOrderService.GetDeliveryStatusColor(_order.DeliveryStatus)"
|
||||
Variant="Variant.Outlined">
|
||||
@DiscountOrderService.GetDeliveryStatusText(_order.DeliveryStatus)
|
||||
</MudChip>
|
||||
</MudStack>
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="2">
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
تاریخ ثبت: @FormatDate(_order.Created)
|
||||
</MudText>
|
||||
|
||||
@* ── Address ── *@
|
||||
@if (_order.Address is not null)
|
||||
{
|
||||
<MudText Typo="Typo.body2">
|
||||
<b>آدرس:</b> @_order.Address.Title — @_order.Address.Address
|
||||
</MudText>
|
||||
@if (!string.IsNullOrWhiteSpace(_order.Address.PostalCode))
|
||||
{
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">کد پستی: @_order.Address.PostalCode</MudText>
|
||||
}
|
||||
}
|
||||
|
||||
<MudDivider Class="my-2" />
|
||||
|
||||
@* ── Desktop: Table ── *@
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
|
||||
<MudText Typo="Typo.h6" Class="mb-2">اقلام سفارش</MudText>
|
||||
<MudTable Items="_order.Items" Dense="true">
|
||||
<HeaderContent>
|
||||
<MudTh>محصول</MudTh>
|
||||
<MudTh>قیمت واحد</MudTh>
|
||||
<MudTh>تعداد</MudTh>
|
||||
<MudTh>سقف تخفیف</MudTh>
|
||||
<MudTh>تخفیف</MudTh>
|
||||
<MudTh>قیمت نهایی</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd>@context.Title</MudTd>
|
||||
<MudTd>@FormatPrice(context.UnitPrice)</MudTd>
|
||||
<MudTd>@context.Count</MudTd>
|
||||
<MudTd>
|
||||
@if (context.MaxDiscountPercent > 0)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Error" Variant="Variant.Outlined">@context.MaxDiscountPercent%</MudChip>
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
@if (context.DiscountAmount > 0)
|
||||
{
|
||||
<MudText Color="Color.Success">@FormatPrice(context.DiscountAmount)-</MudText>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Class="mud-text-secondary">—</MudText>
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>@FormatPrice(context.FinalPrice)</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
</MudHidden>
|
||||
|
||||
@* ── Mobile: Cards ── *@
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp">
|
||||
<MudText Typo="Typo.h6" Class="mb-2">اقلام سفارش</MudText>
|
||||
<MudStack Spacing="2">
|
||||
@foreach (var item in _order.Items)
|
||||
{
|
||||
<MudPaper Class="pa-3 rounded-lg" Outlined="true">
|
||||
<MudStack Spacing="1">
|
||||
<MudText Typo="Typo.subtitle2">@item.Title</MudText>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">قیمت واحد:</MudText>
|
||||
<MudText Typo="Typo.body2">@FormatPrice(item.UnitPrice)</MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">تعداد:</MudText>
|
||||
<MudText Typo="Typo.body2">@item.Count</MudText>
|
||||
</MudStack>
|
||||
@if (item.DiscountAmount > 0)
|
||||
{
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.body2" Color="Color.Success">تخفیف (@item.MaxDiscountPercent%):</MudText>
|
||||
<MudText Typo="Typo.body2" Color="Color.Success">@FormatPrice(item.DiscountAmount)-</MudText>
|
||||
</MudStack>
|
||||
}
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.subtitle2">قیمت نهایی:</MudText>
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Primary">@FormatPrice(item.FinalPrice)</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
}
|
||||
</MudStack>
|
||||
</MudHidden>
|
||||
|
||||
<MudDivider Class="my-2" />
|
||||
|
||||
@* ── Financial Summary ── *@
|
||||
<MudStack Spacing="1" Class="pa-3" Style="background-color: var(--mud-palette-background-grey); border-radius: 8px;">
|
||||
<MudText Typo="Typo.h6" Class="mb-1">خلاصه مالی</MudText>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.body2">جمع کل:</MudText>
|
||||
<MudText Typo="Typo.body2">@FormatPrice(_order.TotalPrice)</MudText>
|
||||
</MudStack>
|
||||
|
||||
@if (_order.DiscountBalanceUsed > 0)
|
||||
{
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.body2" Color="Color.Success">از کیف تخفیفی:</MudText>
|
||||
<MudText Typo="Typo.body2" Color="Color.Success">@FormatPrice(_order.DiscountBalanceUsed)-</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.GatewayAmount)
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
|
||||
@* ── Tracking / Transaction ── *@
|
||||
@if (!string.IsNullOrWhiteSpace(_order.TrackingCode))
|
||||
{
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.body2">کد رهگیری:</MudText>
|
||||
<MudText Typo="Typo.body2" Class="fw-semibold">@_order.TrackingCode</MudText>
|
||||
</MudStack>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(_order.TransactionId))
|
||||
{
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">شناسه تراکنش:</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">@_order.TransactionId</MudText>
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
@* ── Notes ── *@
|
||||
@if (!string.IsNullOrWhiteSpace(_order.Notes))
|
||||
{
|
||||
<MudDivider Class="my-1" />
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">
|
||||
<b>توضیحات:</b> @_order.Notes
|
||||
</MudText>
|
||||
}
|
||||
@if (!string.IsNullOrWhiteSpace(_order.AdminNotes))
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined" Dense="true">
|
||||
<b>پیام مدیر:</b> @_order.AdminNotes
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudContainer>
|
||||
}
|
||||
Reference in New Issue
Block a user