Refactor commission-related pages and terminology to enhance clarity and consistency
Build and Deploy / build (push) Successful in 1m22s
Build and Deploy / build (push) Successful in 1m22s
- Updated CommissionDashboardPage to reflect new terminology for rewards instead of commissions. - Removed CommissionHistoryPage as its functionality has been integrated into the dashboard. - Adjusted WeeklyBalancePage to align with new reward terminology and improved layout. - Modified Index, NetworkStatisticsPage, MyPackages, Packages, Profile, and Wallet pages to use consistent terms related to team and rewards. - Updated ClubMembershipContractDialog to clarify user invitation terms. - Enhanced footer description to reflect the focus on sales teams.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using FrontOffice.Main.Shared;
|
||||
using FrontOffice.Main.Utilities;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
@@ -10,11 +11,13 @@ public partial class CommissionDashboardPage : ComponentBase
|
||||
|
||||
private List<CommissionPayoutDto> _payouts = new();
|
||||
private int _totalCount;
|
||||
private long _totalAmount;
|
||||
private int _pageNumber = 1;
|
||||
private int _pageSize = 10;
|
||||
private bool _isLoading = true;
|
||||
|
||||
private int? _filterWeekNumber;
|
||||
private WeekSelector? _weekSelector;
|
||||
private WeekDefinitionDto? _selectedWeekDefinition;
|
||||
private string _filterStatus = string.Empty;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -27,18 +30,20 @@ public partial class CommissionDashboardPage : ComponentBase
|
||||
try
|
||||
{
|
||||
_isLoading = true;
|
||||
var weekDefinitionId = _selectedWeekDefinition?.Id;
|
||||
var result = await CommissionService.GetMyCommissionPayoutsAsync(
|
||||
_filterWeekNumber,
|
||||
weekDefinitionId,
|
||||
_filterStatus,
|
||||
_pageNumber,
|
||||
_pageSize
|
||||
);
|
||||
_payouts = result.Payouts;
|
||||
_totalCount = result.TotalCount;
|
||||
_totalAmount = _payouts.Sum(p => p.TotalAmount);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"خطا در دریافت کمیسیونها: {ex.Message}", Severity.Error);
|
||||
Snackbar.Add($"خطا در دریافت پاداشها: {ex.Message}", Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -54,7 +59,7 @@ public partial class CommissionDashboardPage : ComponentBase
|
||||
|
||||
private async Task ClearFiltersAsync()
|
||||
{
|
||||
_filterWeekNumber = null;
|
||||
_selectedWeekDefinition = null;
|
||||
_filterStatus = string.Empty;
|
||||
_pageNumber = 1;
|
||||
await LoadPayoutsAsync();
|
||||
@@ -73,6 +78,19 @@ public partial class CommissionDashboardPage : ComponentBase
|
||||
return (int)Math.Ceiling(_totalCount / (double)_pageSize);
|
||||
}
|
||||
|
||||
private string GetTotalEarnings()
|
||||
{
|
||||
return $"{_totalAmount:N0} تومان";
|
||||
}
|
||||
|
||||
private string GetAverageWeekly()
|
||||
{
|
||||
if (_totalCount == 0)
|
||||
return "0 تومان";
|
||||
var avg = _totalAmount / _totalCount;
|
||||
return $"{avg:N0} تومان";
|
||||
}
|
||||
|
||||
private Color GetStatusColor(string statusColor) => statusColor.ToLower() switch
|
||||
{
|
||||
"success" => Color.Success,
|
||||
|
||||
Reference in New Issue
Block a user