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;

View File

@@ -89,11 +89,18 @@
<div class="layout-page">
<!-- Navbar -->
<nav class="layout-navbar container-xxl navbar navbar-expand-xl navbar-detached align-items-center bg-navbar-theme" id="layout-navbar">
<div class="layout-menu-toggle navbar-nav align-items-xl-center me-3 me-xl-0 d-xl-none">
<a class="nav-item nav-link px-0 me-xl-4" href="javascript:void(0)">
<i class="bx bx-menu bx-sm"></i>
</a>
<div class="d-flex">
<div class="avatar flex-shrink-0">
<img src="assets/img/icons/unicons/wallet.png" alt="User">
</div>
<div>
<small class="text-muted d-block">موجودی</small>
<div class="d-flex align-items-center">
<h6 class="mb-0 me-1">@userinfo.Company.Credit.ToString("N0")<span style="font-size: 14px">ریال</span></h6>
</div>
</div>
</div>
<div class="navbar-nav-right d-flex align-items-center" id="navbar-collapse">
<ul class="navbar-nav flex-row align-items-center mr-auto f-ir">
@@ -138,6 +145,8 @@
</li>
</ul>
</li>
<!--/ User -->
@if (countnot > 0)
{

View File

@@ -37,10 +37,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
//Home
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
//farzan
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");