c243b59113
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m48s
- Updated the Checkout and CheckoutSummary components to allow users to add new addresses directly from the interface, improving accessibility and user experience. - Introduced dialog functionality for adding and editing addresses, streamlining the address management process. - Removed the calculation of order PV from the OrderDetail component, simplifying the order details view and improving performance. These changes enhance the usability of the checkout process by making address management more intuitive and efficient.
50 lines
1.6 KiB
C#
50 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('/');
|
|
}
|