feat: force 100% discount — remove slider, auto-apply max discount from wallet
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
- Remove MudSlider and MudNumericField from Checkout - Auto-apply MaxUsable (full discount balance) - Show fixed '100% تخفیفی' badge on Products, Cart, ProductDetail, Checkout - GatewayAmount = TotalPrice - MaxUsable (no user choice)
This commit is contained in:
@@ -52,11 +52,11 @@
|
||||
}
|
||||
</MudPaper>
|
||||
|
||||
<!-- Discount Balance (Hybrid Payment) -->
|
||||
<!-- Discount Balance (Auto Applied) -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg mb-3">
|
||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center" Class="mb-3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Loyalty" Color="Color.Secondary" />
|
||||
<MudText Typo="Typo.h6">پرداخت از کیف تخفیفی</MudText>
|
||||
<MudText Typo="Typo.h6">تخفیف کیف تخفیفی</MudText>
|
||||
</MudStack>
|
||||
|
||||
<MudStack Spacing="2">
|
||||
@@ -67,37 +67,35 @@
|
||||
</MudText>
|
||||
</MudStack>
|
||||
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="flex-wrap">
|
||||
<MudText Typo="Typo.body2">سقف مجاز تخفیف روی این سفارش:</MudText>
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Success">
|
||||
@FormatPrice(MaxAllowedDiscount) تومان
|
||||
</MudText>
|
||||
</MudStack>
|
||||
|
||||
<MudDivider />
|
||||
|
||||
<MudText Typo="Typo.body2" Class="mud-text-secondary">
|
||||
مبلغی که از کیف تخفیفی کسر شود (باقیمانده از درگاه پرداخت میشود):
|
||||
</MudText>
|
||||
|
||||
<MudSlider T="long" @bind-Value="_discountBalanceToUse"
|
||||
Min="0" Max="@MaxUsable"
|
||||
Step="1000"
|
||||
Color="Color.Secondary"
|
||||
Immediate="true">
|
||||
استفاده از @FormatPrice(_discountBalanceToUse) تومان
|
||||
</MudSlider>
|
||||
|
||||
<MudNumericField T="long" @bind-Value="_discountBalanceToUse"
|
||||
Min="0" Max="@MaxUsable"
|
||||
Label="مبلغ دلخواه (تومان)" Variant="Variant.Outlined"
|
||||
Margin="Margin.Dense" Immediate="true" />
|
||||
|
||||
@if (_discountBalanceToUse > 0)
|
||||
@if (MaxUsable > 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined" Dense="true">
|
||||
مبلغ @FormatPrice(_discountBalanceToUse) تومان از کیف تخفیفی کسر و
|
||||
مبلغ @FormatPrice(GatewayAmount) تومان از درگاه پرداخت دریافت خواهد شد.
|
||||
<MudAlert Severity="Severity.Success" Variant="Variant.Outlined" Dense="true">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center" Class="flex-wrap">
|
||||
<MudText Typo="Typo.body2">مبلغ تخفیف اعمالشده:</MudText>
|
||||
<MudText Typo="Typo.subtitle1" Color="Color.Success" Class="fw-bold">
|
||||
@FormatPrice(MaxUsable) تومان
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudAlert>
|
||||
|
||||
@if (GatewayAmount > 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined" Dense="true">
|
||||
مبلغ @FormatPrice(MaxUsable) تومان از کیف تخفیفی کسر و
|
||||
مبلغ @FormatPrice(GatewayAmount) تومان از درگاه پرداخت دریافت خواهد شد.
|
||||
</MudAlert>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Success" Variant="Variant.Outlined" Dense="true">
|
||||
کل مبلغ سفارش از کیف تخفیفی پرداخت خواهد شد.
|
||||
</MudAlert>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudAlert Severity="Severity.Warning" Variant="Variant.Outlined" Dense="true">
|
||||
موجودی کیف تخفیفی شما کافی نیست. کل مبلغ از درگاه پرداخت دریافت خواهد شد.
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
@@ -139,10 +137,7 @@
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
@item.Quantity × @FormatPrice(item.UnitPrice)
|
||||
</MudText>
|
||||
@if (item.MaxDiscountPercent > 0)
|
||||
{
|
||||
<MudText Typo="Typo.caption" Color="Color.Error">تا @item.MaxDiscountPercent% تخفیف</MudText>
|
||||
}
|
||||
<MudText Typo="Typo.caption" Color="Color.Error">۱۰۰٪ تخفیفی</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudListItemText>
|
||||
@@ -158,11 +153,11 @@
|
||||
<MudText Typo="Typo.body2">@FormatPrice(DiscountCart.TotalPrice)</MudText>
|
||||
</MudStack>
|
||||
|
||||
@if (_discountBalanceToUse > 0)
|
||||
@if (MaxUsable > 0)
|
||||
{
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
||||
<MudText Typo="Typo.body2" Color="Color.Success">از کیف تخفیفی:</MudText>
|
||||
<MudText Typo="Typo.body2" Color="Color.Success">@FormatPrice(_discountBalanceToUse)-</MudText>
|
||||
<MudText Typo="Typo.body2" Color="Color.Success">@FormatPrice(MaxUsable)-</MudText>
|
||||
</MudStack>
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user