feat: Implement Commission and Network Statistics Pages with DTOs and Services
- Added CommissionDashboardPage and CommissionHistoryPage for displaying commission payouts and history. - Implemented WeeklyBalancePage to show weekly balance details. - Created NetworkStatisticsPage to display network statistics and tree structure. - Developed corresponding services (CommissionService, NetworkMembershipService) for data retrieval. - Introduced DTOs for Commission and Network data structures (CommissionPayoutDto, WeeklyBalanceDto, NetworkStatisticsDto). - Added mock data generation for testing purposes in services. - Enhanced UI with MudBlazor components for better user experience.
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using MudBlazor
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">فعالسازی یا تمدید عضویت</MudText>
|
||||
|
||||
<MudForm @ref="_form" @bind-IsValid="_formIsValid">
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudNumericField @bind-Value="_packageId"
|
||||
Label="شناسه بسته"
|
||||
Variant="Variant.Outlined"
|
||||
Required="true"
|
||||
RequiredError="شناسه بسته الزامی است"
|
||||
Min="1"
|
||||
HelperText="شناسه بسته باشگاه را وارد کنید" />
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudNumericField @bind-Value="_durationMonths"
|
||||
Label="مدت زمان (ماه)"
|
||||
Variant="Variant.Outlined"
|
||||
Required="true"
|
||||
RequiredError="مدت زمان الزامی است"
|
||||
Min="1"
|
||||
Max="12"
|
||||
HelperText="از 1 تا 12 ماه" />
|
||||
</MudItem>
|
||||
<MudItem xs="12">
|
||||
<MudTextField @bind-Value="_activationCode"
|
||||
Label="کد فعالسازی (اختیاری)"
|
||||
Variant="Variant.Outlined"
|
||||
HelperText="در صورت داشتن کد تخفیف یا کد فعالسازی، وارد کنید" />
|
||||
</MudItem>
|
||||
|
||||
<!-- پیشنمایش هزینه -->
|
||||
<MudItem xs="12">
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">هزینه تقریبی:</MudText>
|
||||
<MudText Typo="Typo.h6" Color="Color.Primary">@GetEstimatedCost()</MudText>
|
||||
</MudStack>
|
||||
</MudAlert>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12">
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
FullWidth="true"
|
||||
Disabled="@(!_formIsValid || _isSubmitting)"
|
||||
OnClick="HandleActivateAsync"
|
||||
StartIcon="@Icons.Material.Filled.CheckCircle">
|
||||
@if (_isSubmitting)
|
||||
{
|
||||
<MudProgressCircular Size="Size.Small" Indeterminate="true" />
|
||||
<span class="ms-2">در حال پردازش...</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>پرداخت و فعالسازی</span>
|
||||
}
|
||||
</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudForm>
|
||||
|
||||
@if (!string.IsNullOrEmpty(_errorMessage))
|
||||
{
|
||||
<MudAlert Severity="Severity.Error" Class="mt-3" Variant="Variant.Filled">
|
||||
@_errorMessage
|
||||
</MudAlert>
|
||||
}
|
||||
</MudPaper>
|
||||
@@ -0,0 +1,67 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Club.Components;
|
||||
|
||||
public partial class ActivationSection : ComponentBase
|
||||
{
|
||||
[Inject] private ClubMembershipService ClubService { get; set; } = default!;
|
||||
|
||||
[Parameter] public EventCallback OnActivationSuccess { get; set; }
|
||||
|
||||
private MudForm _form = default!;
|
||||
private bool _formIsValid;
|
||||
private bool _isSubmitting;
|
||||
private string? _errorMessage;
|
||||
|
||||
private long _packageId = 1;
|
||||
private int _durationMonths = 1;
|
||||
private string? _activationCode;
|
||||
|
||||
private async Task HandleActivateAsync()
|
||||
{
|
||||
await _form.Validate();
|
||||
if (!_formIsValid)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
_isSubmitting = true;
|
||||
_errorMessage = null;
|
||||
|
||||
var result = await ClubService.ActivateMembershipAsync(
|
||||
_packageId,
|
||||
_activationCode,
|
||||
_durationMonths
|
||||
);
|
||||
|
||||
if (result.Success)
|
||||
{
|
||||
Snackbar.Add($"عضویت فعال شد! مبلغ پرداختی: {result.AmountPaid:N0} تومان", Severity.Success);
|
||||
await OnActivationSuccess.InvokeAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
_errorMessage = result.Message ?? "خطا در فعالسازی عضویت";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_errorMessage = $"خطا: {ex.Message}";
|
||||
Snackbar.Add(_errorMessage, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isSubmitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetEstimatedCost()
|
||||
{
|
||||
// فرمول تقریبی: 56M per month (base amount from BFF implementation)
|
||||
var baseAmount = 56_000_000;
|
||||
var total = baseAmount * _durationMonths;
|
||||
return $"{total:N0} تومان";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
@attribute [Route(RouteConstants.Club.Features)]
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using MudBlazor
|
||||
|
||||
<PageTitle>ویژگیهای باشگاه مشتریان</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
||||
<MudStack Spacing="3">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h5">ویژگیهای باشگاه مشتریان</MudText>
|
||||
<MudButton Variant="Variant.Text" StartIcon="@Icons.Material.Filled.ArrowBack" Href="@RouteConstants.Club.Membership">بازگشت</MudButton>
|
||||
</MudStack>
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">چرا باشگاه مشتریان؟</MudText>
|
||||
<MudText Typo="Typo.body1" Class="mb-2">
|
||||
با عضویت در باشگاه مشتریان فورست، از تخفیفهای ویژه، امتیازات خرید و خدمات اختصاصی بهرهمند شوید.
|
||||
</MudText>
|
||||
</MudPaper>
|
||||
|
||||
<MudGrid Spacing="3">
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Discount" Color="Color.Primary" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Primary">تخفیفهای ویژه</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.body2">
|
||||
• تخفیف 10% تا 30% برای تمام محصولات<br />
|
||||
• تخفیفهای فصلی و مناسبتی اختصاصی<br />
|
||||
• پیشنهادات ویژه برای اعضای باشگاه<br />
|
||||
• کد تخفیف اختصاصی ماهانه
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Diamond" Color="Color.Secondary" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Secondary">امتیاز خرید</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.body2">
|
||||
• دریافت امتیاز برای هر خرید<br />
|
||||
• تبدیل امتیاز به تخفیف باشگاه<br />
|
||||
• امتیاز ویژه در روزهای خاص<br />
|
||||
• قابلیت انتقال امتیاز به دوستان
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.LocalShipping" Color="Color.Success" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Success">ارسال رایگان</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.body2">
|
||||
• ارسال رایگان برای خریدهای بالای 500 هزار تومان<br />
|
||||
• اولویت در ارسال سفارشات<br />
|
||||
• ارسال اکسپرس با تخفیف 50%<br />
|
||||
• امکان ارسال به چند آدرس
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Support" Color="Color.Info" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Info">پشتیبانی اختصاصی</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.body2">
|
||||
• پشتیبانی 24/7 برای اعضای باشگاه<br />
|
||||
• مشاوره خرید تخصصی<br />
|
||||
• خط ویژه پاسخگویی<br />
|
||||
• پیگیری سریعتر سفارشات
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Groups" Color="Color.Warning" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Warning">درآمد شبکه</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.body2">
|
||||
• دریافت کمیسیون از خریدهای زیرمجموعه<br />
|
||||
• سیستم باینری درختی<br />
|
||||
• محاسبه خودکار درآمد هفتگی<br />
|
||||
• امکان برداشت درآمد شبکه
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Event" Color="Color.Tertiary" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Tertiary">رویدادهای ویژه</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.body2">
|
||||
• دعوت به رویدادهای اختصاصی<br />
|
||||
• پیشفروش محصولات جدید<br />
|
||||
• وبینارهای آموزشی رایگان<br />
|
||||
• جوایز و مسابقات ماهانه
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">چگونه عضو شویم؟</MudText>
|
||||
<MudStepper Orientation="Orientation.Horizontal" Color="Color.Primary">
|
||||
<MudStep Title="انتخاب بسته">
|
||||
<MudText>بسته عضویت مناسب خود را انتخاب کنید</MudText>
|
||||
</MudStep>
|
||||
<MudStep Title="پرداخت">
|
||||
<MudText>هزینه عضویت را پرداخت کنید</MudText>
|
||||
</MudStep>
|
||||
<MudStep Title="فعالسازی">
|
||||
<MudText>عضویت شما فورا فعال میشود</MudText>
|
||||
</MudStep>
|
||||
<MudStep Title="استفاده">
|
||||
<MudText>از مزایای باشگاه لذت ببرید</MudText>
|
||||
</MudStep>
|
||||
</MudStepper>
|
||||
</MudPaper>
|
||||
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
FullWidth="true"
|
||||
Size="Size.Large"
|
||||
StartIcon="@Icons.Material.Filled.CheckCircle"
|
||||
Href="@RouteConstants.Club.Membership">
|
||||
همین حالا عضو شوید
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
@@ -0,0 +1,126 @@
|
||||
@attribute [Route(RouteConstants.Club.Membership)]
|
||||
@using FrontOffice.Main.Pages.Club.Components
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using MudBlazor
|
||||
|
||||
<PageTitle>عضویت باشگاه مشتریان</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
||||
<MudStack Spacing="3">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h5">عضویت باشگاه مشتریان</MudText>
|
||||
<MudButton Variant="Variant.Text" StartIcon="@Icons.Material.Filled.ArrowBack" Href="@RouteConstants.Profile.Index">بازگشت</MudButton>
|
||||
</MudStack>
|
||||
|
||||
@if (_isLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" />
|
||||
}
|
||||
else if (_membership is not null)
|
||||
{
|
||||
<!-- وضعیت عضویت -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h6">وضعیت عضویت شما</MudText>
|
||||
<MudChip T="string" Color="@GetStatusColor()" Variant="Variant.Filled" Size="Size.Medium">
|
||||
@GetStatusText()
|
||||
</MudChip>
|
||||
</MudStack>
|
||||
|
||||
@if (_membership.IsActive)
|
||||
{
|
||||
<MudAlert Severity="Severity.Success" Variant="Variant.Outlined">
|
||||
<MudText>عضویت شما در باشگاه فعال است! از مزایای باشگاه مشتریان استفاده کنید.</MudText>
|
||||
</MudAlert>
|
||||
|
||||
@if (_membership.DaysRemaining.HasValue)
|
||||
{
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Schedule" Color="Color.Info" />
|
||||
<MudText Typo="Typo.body1">
|
||||
@if (_membership.DaysRemaining.Value > 0)
|
||||
{
|
||||
<strong>@_membership.DaysRemaining.Value روز</strong> <text>تا پایان اعتبار عضویت</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>عضویت شما منقضی شده است. لطفا تمدید کنید.</text>
|
||||
}
|
||||
</MudText>
|
||||
</MudStack>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Warning" Variant="Variant.Outlined">
|
||||
<MudText>شما هنوز عضو باشگاه مشتریان نیستید. برای استفاده از مزایای ویژه، اکنون فعال کنید!</MudText>
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<!-- مزایای باشگاه -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">مزایای عضویت باشگاه</MudText>
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="6" md="4">
|
||||
<MudPaper Elevation="0" Class="pa-3 rounded-lg" Style="background-color: var(--mud-palette-primary-lighten);">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Discount" Color="Color.Primary" Size="Size.Large" />
|
||||
<MudStack Spacing="0">
|
||||
<MudText Typo="Typo.subtitle1" Color="Color.Primary">تخفیف ویژه</MudText>
|
||||
<MudText Typo="Typo.caption">تا 30% تخفیف</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="4">
|
||||
<MudPaper Elevation="0" Class="pa-3 rounded-lg" Style="background-color: var(--mud-palette-secondary-lighten);">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Diamond" Color="Color.Secondary" Size="Size.Large" />
|
||||
<MudStack Spacing="0">
|
||||
<MudText Typo="Typo.subtitle1" Color="Color.Secondary">امتیاز خرید</MudText>
|
||||
<MudText Typo="Typo.caption">برای هر خرید</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="4">
|
||||
<MudPaper Elevation="0" Class="pa-3 rounded-lg" Style="background-color: var(--mud-palette-success-lighten);">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.LocalShipping" Color="Color.Success" Size="Size.Large" />
|
||||
<MudStack Spacing="0">
|
||||
<MudText Typo="Typo.subtitle1" Color="Color.Success">ارسال رایگان</MudText>
|
||||
<MudText Typo="Typo.caption">برای سفارشات بالای 500 هزار تومان</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
|
||||
<!-- فعالسازی یا تمدید عضویت -->
|
||||
@if (!_membership.IsActive || (_membership.DaysRemaining.HasValue && _membership.DaysRemaining.Value <= 30))
|
||||
{
|
||||
<ActivationSection OnActivationSuccess="HandleActivationSuccess" />
|
||||
}
|
||||
|
||||
<!-- دکمه مشاهده ویژگیهای بیشتر -->
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Primary"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Filled.Info"
|
||||
Href="@RouteConstants.Club.Features">
|
||||
مشاهده تمام ویژگیهای باشگاه
|
||||
</MudButton>
|
||||
}
|
||||
else if (_hasError)
|
||||
{
|
||||
<MudAlert Severity="Severity.Error" Variant="Variant.Filled">
|
||||
خطا در دریافت اطلاعات عضویت. لطفا دوباره تلاش کنید.
|
||||
</MudAlert>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="LoadMembershipAsync">تلاش مجدد</MudButton>
|
||||
}
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
@@ -0,0 +1,66 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Club;
|
||||
|
||||
public partial class MembershipPage : ComponentBase
|
||||
{
|
||||
[Inject] private ClubMembershipService ClubService { get; set; } = default!;
|
||||
|
||||
private ClubMembershipDto? _membership;
|
||||
private bool _isLoading = true;
|
||||
private bool _hasError = false;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadMembershipAsync();
|
||||
}
|
||||
|
||||
private async Task LoadMembershipAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_isLoading = true;
|
||||
_hasError = false;
|
||||
_membership = await ClubService.GetMyMembershipAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_hasError = true;
|
||||
Snackbar.Add($"خطا در دریافت اطلاعات: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HandleActivationSuccess()
|
||||
{
|
||||
await LoadMembershipAsync();
|
||||
Snackbar.Add("عضویت باشگاه با موفقیت فعال شد!", Severity.Success);
|
||||
}
|
||||
|
||||
private Color GetStatusColor()
|
||||
{
|
||||
if (_membership?.IsActive == true)
|
||||
{
|
||||
if (_membership.DaysRemaining.HasValue && _membership.DaysRemaining.Value <= 30)
|
||||
return Color.Warning;
|
||||
return Color.Success;
|
||||
}
|
||||
return Color.Error;
|
||||
}
|
||||
|
||||
private string GetStatusText()
|
||||
{
|
||||
if (_membership?.IsActive == true)
|
||||
{
|
||||
if (_membership.DaysRemaining.HasValue && _membership.DaysRemaining.Value <= 30)
|
||||
return "نزدیک به انقضا";
|
||||
return "فعال";
|
||||
}
|
||||
return "غیرفعال";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
@attribute [Route(RouteConstants.Commission.Dashboard)]
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using MudBlazor
|
||||
|
||||
<PageTitle>داشبورد کمیسیون</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
||||
<MudStack Spacing="3">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h5">داشبورد کمیسیون</MudText>
|
||||
<MudButton Variant="Variant.Text" StartIcon="@Icons.Material.Filled.ArrowBack" Href="@RouteConstants.Profile.Index">بازگشت</MudButton>
|
||||
</MudStack>
|
||||
|
||||
@if (_isLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<!-- فیلترها -->
|
||||
<MudPaper Elevation="2" Class="pa-3 rounded-lg">
|
||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.End">
|
||||
<MudNumericField @bind-Value="_filterWeekNumber"
|
||||
Label="شماره هفته"
|
||||
Variant="Variant.Outlined"
|
||||
Min="1"
|
||||
Clearable="true"
|
||||
Style="max-width: 150px;" />
|
||||
<MudSelect T="string" @bind-Value="_filterStatus" Label="وضعیت" Variant="Variant.Outlined" Style="max-width: 200px;">
|
||||
<MudSelectItem T="string" Value="@string.Empty">همه</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Created")">ایجاد شده</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Paid")">پرداخت شده</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("WithdrawalRequested")">درخواست برداشت</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Withdrawn")">برداشت شده</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("Cancelled")">لغو شده</MudSelectItem>
|
||||
</MudSelect>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="ApplyFiltersAsync" StartIcon="@Icons.Material.Filled.FilterList">
|
||||
اعمال فیلتر
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Outlined" OnClick="ClearFiltersAsync" StartIcon="@Icons.Material.Filled.Clear">
|
||||
پاک کردن
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<!-- لیست کمیسیونها -->
|
||||
@if (_payouts.Any())
|
||||
{
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
|
||||
<MudTable Items="_payouts" Hover="true" Striped="true" Dense="true">
|
||||
<HeaderContent>
|
||||
<MudTh>هفته</MudTh>
|
||||
<MudTh>تعداد تعادل</MudTh>
|
||||
<MudTh>مبلغ کل</MudTh>
|
||||
<MudTh>وضعیت</MudTh>
|
||||
<MudTh>تاریخ</MudTh>
|
||||
<MudTh>عملیات</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd>
|
||||
<MudChip T="string" Color="Color.Default" Size="Size.Small">@context.WeekLabel</MudChip>
|
||||
</MudTd>
|
||||
<MudTd>@context.BalancesEarned</MudTd>
|
||||
<MudTd>
|
||||
<MudText Color="Color.Success"><strong>@context.AmountFormatted</strong></MudText>
|
||||
</MudTd>
|
||||
<MudTd>
|
||||
<MudChip T="string" Color="@GetStatusColor(context.StatusBadgeColor)" Size="Size.Small" Variant="Variant.Outlined">
|
||||
@context.Status
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd>@context.DatePersian</MudTd>
|
||||
<MudTd>
|
||||
<MudButton Size="Size.Small"
|
||||
Variant="Variant.Text"
|
||||
Color="Color.Info"
|
||||
StartIcon="@Icons.Material.Filled.Info"
|
||||
Href="@($"{RouteConstants.Commission.WeeklyBalance}?week={context.WeekNumber}")">
|
||||
جزئیات
|
||||
</MudButton>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
</MudHidden>
|
||||
|
||||
<MudHidden Breakpoint="Breakpoint.MdAndUp">
|
||||
<MudStack Spacing="2">
|
||||
@foreach (var payout in _payouts)
|
||||
{
|
||||
<MudPaper Class="pa-3 rounded-lg" Outlined="true">
|
||||
<MudStack Spacing="1">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudChip T="string" Color="Color.Default" Size="Size.Small">@payout.WeekLabel</MudChip>
|
||||
<MudChip T="string" Color="@GetStatusColor(payout.StatusBadgeColor)" Size="Size.Small" Variant="Variant.Outlined">
|
||||
@payout.Status
|
||||
</MudChip>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h6" Color="Color.Success">@payout.AmountFormatted</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">تعداد تعادل: @payout.BalancesEarned</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">@payout.DatePersian</MudText>
|
||||
<MudButton Size="Size.Small"
|
||||
Variant="Variant.Outlined"
|
||||
Color="Color.Info"
|
||||
FullWidth="true"
|
||||
StartIcon="@Icons.Material.Filled.Info"
|
||||
Href="@($"{RouteConstants.Commission.WeeklyBalance}?week={payout.WeekNumber}")">
|
||||
مشاهده جزئیات هفته
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
}
|
||||
</MudStack>
|
||||
</MudHidden>
|
||||
|
||||
<!-- Pagination -->
|
||||
<MudPaper Elevation="0" Class="pa-3">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body2">کل: @_totalCount کمیسیون</MudText>
|
||||
<MudPagination Count="@GetTotalPages()" Selected="_pageNumber" SelectedChanged="OnPageChangedAsync" Color="Color.Primary" />
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
|
||||
کمیسیونی برای نمایش وجود ندارد.
|
||||
</MudAlert>
|
||||
}
|
||||
|
||||
<!-- دکمههای بیشتر -->
|
||||
<MudStack Row="true" Spacing="2">
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Secondary"
|
||||
StartIcon="@Icons.Material.Filled.History"
|
||||
Href="@RouteConstants.Commission.History"
|
||||
FullWidth="true">
|
||||
تاریخچه کامل
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Info"
|
||||
StartIcon="@Icons.Material.Filled.BarChart"
|
||||
Href="@RouteConstants.Commission.WeeklyBalance"
|
||||
FullWidth="true">
|
||||
تعادل هفتگی
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
}
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
@@ -0,0 +1,84 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Commission;
|
||||
|
||||
public partial class CommissionDashboardPage : ComponentBase
|
||||
{
|
||||
[Inject] private CommissionService CommissionService { get; set; } = default!;
|
||||
|
||||
private List<CommissionPayoutDto> _payouts = new();
|
||||
private int _totalCount;
|
||||
private int _pageNumber = 1;
|
||||
private int _pageSize = 10;
|
||||
private bool _isLoading = true;
|
||||
|
||||
private int? _filterWeekNumber;
|
||||
private string _filterStatus = string.Empty;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadPayoutsAsync();
|
||||
}
|
||||
|
||||
private async Task LoadPayoutsAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_isLoading = true;
|
||||
var result = await CommissionService.GetMyCommissionPayoutsAsync(
|
||||
_filterWeekNumber,
|
||||
_filterStatus,
|
||||
_pageNumber,
|
||||
_pageSize
|
||||
);
|
||||
_payouts = result.Payouts;
|
||||
_totalCount = result.TotalCount;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"خطا در دریافت کمیسیونها: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ApplyFiltersAsync()
|
||||
{
|
||||
_pageNumber = 1;
|
||||
await LoadPayoutsAsync();
|
||||
}
|
||||
|
||||
private async Task ClearFiltersAsync()
|
||||
{
|
||||
_filterWeekNumber = null;
|
||||
_filterStatus = string.Empty;
|
||||
_pageNumber = 1;
|
||||
await LoadPayoutsAsync();
|
||||
}
|
||||
|
||||
private async Task OnPageChangedAsync(int page)
|
||||
{
|
||||
_pageNumber = page;
|
||||
await LoadPayoutsAsync();
|
||||
}
|
||||
|
||||
private int GetTotalPages()
|
||||
{
|
||||
if (_totalCount == 0 || _pageSize == 0)
|
||||
return 1;
|
||||
return (int)Math.Ceiling(_totalCount / (double)_pageSize);
|
||||
}
|
||||
|
||||
private Color GetStatusColor(string statusColor) => statusColor.ToLower() switch
|
||||
{
|
||||
"success" => Color.Success,
|
||||
"warning" => Color.Warning,
|
||||
"error" => Color.Error,
|
||||
"info" => Color.Info,
|
||||
_ => Color.Default
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
@attribute [Route(RouteConstants.Commission.History)]
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using MudBlazor
|
||||
|
||||
<PageTitle>تاریخچه کمیسیون</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="py-6">
|
||||
<MudStack Spacing="3">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h5">تاریخچه کامل کمیسیون</MudText>
|
||||
<MudButton Variant="Variant.Text" StartIcon="@Icons.Material.Filled.ArrowBack" Href="@RouteConstants.Commission.Dashboard">بازگشت</MudButton>
|
||||
</MudStack>
|
||||
|
||||
@if (_isLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" />
|
||||
}
|
||||
else if (_payouts.Any())
|
||||
{
|
||||
<!-- آمار خلاصه -->
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="4">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">کل کمیسیون دریافتی</MudText>
|
||||
<MudText Typo="Typo.h5" Color="Color.Success">@GetTotalEarnings()</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="4">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">تعداد هفتهها</MudText>
|
||||
<MudText Typo="Typo.h5" Color="Color.Primary">@_payouts.Count</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="4">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">میانگین هفتگی</MudText>
|
||||
<MudText Typo="Typo.h5" Color="Color.Info">@GetAverageWeekly()</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<!-- جدول کامل -->
|
||||
<MudPaper Elevation="2" Class="pa-0 rounded-lg">
|
||||
<MudTable Items="_payouts" Hover="true" Striped="true" Dense="false" FixedHeader="true" Height="600px">
|
||||
<HeaderContent>
|
||||
<MudTh>هفته</MudTh>
|
||||
<MudTh>تعادلها</MudTh>
|
||||
<MudTh>مبلغ (تومان)</MudTh>
|
||||
<MudTh>وضعیت</MudTh>
|
||||
<MudTh>تاریخ</MudTh>
|
||||
<MudTh>جزئیات</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd DataLabel="هفته">
|
||||
<MudChip T="string" Color="Color.Primary" Size="Size.Small" Variant="Variant.Outlined">@context.WeekLabel</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="تعادلها">
|
||||
<MudText>@context.BalancesEarned</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="مبلغ">
|
||||
<MudText Color="Color.Success" Typo="Typo.body1"><strong>@context.AmountFormatted</strong></MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="وضعیت">
|
||||
<MudChip T="string" Color="@GetStatusColor(context.StatusBadgeColor)" Size="Size.Small">
|
||||
@context.Status
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="تاریخ">
|
||||
<MudText Typo="Typo.caption">@context.DatePersian</MudText>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="جزئیات">
|
||||
<MudButton Size="Size.Small"
|
||||
Variant="Variant.Text"
|
||||
Color="Color.Info"
|
||||
StartIcon="@Icons.Material.Filled.Visibility"
|
||||
Href="@($"{RouteConstants.Commission.WeeklyBalance}?week={context.WeekNumber}")">
|
||||
مشاهده
|
||||
</MudButton>
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
</MudPaper>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Filled">
|
||||
هنوز کمیسیونی دریافت نکردهاید.
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
@@ -0,0 +1,65 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Commission;
|
||||
|
||||
public partial class CommissionHistoryPage : ComponentBase
|
||||
{
|
||||
[Inject] private CommissionService CommissionService { get; set; } = default!;
|
||||
|
||||
private List<CommissionPayoutDto> _payouts = new();
|
||||
private bool _isLoading = true;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadAllPayoutsAsync();
|
||||
}
|
||||
|
||||
private async Task LoadAllPayoutsAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_isLoading = true;
|
||||
// Load all payouts (large page size to get everything)
|
||||
var result = await CommissionService.GetMyCommissionPayoutsAsync(
|
||||
null,
|
||||
string.Empty,
|
||||
1,
|
||||
1000
|
||||
);
|
||||
_payouts = result.Payouts;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"خطا در دریافت تاریخچه: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetTotalEarnings()
|
||||
{
|
||||
var total = _payouts.Sum(p => p.TotalAmount);
|
||||
return $"{total:N0} تومان";
|
||||
}
|
||||
|
||||
private string GetAverageWeekly()
|
||||
{
|
||||
if (!_payouts.Any())
|
||||
return "0 تومان";
|
||||
var avg = _payouts.Average(p => p.TotalAmount);
|
||||
return $"{avg:N0} تومان";
|
||||
}
|
||||
|
||||
private Color GetStatusColor(string statusColor) => statusColor.ToLower() switch
|
||||
{
|
||||
"success" => Color.Success,
|
||||
"warning" => Color.Warning,
|
||||
"error" => Color.Error,
|
||||
"info" => Color.Info,
|
||||
_ => Color.Default
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
@attribute [Route(RouteConstants.Commission.WeeklyBalance)]
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using MudBlazor
|
||||
|
||||
<PageTitle>تعادل هفتگی</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
||||
<MudStack Spacing="3">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h5">تعادل هفتگی کمیسیون</MudText>
|
||||
<MudButton Variant="Variant.Text" StartIcon="@Icons.Material.Filled.ArrowBack" Href="@RouteConstants.Commission.Dashboard">بازگشت</MudButton>
|
||||
</MudStack>
|
||||
|
||||
<!-- انتخاب هفته -->
|
||||
<MudPaper Elevation="2" Class="pa-3 rounded-lg">
|
||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.End">
|
||||
<MudNumericField @bind-Value="_selectedWeekNumber"
|
||||
Label="شماره هفته"
|
||||
Variant="Variant.Outlined"
|
||||
Min="1"
|
||||
HelperText="هفته مورد نظر را انتخاب کنید (خالی = هفته جاری)"
|
||||
Style="max-width: 200px;" />
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="LoadWeeklyBalanceAsync" StartIcon="@Icons.Material.Filled.Search">
|
||||
مشاهده
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Outlined" OnClick="LoadCurrentWeekAsync" StartIcon="@Icons.Material.Filled.Today">
|
||||
هفته جاری
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
@if (_isLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" />
|
||||
}
|
||||
else if (_weeklyBalance is not null)
|
||||
{
|
||||
<!-- اطلاعات هفته -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="2">
|
||||
<MudText Typo="Typo.h6">هفته @_weeklyBalance.WeekNumber - @_weeklyBalance.WeekLabel</MudText>
|
||||
<MudDivider />
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">تاریخ شروع:</MudText>
|
||||
<MudText Typo="Typo.body1"><strong>@_weeklyBalance.StartDatePersian</strong></MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">تاریخ پایان:</MudText>
|
||||
<MudText Typo="Typo.body1"><strong>@_weeklyBalance.EndDatePersian</strong></MudText>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<!-- تعادل چپ و راست -->
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronLeft" Color="Color.Info" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Info">شاخه چپ</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h4" Color="Color.Info">@_weeklyBalance.LeftBalanceFormatted</MudText>
|
||||
<MudProgressLinear Color="Color.Info"
|
||||
Value="@GetLeftPercentage()"
|
||||
Size="Size.Large"
|
||||
Class="rounded-lg" />
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
@GetLeftPercentage().ToString("F1")% از کل تعادل
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronRight" Color="Color.Success" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Success">شاخه راست</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h4" Color="Color.Success">@_weeklyBalance.RightBalanceFormatted</MudText>
|
||||
<MudProgressLinear Color="Color.Success"
|
||||
Value="@GetRightPercentage()"
|
||||
Size="Size.Large"
|
||||
Class="rounded-lg" />
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
@GetRightPercentage().ToString("F1")% از کل تعادل
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<!-- محاسبات کمیسیون -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">محاسبات کمیسیون</MudText>
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">تعادل چپ:</MudText>
|
||||
<MudText Typo="Typo.body1" Color="Color.Info"><strong>@_weeklyBalance.LeftBalanceFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">تعادل راست:</MudText>
|
||||
<MudText Typo="Typo.body1" Color="Color.Success"><strong>@_weeklyBalance.RightBalanceFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
<MudDivider />
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">حداقل تعادل (پایه کمیسیون):</MudText>
|
||||
<MudText Typo="Typo.h6" Color="Color.Warning"><strong>@_weeklyBalance.MinBalanceFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">تعداد تعادل (دفعات):</MudText>
|
||||
<MudText Typo="Typo.h6" Color="Color.Secondary"><strong>@_weeklyBalance.BalanceCount</strong></MudText>
|
||||
</MudStack>
|
||||
<MudDivider />
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h6">کمیسیون محاسبه شده:</MudText>
|
||||
<MudText Typo="Typo.h5" Color="Color.Primary"><strong>@_weeklyBalance.CalculatedCommissionFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
|
||||
@if (_weeklyBalance.LeftCarryover > 0 || _weeklyBalance.RightCarryover > 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
|
||||
<MudText Typo="Typo.body2">
|
||||
<strong>Carryover (انتقال به هفته بعد):</strong><br />
|
||||
چپ: @_weeklyBalance.LeftCarryoverFormatted | راست: @_weeklyBalance.RightCarryoverFormatted
|
||||
</MudText>
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<!-- نمودار مقایسه -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">نمودار مقایسه</MudText>
|
||||
<MudChart ChartType="ChartType.Bar"
|
||||
Width="100%"
|
||||
Height="300px"
|
||||
InputData="@(new double[] { _weeklyBalance.LeftBalance, _weeklyBalance.RightBalance, _weeklyBalance.MinBalance })"
|
||||
InputLabels="@(new[] { "چپ", "راست", "حداقل" })"
|
||||
ChartOptions="@_chartOptions" />
|
||||
</MudPaper>
|
||||
}
|
||||
else if (_hasError)
|
||||
{
|
||||
<MudAlert Severity="Severity.Error" Variant="Variant.Filled">
|
||||
خطا در دریافت اطلاعات. لطفا دوباره تلاش کنید.
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
@@ -0,0 +1,82 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Commission;
|
||||
|
||||
public partial class WeeklyBalancePage : ComponentBase
|
||||
{
|
||||
[Inject] private CommissionService CommissionService { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
[SupplyParameterFromQuery(Name = "week")]
|
||||
public int? QueryWeekNumber { get; set; }
|
||||
|
||||
private WeeklyBalanceDto? _weeklyBalance;
|
||||
private int? _selectedWeekNumber;
|
||||
private bool _isLoading = true;
|
||||
private bool _hasError = false;
|
||||
|
||||
private readonly ChartOptions _chartOptions = new()
|
||||
{
|
||||
ChartPalette = new[]
|
||||
{
|
||||
"#2196F3", // Info (Left)
|
||||
"#4CAF50", // Success (Right)
|
||||
"#FF9800" // Warning (Min)
|
||||
}
|
||||
};
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (QueryWeekNumber.HasValue)
|
||||
_selectedWeekNumber = QueryWeekNumber;
|
||||
|
||||
await LoadWeeklyBalanceAsync();
|
||||
}
|
||||
|
||||
private async Task LoadWeeklyBalanceAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_isLoading = true;
|
||||
_hasError = false;
|
||||
_weeklyBalance = await CommissionService.GetMyWeeklyBalanceAsync(_selectedWeekNumber);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_hasError = true;
|
||||
Snackbar.Add($"خطا در دریافت تعادل: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadCurrentWeekAsync()
|
||||
{
|
||||
_selectedWeekNumber = null;
|
||||
await LoadWeeklyBalanceAsync();
|
||||
}
|
||||
|
||||
private double GetLeftPercentage()
|
||||
{
|
||||
if (_weeklyBalance is null)
|
||||
return 0;
|
||||
var total = _weeklyBalance.LeftBalance + _weeklyBalance.RightBalance;
|
||||
if (total == 0)
|
||||
return 0;
|
||||
return (_weeklyBalance.LeftBalance / (double)total) * 100;
|
||||
}
|
||||
|
||||
private double GetRightPercentage()
|
||||
{
|
||||
if (_weeklyBalance is null)
|
||||
return 0;
|
||||
var total = _weeklyBalance.LeftBalance + _weeklyBalance.RightBalance;
|
||||
if (total == 0)
|
||||
return 0;
|
||||
return (_weeklyBalance.RightBalance / (double)total) * 100;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
@attribute [Route(RouteConstants.Network.Statistics)]
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using MudBlazor
|
||||
|
||||
<PageTitle>آمار شبکه</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
||||
<MudStack Spacing="3">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h5">آمار شبکه من</MudText>
|
||||
<MudButton Variant="Variant.Text" StartIcon="@Icons.Material.Filled.ArrowBack" Href="@RouteConstants.Profile.Index">بازگشت</MudButton>
|
||||
</MudStack>
|
||||
|
||||
@if (_isLoading)
|
||||
{
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="true" />
|
||||
}
|
||||
else if (_statistics is not null)
|
||||
{
|
||||
<!-- کارتهای آماری -->
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="1">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">کل اعضای شبکه</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Primary">@_statistics.TotalMembers</MudText>
|
||||
<MudIcon Icon="@Icons.Material.Filled.Groups" Color="Color.Primary" />
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="1">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">شاخه چپ</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Info">@_statistics.LeftLegCount</MudText>
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronLeft" Color="Color.Info" />
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="1">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">شاخه راست</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Success">@_statistics.RightLegCount</MudText>
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronRight" Color="Color.Success" />
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6" md="3">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="1">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">عمق درخت</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Secondary">@_statistics.TreeDepth</MudText>
|
||||
<MudIcon Icon="@Icons.Material.Filled.AccountTree" Color="Color.Secondary" />
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<!-- تعادل شاخهها -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">تعادل شاخهها</MudText>
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">شاخه چپ: <strong>@_statistics.LeftLegCount</strong> عضو</MudText>
|
||||
<MudProgressLinear Color="Color.Info"
|
||||
Value="@GetLeftPercentage()"
|
||||
Size="Size.Medium"
|
||||
Class="rounded-lg"
|
||||
Style="width: 200px;" />
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">شاخه راست: <strong>@_statistics.RightLegCount</strong> عضو</MudText>
|
||||
<MudProgressLinear Color="Color.Success"
|
||||
Value="@GetRightPercentage()"
|
||||
Size="Size.Medium"
|
||||
Class="rounded-lg"
|
||||
Style="width: 200px;" />
|
||||
</MudStack>
|
||||
@if (!string.IsNullOrEmpty(_statistics.WeakerLeg))
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
|
||||
شاخه ضعیفتر: <strong>@GetLegText(_statistics.WeakerLeg)</strong>
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<!-- نمودار دایرهای -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">توزیع اعضا</MudText>
|
||||
<MudChart ChartType="ChartType.Donut"
|
||||
Width="300px"
|
||||
Height="300px"
|
||||
InputData="@(new double[] { _statistics.LeftLegCount, _statistics.RightLegCount })"
|
||||
InputLabels="@(new[] { "شاخه چپ", "شاخه راست" })"
|
||||
ChartOptions="@_chartOptions" />
|
||||
</MudPaper>
|
||||
|
||||
<!-- آخرین عضو -->
|
||||
@if (_statistics.LastMember is not null)
|
||||
{
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">آخرین عضو پیوسته</MudText>
|
||||
<MudStack Row="true" Spacing="3" AlignItems="AlignItems.Center">
|
||||
<MudAvatar Color="Color.Primary" Size="Size.Large">
|
||||
@GetInitials(_statistics.LastMember.FullName)
|
||||
</MudAvatar>
|
||||
<MudStack Spacing="0">
|
||||
<MudText Typo="Typo.body1"><strong>@_statistics.LastMember.FullName</strong></MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
موقعیت: @GetPositionText(_statistics.LastMember.Position)
|
||||
</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
تاریخ عضویت: @_statistics.LastMember.JoinedAt.ToString("yyyy/MM/dd HH:mm")
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
}
|
||||
|
||||
<!-- دکمههای عملیات -->
|
||||
<MudStack Row="true" Spacing="2">
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Filled.AccountTree"
|
||||
Href="@RouteConstants.Profile.Tree"
|
||||
FullWidth="true">
|
||||
مشاهده درخت کامل
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Secondary"
|
||||
StartIcon="@Icons.Material.Filled.Refresh"
|
||||
OnClick="LoadStatisticsAsync"
|
||||
FullWidth="true">
|
||||
بروزرسانی آمار
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
}
|
||||
else if (_hasError)
|
||||
{
|
||||
<MudAlert Severity="Severity.Error" Variant="Variant.Filled">
|
||||
خطا در دریافت آمار شبکه. لطفا دوباره تلاش کنید.
|
||||
</MudAlert>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="LoadStatisticsAsync">تلاش مجدد</MudButton>
|
||||
}
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
@@ -0,0 +1,86 @@
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace FrontOffice.Main.Pages.Network;
|
||||
|
||||
public partial class NetworkStatisticsPage : ComponentBase
|
||||
{
|
||||
[Inject] private NetworkMembershipService NetworkService { get; set; } = default!;
|
||||
|
||||
private NetworkStatisticsDto? _statistics;
|
||||
private bool _isLoading = true;
|
||||
private bool _hasError = false;
|
||||
|
||||
private readonly ChartOptions _chartOptions = new()
|
||||
{
|
||||
ChartPalette = new[]
|
||||
{
|
||||
"#2196F3", // Info (Left)
|
||||
"#4CAF50" // Success (Right)
|
||||
}
|
||||
};
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadStatisticsAsync();
|
||||
}
|
||||
|
||||
private async Task LoadStatisticsAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
_isLoading = true;
|
||||
_hasError = false;
|
||||
_statistics = await NetworkService.GetMyNetworkStatisticsAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_hasError = true;
|
||||
Snackbar.Add($"خطا در دریافت آمار: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private double GetLeftPercentage()
|
||||
{
|
||||
if (_statistics is null || _statistics.TotalMembers == 0)
|
||||
return 0;
|
||||
return (_statistics.LeftLegCount / (double)_statistics.TotalMembers) * 100;
|
||||
}
|
||||
|
||||
private double GetRightPercentage()
|
||||
{
|
||||
if (_statistics is null || _statistics.TotalMembers == 0)
|
||||
return 0;
|
||||
return (_statistics.RightLegCount / (double)_statistics.TotalMembers) * 100;
|
||||
}
|
||||
|
||||
private string GetLegText(string leg) => leg.ToLower() switch
|
||||
{
|
||||
"left" => "شاخه چپ",
|
||||
"right" => "شاخه راست",
|
||||
_ => leg
|
||||
};
|
||||
|
||||
private string GetPositionText(string position) => position.ToLower() switch
|
||||
{
|
||||
"left" => "چپ",
|
||||
"right" => "راست",
|
||||
_ => position
|
||||
};
|
||||
|
||||
private string GetInitials(string fullName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(fullName))
|
||||
return "؟";
|
||||
|
||||
var parts = fullName.Trim().Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length >= 2)
|
||||
return $"{parts[0][0]}{parts[1][0]}";
|
||||
return fullName.Length > 0 ? fullName[0].ToString() : "؟";
|
||||
}
|
||||
}
|
||||
@@ -161,6 +161,39 @@
|
||||
</MudCard>
|
||||
</MudLink>
|
||||
</MudItem>
|
||||
<MudItem xs="6" sm="6" md="3">
|
||||
<MudLink Href="@RouteConstants.Club.Membership" Underline="Underline.None" Class="tile-link">
|
||||
<MudCard Elevation="1" Class="rounded-lg profile-tile">
|
||||
<MudCardContent Class="d-flex flex-column align-center pa-4">
|
||||
<MudIcon Icon="@Icons.Material.Filled.CardMembership" Size="Size.Large" Color="Color.Secondary" />
|
||||
<MudText Typo="Typo.subtitle1" Class="mt-2">باشگاه مشتریان</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">عضویت و مزایا</MudText>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</MudLink>
|
||||
</MudItem>
|
||||
<MudItem xs="6" sm="6" md="3">
|
||||
<MudLink Href="@RouteConstants.Network.Statistics" Underline="Underline.None" Class="tile-link">
|
||||
<MudCard Elevation="1" Class="rounded-lg profile-tile">
|
||||
<MudCardContent Class="d-flex flex-column align-center pa-4">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Groups" Size="Size.Large" Color="Color.Info" />
|
||||
<MudText Typo="Typo.subtitle1" Class="mt-2">شبکه من</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">آمار و درخت شبکه</MudText>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</MudLink>
|
||||
</MudItem>
|
||||
<MudItem xs="6" sm="6" md="3">
|
||||
<MudLink Href="@RouteConstants.Commission.Dashboard" Underline="Underline.None" Class="tile-link">
|
||||
<MudCard Elevation="1" Class="rounded-lg profile-tile">
|
||||
<MudCardContent Class="d-flex flex-column align-center pa-4">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Payments" Size="Size.Large" Color="Color.Success" />
|
||||
<MudText Typo="Typo.subtitle1" Class="mt-2">کمیسیون</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">درآمد و تاریخچه</MudText>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</MudLink>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
@@ -10,23 +10,27 @@
|
||||
</MudStack>
|
||||
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudItem xs="12" sm="6" md="4">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">موجودی اعتباری</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Primary">@_balances.Credit</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">موجودی تخفیف باشگاه</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Primary">@_balances.Discount</MudText>
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">در انتظار اتصال CMS برای مقدار واقعی</MudText>
|
||||
<MudItem xs="12" sm="6" md="4">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="background-color: var(--mud-palette-warning-lighten);">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Discount" Color="Color.Warning" Size="Size.Large" />
|
||||
<MudStack Spacing="0">
|
||||
<MudText Typo="Typo.subtitle2" Style="color: var(--mud-palette-warning-darken);">موجودی تخفیف باشگاه</MudText>
|
||||
<MudText Typo="Typo.h4" Style="color: var(--mud-palette-warning-darken);"><strong>@_balances.Discount</strong></MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudItem xs="12" sm="6" md="4">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">موجودی شبکه</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Primary">@_balances.Network</MudText>
|
||||
<MudText Typo="Typo.h4" Color="Color.Success">@_balances.Network</MudText>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
@@ -39,9 +43,9 @@
|
||||
Variant="Variant.Outlined"
|
||||
Type="MudBlazor.InputType.Number"
|
||||
Required="true" />
|
||||
<MudRadioGroup @bind-SelectedOption="_withdrawMethod" Row="true">
|
||||
<MudRadio Option="@WithdrawalMethodClient.Cash" Label="برداشت نقدی (نیاز به شبا)" />
|
||||
<MudRadio Option="@WithdrawalMethodClient.Diamond" Label="الماس/غیرنقدی" />
|
||||
<MudRadioGroup T="WithdrawalMethodClient" @bind-SelectedOption="_withdrawMethod" Row="true">
|
||||
<MudRadio T="WithdrawalMethodClient" Option="@WithdrawalMethodClient.Cash" Label="برداشت نقدی (نیاز به شبا)" />
|
||||
<MudRadio T="WithdrawalMethodClient" Option="@WithdrawalMethodClient.Diamond" Label="الماس/غیرنقدی" />
|
||||
</MudRadioGroup>
|
||||
<MudTextField @bind-Value="_withdrawIban"
|
||||
Label="شماره شبا"
|
||||
@@ -73,16 +77,16 @@
|
||||
Adornment="Adornment.Start"
|
||||
AdornmentIcon="@Icons.Material.Filled.Search" />
|
||||
<MudSelect T="string" @bind-Value="_filterType" Label="نوع تراکنش" Variant="Variant.Outlined">
|
||||
<MudSelectItem Value="all">همه</MudSelectItem>
|
||||
<MudSelectItem Value="in">ورودی (شارژ)</MudSelectItem>
|
||||
<MudSelectItem Value="out">خروجی (برداشت/خرید)</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("all")">همه</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("in")">ورودی (شارژ)</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("out")">خروجی (برداشت/خرید)</MudSelectItem>
|
||||
</MudSelect>
|
||||
<MudSelect T="string" @bind-Value="_withdrawStatusFilter" Label="وضعیت برداشت" Variant="Variant.Outlined">
|
||||
<MudSelectItem Value="all">همه</MudSelectItem>
|
||||
<MudSelectItem Value="pending">Pending</MudSelectItem>
|
||||
<MudSelectItem Value="requested">Requested</MudSelectItem>
|
||||
<MudSelectItem Value="withdrawn">Withdrawn</MudSelectItem>
|
||||
<MudSelectItem Value="cancelled">Cancelled</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("all")">همه</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("pending")">Pending</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("requested")">Requested</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("withdrawn")">Withdrawn</MudSelectItem>
|
||||
<MudSelectItem T="string" Value="@("cancelled")">Cancelled</MudSelectItem>
|
||||
</MudSelect>
|
||||
<MudButton Variant="Variant.Outlined" OnClick="ApplyFilters" StartIcon="@Icons.Material.Filled.FilterList">اعمال فیلتر</MudButton>
|
||||
</MudStack>
|
||||
@@ -138,7 +142,7 @@
|
||||
<MudTd>@context.WeekNumber</MudTd>
|
||||
<MudTd>@FormatPrice(context.Amount)</MudTd>
|
||||
<MudTd>
|
||||
<MudChip Color="@(ResolveStatusColor(context.Status))" Variant="Variant.Outlined" Size="Size.Small">
|
||||
<MudChip T="string" Color="@(ResolveStatusColor(context.Status))" Variant="Variant.Outlined" Size="Size.Small">
|
||||
@ResolveStatusText(context.Status)
|
||||
</MudChip>
|
||||
</MudTd>
|
||||
|
||||
@@ -6,8 +6,6 @@ namespace FrontOffice.Main.Pages.Profile;
|
||||
|
||||
public partial class Wallet : ComponentBase
|
||||
{
|
||||
[Inject] private ISnackbar Snackbar { get; set; } = default!;
|
||||
|
||||
private long _minWithdrawalAmount = 1_000_000; // مقدار پیشفرض، از CMS خوانده میشود
|
||||
private (string Credit, string Discount, string Network) _balances = ("-", "-", "-");
|
||||
private List<WalletTransaction> _txs = new();
|
||||
|
||||
Reference in New Issue
Block a user