This commit is contained in:
mmrbnjd
2024-07-29 23:32:54 +03:30
parent a025225920
commit a1a6076035
8 changed files with 61 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
@using Front.Services
@using Shared.DTOs
@inject HttpClientController hc;
@inject UserAuthenticationDTO userinfo
<Preload LoadingText="در حال بارگذاری..." />
<ConfirmDialog @ref="dialog" />
@@ -126,6 +127,7 @@
string titledateapp = "تاریخ";
protected override async Task OnParametersSetAsync()
{
Hidealert = true;
if (order.Status == StatusOrder.Cancel)
{
titledateapp += " ابطال";
@@ -161,9 +163,7 @@
private async Task<List<OrderItemDto>> LoadOrderItem()
{
PreloadService.Show(SpinnerColor.Dark);
var rsp = await hc.Get($"Orders/GetOrderDetails/{order.ID}");
PreloadService.Hide();
if (rsp.IsSuccessStatusCode)
return await rsp.Content.ReadFromJsonAsync<List<OrderItemDto>?>();
else
@@ -175,11 +175,11 @@
}
private async Task OnClickPay()
{
PreloadService.Show(SpinnerColor.Dark);
var rsp = await hc.Get($"Orders/SubmitOrderBywallet/{order.ID}");
PreloadService.Hide();
if (rsp.IsSuccessStatusCode)
{
userinfo.Company.Credit -= order.TPrice;
result = new ActionInResultComponent();
result.Status = ComponentStatus.success;
result.Action = ComponentAction.add;