Update order system with new gRPC services and wallet integration
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
@@ -9,7 +10,7 @@ public partial class OrderDetail : ComponentBase
|
||||
|
||||
[Parameter] public long id { get; set; }
|
||||
|
||||
private Order? _order;
|
||||
private GetUserOrderResponse? _order;
|
||||
private bool _loading;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
@@ -20,10 +21,26 @@ public partial class OrderDetail : ComponentBase
|
||||
}
|
||||
|
||||
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
|
||||
private static string GetStatusText(OrderStatus status) => status switch
|
||||
|
||||
private string GetStatusText(PaymentStatus orderPaymentStatus)
|
||||
{
|
||||
OrderStatus.Paid => "پرداختشده",
|
||||
_ => "در انتظار",
|
||||
};
|
||||
return orderPaymentStatus switch
|
||||
{
|
||||
PaymentStatus.Pending => "در انتظار پرداخت",
|
||||
PaymentStatus.Success => "پرداخت شده",
|
||||
PaymentStatus.Reject => "پرداخت ناموفق",
|
||||
_ => "نامشخص",
|
||||
};
|
||||
}
|
||||
|
||||
private string GetPaymentMethodText(PaymentMethod orderPaymentMethod)
|
||||
{
|
||||
return orderPaymentMethod switch
|
||||
{
|
||||
PaymentMethod.Wallet => "کیف پول",
|
||||
PaymentMethod.Ipg => "درگاه پرداخت اینترنتی",
|
||||
_ => "نامشخص",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user