add marketer management page , fix order sub name issue
parent
986e7a3654
commit
73e8de3b0d
|
@ -1,5 +1,6 @@
|
||||||
@using Netina.AdminPanel.PWA.Models
|
@using Netina.AdminPanel.PWA.Models
|
||||||
@using Netina.AdminPanel.PWA.Layout
|
@using Netina.AdminPanel.PWA.Layout
|
||||||
|
@using Netina.AdminPanel.PWA.Pages
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
<Router AppAssembly="@typeof(App).Assembly">
|
<Router AppAssembly="@typeof(App).Assembly">
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
|
|
|
@ -63,14 +63,13 @@
|
||||||
</MudNavGroup>
|
</MudNavGroup>
|
||||||
|
|
||||||
|
|
||||||
<MudNavGroup Title="فروشگاه من" Expanded="false"
|
<MudNavGroup Title="فروشگاه من" Expanded="false" Icon="@Icons.Material.Outlined.Settings">
|
||||||
Icon="@Icons.Material.Outlined.Settings">
|
<MudNavLink Href="management/shop" Icon="@Icons.Material.Filled.Shop2">فروشگاه</MudNavLink>
|
||||||
|
<MudNavLink Href="management/marketer" Icon="@Icons.Material.Filled.Person4">بازاریاب ها</MudNavLink>
|
||||||
<MudNavLink Href="management/faqs" Icon="@Icons.Material.Filled.ManageAccounts">سوالات متداول</MudNavLink>
|
<MudNavLink Href="management/faqs" Icon="@Icons.Material.Filled.ManageAccounts">سوالات متداول</MudNavLink>
|
||||||
</MudNavGroup>
|
</MudNavGroup>
|
||||||
|
|
||||||
<MudNavGroup Title="تنظیماتـــ" Expanded="false"
|
<MudNavGroup Title="تنظیماتـــ" Expanded="false" Icon="@Icons.Material.Outlined.Settings">
|
||||||
Icon="@Icons.Material.Outlined.Settings">
|
|
||||||
<MudNavLink Href="management/shop" Icon="@Icons.Material.Filled.Shop2">فروشگاه</MudNavLink>
|
|
||||||
<MudNavLink Href="setting/users" Icon="@Icons.Material.Filled.ManageAccounts">نقش ها و کاربران</MudNavLink>
|
<MudNavLink Href="setting/users" Icon="@Icons.Material.Filled.ManageAccounts">نقش ها و کاربران</MudNavLink>
|
||||||
</MudNavGroup>
|
</MudNavGroup>
|
||||||
</MudNavMenu>
|
</MudNavMenu>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
@using Netina.AdminPanel.PWA.Services.RestServices
|
@using Netina.AdminPanel.PWA.Extensions
|
||||||
@using Netina.AdminPanel.PWA.Utilities
|
|
||||||
@using Netina.AdminPanel.PWA.Extensions
|
|
||||||
@inject ISnackbar Snackbar
|
@inject ISnackbar Snackbar
|
||||||
@inject IRestWrapper RestWrapper
|
@inject IRestWrapper RestWrapper
|
||||||
@inject IUserUtility UserUtility
|
@inject IUserUtility UserUtility
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
@using Radzen.Blazor
|
@using Netina.AdminPanel.PWA.Pages
|
||||||
|
@using Radzen.Blazor
|
||||||
@using Netina.AdminPanel.PWA.Utilities
|
@using Netina.AdminPanel.PWA.Utilities
|
||||||
@using Netina.AdminPanel.PWA.Models
|
@using Netina.AdminPanel.PWA.Models
|
||||||
@inherits LayoutComponentBase
|
@inherits LayoutComponentBase
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
@page "/management/marketer"
|
||||||
|
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
||||||
|
|
||||||
|
@inject IDialogService DialogService
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject ISnackbar Snackbar
|
||||||
|
@inject IUserUtility UserUtility
|
||||||
|
@inject IRestWrapper RestWrapper
|
||||||
|
|
||||||
|
<MudStack class="w-full p-8 h-screen bg-[--mud-palette-background-grey]">
|
||||||
|
<MudGrid>
|
||||||
|
<MudItem xs="12">
|
||||||
|
<MudPaper class="px-5 py-5">
|
||||||
|
<MudStack Row="true">
|
||||||
|
<MudStack class="mb-5 mx-2">
|
||||||
|
<MudText Typo="Typo.h4">jتنظیماتـــ بازاریاب ها</MudText>
|
||||||
|
<MudText Typo="Typo.caption">شما می توانید تنظیمات بازاریاب های خود را ویرایش نمایید</MudText>
|
||||||
|
</MudStack>
|
||||||
|
<MudSpacer />
|
||||||
|
<BaseButtonUi Size="Size.Large"
|
||||||
|
OnClickCallback="ViewModel.SubmitSettingAsync"
|
||||||
|
class="mt-2 mb-8 w-64 rounded-md"
|
||||||
|
IsProcessing="@ViewModel.IsProcessing"
|
||||||
|
Icon="@Icons.Material.Outlined.Check"
|
||||||
|
Content="ثبتـــ اطلاعات" Variant="Variant.Filled" Color="Color.Success" />
|
||||||
|
</MudStack>
|
||||||
|
<MudGrid>
|
||||||
|
<MudItem xs="12" sm="12">
|
||||||
|
<MudTextField T="int" @bind-Value="@ViewModel.PageDto.ProfitPercent" Variant="Variant.Outlined" Label="درصد از هر فروش"></MudTextField>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
<MudItem xs="12" sm="12">
|
||||||
|
|
||||||
|
<div class="min-h-[33rem] w-full">
|
||||||
|
<MudStack class="mt-4" Spacing="0">
|
||||||
|
|
||||||
|
<MudText Typo="Typo.h6">قرارداد بازاریاب ها</MudText>
|
||||||
|
<MudText Typo="Typo.caption">قراردادی که بازاریاب ها در مرحله ثبت نام باید با ان موافقت کنند</MudText>
|
||||||
|
</MudStack>
|
||||||
|
<MudGrid>
|
||||||
|
<MudItem sm="12">
|
||||||
|
|
||||||
|
<RichTextEditorUi @bind-Text="@ViewModel.PageDto.ContractTerms" />
|
||||||
|
|
||||||
|
</MudItem>
|
||||||
|
</MudGrid>
|
||||||
|
</div>
|
||||||
|
</MudItem>
|
||||||
|
|
||||||
|
</MudGrid>
|
||||||
|
</MudPaper>
|
||||||
|
</MudItem>
|
||||||
|
</MudGrid>
|
||||||
|
</MudStack>
|
||||||
|
@code
|
||||||
|
{
|
||||||
|
public MarketerManagementPageViewModel ViewModel { get; set; }
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
ViewModel = new MarketerManagementPageViewModel(NavigationManager, Snackbar, UserUtility, RestWrapper, DialogService);
|
||||||
|
await ViewModel.InitializeAsync();
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
using Netina.Domain.MartenEntities.Settings;
|
||||||
|
|
||||||
|
namespace Netina.AdminPanel.PWA.Pages;
|
||||||
|
|
||||||
|
public class MarketerManagementPageViewModel : BaseViewModel<MarketerSetting>
|
||||||
|
{
|
||||||
|
private readonly NavigationManager _navigationManager;
|
||||||
|
private readonly ISnackbar _snackbar;
|
||||||
|
private readonly IUserUtility _userUtility;
|
||||||
|
private readonly IDialogService _dialogService;
|
||||||
|
private readonly IRestWrapper _restWrapper;
|
||||||
|
|
||||||
|
|
||||||
|
public MarketerManagementPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
|
||||||
|
{
|
||||||
|
_navigationManager = navigationManager;
|
||||||
|
_snackbar = snackbar;
|
||||||
|
_userUtility = userUtility;
|
||||||
|
_restWrapper = restWrapper;
|
||||||
|
_dialogService = dialogService;
|
||||||
|
}
|
||||||
|
public override async Task InitializeAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IsProcessing = true;
|
||||||
|
var token = await _userUtility.GetBearerTokenAsync();
|
||||||
|
if (token == null)
|
||||||
|
throw new Exception("Token is null");
|
||||||
|
|
||||||
|
PageDto = await _restWrapper.SettingRestApi.GetSettingAsync<MarketerSetting>("MarketerSetting", token);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
var exe = await e.GetContentAsAsync<ApiResult>();
|
||||||
|
_snackbar.Add(exe != null ? exe.Message : e.Content, Severity.Error);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_snackbar.Add(ex.Message, Severity.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
IsProcessing = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
await base.InitializeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task SubmitSettingAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
var token = await _userUtility.GetBearerTokenAsync();
|
||||||
|
if (token == null) throw new Exception("Token is null");
|
||||||
|
await _restWrapper.SettingRestApi.PostSettingAsync("MarketerSetting", PageDto, token);
|
||||||
|
_snackbar.Add("تنظیمات بازاریاب ها با موفقیت به روز شد", Severity.Success);
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_snackbar.Add(e.Message, Severity.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
IsProcessing = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,4 @@
|
||||||
@page "/management/shop"
|
@page "/management/shop"
|
||||||
@using Netina.AdminPanel.PWA.Utilities
|
|
||||||
@using Netina.AdminPanel.PWA.Services.RestServices
|
|
||||||
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
|
||||||
|
|
||||||
@inject IDialogService DialogService
|
@inject IDialogService DialogService
|
||||||
|
|
|
@ -2093,6 +2093,16 @@ input:checked + .toggle-bg {
|
||||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-black {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(0 0 0 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.\!text-black {
|
||||||
|
--tw-text-opacity: 1 !important;
|
||||||
|
color: rgb(0 0 0 / var(--tw-text-opacity)) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.opacity-0 {
|
.opacity-0 {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue