feat(order-details): add mobile display logic and remove unused status methods
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m36s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 6m36s
- Introduced a new property to display the user's mobile number or fallback to the address phone number in OrderDetailsDialog. - Removed obsolete methods for determining order status color and text, streamlining the component's code.
This commit is contained in:
@@ -20,6 +20,9 @@ public partial class OrderDetailsDialog
|
|||||||
private bool _isSaving;
|
private bool _isSaving;
|
||||||
private List<TimelineStep> _timelineSteps = new();
|
private List<TimelineStep> _timelineSteps = new();
|
||||||
|
|
||||||
|
private string? DisplayMobile =>
|
||||||
|
!string.IsNullOrWhiteSpace(Order.UserMobile) ? Order.UserMobile : Order.Address?.Phone;
|
||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
_newStatus = Order.Status;
|
_newStatus = Order.Status;
|
||||||
@@ -130,36 +133,6 @@ public partial class OrderDetailsDialog
|
|||||||
|
|
||||||
private void Close() => MudDialog.Close();
|
private void Close() => MudDialog.Close();
|
||||||
|
|
||||||
private Color GetStatusColor(OrderStatus status)
|
|
||||||
{
|
|
||||||
return status switch
|
|
||||||
{
|
|
||||||
OrderStatus.Pending => Color.Warning,
|
|
||||||
OrderStatus.Paid => Color.Info,
|
|
||||||
OrderStatus.Processing => Color.Primary,
|
|
||||||
OrderStatus.Shipped => Color.Secondary,
|
|
||||||
OrderStatus.Delivered => Color.Success,
|
|
||||||
OrderStatus.Cancelled => Color.Error,
|
|
||||||
OrderStatus.Returned => Color.Dark,
|
|
||||||
_ => Color.Default
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private string GetStatusText(OrderStatus status)
|
|
||||||
{
|
|
||||||
return status switch
|
|
||||||
{
|
|
||||||
OrderStatus.Pending => "در انتظار پرداخت",
|
|
||||||
OrderStatus.Paid => "پرداخت شده",
|
|
||||||
OrderStatus.Processing => "در حال آمادهسازی",
|
|
||||||
OrderStatus.Shipped => "ارسال شده",
|
|
||||||
OrderStatus.Delivered => "تحویل داده شده",
|
|
||||||
OrderStatus.Cancelled => "لغو شده",
|
|
||||||
OrderStatus.Returned => "مرجوع شده",
|
|
||||||
_ => "نامشخص"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private Color GetPaymentStatusColor(int status) => status switch
|
private Color GetPaymentStatusColor(int status) => status switch
|
||||||
{
|
{
|
||||||
0 => Color.Warning,
|
0 => Color.Warning,
|
||||||
|
|||||||
Reference in New Issue
Block a user