Files
FrontOffice/src/FrontOffice.Main/Pages/Store/OrderDetail.razor.cs
T
masoodafar-web 6db83ccd90
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 4m55s
feat: full FrontOffice updates - discount store, blog, payment gateway, UI improvements
- 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
2026-02-16 00:51:39 +03:30

51 lines
1.6 KiB
C#

using CMSMicroservice.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components;
using Messages = CMSMicroservice.Protobuf.Protos;
namespace FrontOffice.Main.Pages.Store;
public partial class OrderDetail : ComponentBase
{
[Inject] private OrderService OrderService { get; set; } = default!;
[Parameter] public long id { get; set; }
private GetUserOrderResponse? _order;
private bool _loading;
protected override async Task OnParametersSetAsync()
{
_loading = true;
_order = await OrderService.GetOrderAsync(id);
_loading = false;
}
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
private string GetStatusText(Messages.PaymentStatus orderPaymentStatus)
{
return orderPaymentStatus switch
{
Messages.PaymentStatus.Pending => "در انتظار پرداخت",
Messages.PaymentStatus.Success => "پرداخت شده",
Messages.PaymentStatus.Reject => "پرداخت ناموفق",
_ => "نامشخص",
};
}
private string GetPaymentMethodText(Messages.PaymentMethod orderPaymentMethod)
{
return orderPaymentMethod switch
{
Messages.PaymentMethod.Wallet => "کیف پول",
Messages.PaymentMethod.Ipg => "درگاه پرداخت اینترنتی",
_ => "نامشخص",
};
}
private static string GetProductImageUrl(string? imageUrl)
=> string.IsNullOrWhiteSpace(imageUrl) ? "/images/product-placeholder.svg" : imageUrl.TrimStart('/');
}