把绑定的数据的计算移动到线程里
This commit is contained in:
1 parent
2f9c98b105
commit
b827c6e118
14 files changed
+350
-144
No files matched your search
@@ -1,10 +1,12 @@
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.MvvmBaseClasses;
|
||||
using NaiBa.Util.Extension;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace AllBase.Model.DBModel
|
||||
{
|
||||
@@ -16,17 +18,18 @@ namespace AllBase.Model.DBModel
|
||||
set { }
|
||||
}
|
||||
public string OutOrderBuyerStr
|
||||
{
|
||||
get
|
||||
{
|
||||
return GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_id == buyer_account)?.buyer_name ??
|
||||
GlobalConfig.TaobaoBuyerLoginList.FirstOrDefault(b => b.buyer_id == buyer_account)?.buyer_name ?? buyer_account;
|
||||
}
|
||||
set { }
|
||||
{
|
||||
get { return this.GetValue(x => x.OutOrderBuyerStr); }
|
||||
set { this.SetValue(x => x.OutOrderBuyerStr, value); }
|
||||
}
|
||||
public void SetOutOrderBuyerStr()
|
||||
{
|
||||
OutOrderBuyerStr = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => b.buyer_id == buyer_account)?.buyer_name ??
|
||||
GlobalConfig.TaobaoBuyerLoginList.FirstOrDefault(b => b.buyer_id == buyer_account)?.buyer_name ?? buyer_account;
|
||||
}
|
||||
|
||||
|
||||
public long id { get; set; }
|
||||
public long id { get; set; }
|
||||
public string out_order_no { get; set; }
|
||||
public string order_no { get; set; }
|
||||
public string order_sku_id { get; set; }
|
||||
|
||||
@@ -10,9 +10,11 @@ using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||
using Color = System.Windows.Media.Color;
|
||||
|
||||
@@ -126,24 +128,26 @@ namespace AllBase.Model.DBModel
|
||||
|
||||
public string orderStatusStr
|
||||
{
|
||||
get
|
||||
{
|
||||
//状态10 待付款;20 待发货;21 部分发货;30 待收货;100 完成;200 全部商品售后之后,订单取消;250 未付款用户主动取消或超时未付款订单自动取消;
|
||||
if (status == 10)
|
||||
return "待付款";
|
||||
if (status == 21)
|
||||
return "部分发货";
|
||||
if (status == 30)
|
||||
return "待收货";
|
||||
if (status == 100)
|
||||
return "完成";
|
||||
if (status == 200)
|
||||
return "已取消";
|
||||
if (status == 250)
|
||||
return "未付款已取消";
|
||||
return "未知状态";
|
||||
}
|
||||
set { }
|
||||
get { return this.GetValue(x => x.orderStatusStr); }
|
||||
set { this.SetValue(x => x.orderStatusStr, value); }
|
||||
}
|
||||
public void SetOrderStatusStr()
|
||||
{
|
||||
//状态10 待付款;20 待发货;21 部分发货;30 待收货;100 完成;200 全部商品售后之后,订单取消;250 未付款用户主动取消或超时未付款订单自动取消;
|
||||
if (status == 10)
|
||||
orderStatusStr = "待付款";
|
||||
else if (status == 21)
|
||||
orderStatusStr = "部分发货";
|
||||
else if (status == 30)
|
||||
orderStatusStr = "待收货";
|
||||
else if (status == 100)
|
||||
orderStatusStr = "完成";
|
||||
else if (status == 200)
|
||||
orderStatusStr = "已取消";
|
||||
else if (status == 250)
|
||||
orderStatusStr = "未付款已取消";
|
||||
else
|
||||
orderStatusStr = "未知状态";
|
||||
}
|
||||
|
||||
public string RefundTypeStr
|
||||
@@ -230,65 +234,67 @@ namespace AllBase.Model.DBModel
|
||||
/// </summary>
|
||||
public string DeliveryDeadlineStr
|
||||
{
|
||||
get
|
||||
get { return this.GetValue(x => x.DeliveryDeadlineStr); }
|
||||
set { this.SetValue(x => x.DeliveryDeadlineStr, value); }
|
||||
}
|
||||
public void SetDeliveryDeadlineStr()
|
||||
{
|
||||
if (this.status == 20 || this.status == 21)
|
||||
{
|
||||
if (this.status == 20 || this.status == 21)
|
||||
var deadlineTime = BaseClass.StampToDateTime(delivery_deadline.ParseToInt());
|
||||
var nowTime = DateTime.Now;
|
||||
if (deadlineTime < nowTime)
|
||||
DeliveryDeadlineStr = "已超时";
|
||||
else
|
||||
{
|
||||
var deadlineTime = BaseClass.StampToDateTime(delivery_deadline.ParseToInt());
|
||||
var nowTime = DateTime.Now;
|
||||
if (deadlineTime < nowTime)
|
||||
return "已超时";
|
||||
|
||||
var timeSpan = BaseClass.StampToDateTime(delivery_deadline.ParseToInt()) - nowTime;
|
||||
var durationStr = Math.Floor(timeSpan.TotalHours).ParseToInt() + "时" + timeSpan.Minutes + "分" + timeSpan.Seconds + "秒";
|
||||
return durationStr;
|
||||
DeliveryDeadlineStr = durationStr;
|
||||
}
|
||||
if (/*this.out_shipped == 1 */this.ship_done_time.ParseToInt() > 0)
|
||||
return "已发货";
|
||||
else
|
||||
return "未发货";
|
||||
}
|
||||
set { }
|
||||
else if (/*this.out_shipped == 1 */this.ship_done_time.ParseToInt() > 0)
|
||||
DeliveryDeadlineStr = "已发货";
|
||||
else
|
||||
DeliveryDeadlineStr = "未发货";
|
||||
}
|
||||
|
||||
public SolidColorBrush StatusBoxForeColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DeliveryDeadlineStatusStr == "退款中" || DeliveryDeadlineStr == "已超时")
|
||||
return new SolidColorBrush(Color.FromRgb(250, 71, 51)); // #fa4733
|
||||
else if (DeliveryDeadlineStatusStr == "退款完成" || DeliveryDeadlineStr == "已发货")
|
||||
return new SolidColorBrush(Color.FromRgb(103, 194, 58)); // #67c23a
|
||||
else
|
||||
return new SolidColorBrush(Color.FromRgb(3, 151, 181)); // #0397b5
|
||||
}
|
||||
set { }
|
||||
get { return this.GetValue(x => x.StatusBoxForeColor); }
|
||||
set { this.SetValue(x => x.StatusBoxForeColor, value); }
|
||||
}
|
||||
public SolidColorBrush StatusBoxBackColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DeliveryDeadlineStatusStr == "退款中" || DeliveryDeadlineStr == "已超时")
|
||||
return new SolidColorBrush(Color.FromArgb(26, 250, 71, 51)); // #fa4733 0.2
|
||||
else if (DeliveryDeadlineStatusStr == "退款完成" || DeliveryDeadlineStr == "已发货")
|
||||
return new SolidColorBrush(Color.FromArgb(26, 103, 194, 58)); // #67c23a 0.2
|
||||
else
|
||||
return new SolidColorBrush(Color.FromArgb(26, 3, 151, 181)); // #0397b5 0.2
|
||||
}
|
||||
set { }
|
||||
get { return this.GetValue(x => x.StatusBoxBackColor); }
|
||||
set { this.SetValue(x => x.StatusBoxBackColor, value); }
|
||||
}
|
||||
public SolidColorBrush StatusBoxBorderColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (DeliveryDeadlineStatusStr == "退款中" || DeliveryDeadlineStr == "已超时")
|
||||
return new SolidColorBrush(Color.FromArgb(50, 250, 71, 51)); // #fa4733 0.2
|
||||
else if (DeliveryDeadlineStatusStr == "退款完成" || DeliveryDeadlineStr == "已发货")
|
||||
return new SolidColorBrush(Color.FromArgb(50, 103, 194, 58)); // #67c23a 0.2
|
||||
else
|
||||
return new SolidColorBrush(Color.FromArgb(50, 3, 151, 181)); // #0397b5 0.2
|
||||
}
|
||||
set { }
|
||||
get { return this.GetValue(x => x.StatusBoxBorderColor); }
|
||||
set { this.SetValue(x => x.StatusBoxBorderColor, value); }
|
||||
}
|
||||
public void SetStatusBoxColor()
|
||||
{
|
||||
if (DeliveryDeadlineStatusStr == "退款中" || DeliveryDeadlineStr == "已超时")
|
||||
StatusBoxForeColor = GlobalConfig.RedTextBrush; // #fa4733 250, 71, 51
|
||||
else if (DeliveryDeadlineStatusStr == "退款完成" || DeliveryDeadlineStr == "已发货")
|
||||
StatusBoxForeColor = GlobalConfig.GreenTextBrush; // #67c23a 103, 194, 58
|
||||
else
|
||||
StatusBoxForeColor = GlobalConfig.CyanBrush; // #0397b5 3, 151, 181
|
||||
|
||||
if (DeliveryDeadlineStatusStr == "退款中" || DeliveryDeadlineStr == "已超时")
|
||||
StatusBoxBackColor = GlobalConfig.RedTextBrush26; // #fa4733 0.2 26, 250, 71, 51
|
||||
else if (DeliveryDeadlineStatusStr == "退款完成" || DeliveryDeadlineStr == "已发货")
|
||||
StatusBoxBackColor = GlobalConfig.GreenTextBrush26; // #67c23a 0.2 26, 103, 194, 58
|
||||
else
|
||||
StatusBoxBackColor = GlobalConfig.CyanBrush26; // #0397b5 0.2 26, 3, 151, 181
|
||||
|
||||
if (DeliveryDeadlineStatusStr == "退款中" || DeliveryDeadlineStr == "已超时")
|
||||
StatusBoxBorderColor = GlobalConfig.RedTextBrush50; // #fa4733 0.2 50, 250, 71, 51
|
||||
else if (DeliveryDeadlineStatusStr == "退款完成" || DeliveryDeadlineStr == "已发货")
|
||||
StatusBoxBorderColor = GlobalConfig.GreenTextBrush50; // #67c23a 0.2 50, 103, 194, 58
|
||||
else
|
||||
StatusBoxBorderColor = GlobalConfig.CyanBrush50; // #0397b5 0.2 50, 3, 151, 181
|
||||
}
|
||||
|
||||
public string AddressStr
|
||||
@@ -583,6 +589,11 @@ namespace AllBase.Model.DBModel
|
||||
get { return this.GetValue(x => x.colour_flag); }
|
||||
set { this.SetValue(x => x.colour_flag, value); }
|
||||
}
|
||||
public SolidColorBrush ColourFlagBrush
|
||||
{
|
||||
get { return this.GetValue(x => x.ColourFlagBrush); }
|
||||
set { this.SetValue(x => x.ColourFlagBrush, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 旗帜备注时间
|
||||
/// </summary>
|
||||
@@ -680,6 +691,8 @@ namespace AllBase.Model.DBModel
|
||||
|
||||
public void SetOrderTextProperty()
|
||||
{
|
||||
SetOrderStatusStr();
|
||||
|
||||
Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == shop_id.ParseToString());
|
||||
|
||||
if (this.orderItems.Any(oi => oi.OrderItemExt?.buy_type == "直发") && this.orderItems.Any(oi => oi.ItemTransitOrderWithVoid != null))
|
||||
@@ -728,9 +741,28 @@ namespace AllBase.Model.DBModel
|
||||
IsShowTransitExtraPackagesBtn = true;
|
||||
|
||||
SetDeliveryDeadlineStatusStr();
|
||||
SetOutExpressNo();
|
||||
SetDeliveryDeadlineStr();
|
||||
SetStatusBoxColor();
|
||||
SetOutExpressNo();
|
||||
SetShipDoneTimeStr();
|
||||
}
|
||||
SetColorBrush();
|
||||
}
|
||||
|
||||
public void SetColorBrush()
|
||||
{
|
||||
if (this.colour_flag.ParseToInt() == 2)
|
||||
ColourFlagBrush = (SolidColorBrush)Application.Current.Resources["FlagRedBrush"];
|
||||
else if (colour_flag.ParseToInt() == 3)
|
||||
ColourFlagBrush = (SolidColorBrush)Application.Current.Resources["FlagOrangeBrush"];
|
||||
else if (colour_flag.ParseToInt() == 4)
|
||||
ColourFlagBrush = (SolidColorBrush)Application.Current.Resources["FlagGreenBrush"];
|
||||
else if (colour_flag.ParseToInt() == 5)
|
||||
ColourFlagBrush = (SolidColorBrush)Application.Current.Resources["FlagBlueBrush"];
|
||||
else if (colour_flag.ParseToInt() == 6)
|
||||
ColourFlagBrush = (SolidColorBrush)Application.Current.Resources["FlagPurpleBrush"];
|
||||
else
|
||||
ColourFlagBrush = (SolidColorBrush)Application.Current.Resources["FlagGrayBrush"];
|
||||
}
|
||||
|
||||
public bool GetIsWaitBuy()
|
||||
{
|
||||
|
||||
@@ -137,11 +137,32 @@ namespace AllBase.Model.DBModel
|
||||
set { this.SetValue(x => x.ItemRefund, value); }
|
||||
}
|
||||
public string RefundAddressStr
|
||||
{
|
||||
get { return this.GetValue(x => x.RefundAddressStr); }
|
||||
set { this.SetValue(x => x.RefundAddressStr, value); }
|
||||
}
|
||||
public void SetItemRefund()
|
||||
{
|
||||
get { return this.GetValue(x => x.RefundAddressStr); }
|
||||
set
|
||||
{
|
||||
this.SetValue(x => x.RefundAddressStr, value);
|
||||
|
||||
if (value.ParseToString().Length > 26)
|
||||
RefundAddressShortStr = string.Join("", value.ParseToString().Take(26)) + "…";
|
||||
else
|
||||
RefundAddressShortStr = value.ParseToString();
|
||||
|
||||
RefundAddressShortStrVisibility = RefundAddressShortStr.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
public string RefundAddressShortStr
|
||||
{
|
||||
get { return this.GetValue(x => x.RefundAddressShortStr); }
|
||||
set { this.SetValue(x => x.RefundAddressShortStr, value); }
|
||||
}
|
||||
public Visibility RefundAddressShortStrVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.RefundAddressShortStrVisibility); }
|
||||
set { this.SetValue(x => x.RefundAddressShortStrVisibility, value); }
|
||||
}
|
||||
|
||||
public void SetItemRefund()
|
||||
{
|
||||
if (ItemOrder?.refundItems?.Count == 1)
|
||||
ItemRefund = ItemOrder?.refundItems?.FirstOrDefault();
|
||||
@@ -234,7 +255,12 @@ namespace AllBase.Model.DBModel
|
||||
get { return this.GetValue(x => x.ItemTransitOrderWithVoid); }
|
||||
set { this.SetValue(x => x.ItemTransitOrderWithVoid, value); }
|
||||
}
|
||||
public List<oms_wei_external_procurement_after_sale_info> ItemTransitOrderAfterSales { get; set; } = new List<oms_wei_external_procurement_after_sale_info>();
|
||||
public Visibility ItemTransitOutOrderBuyerStrVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.ItemTransitOutOrderBuyerStrVisibility); }
|
||||
set { this.SetValue(x => x.ItemTransitOutOrderBuyerStrVisibility, value); }
|
||||
}
|
||||
public List<oms_wei_external_procurement_after_sale_info> ItemTransitOrderAfterSales { get; set; } = new List<oms_wei_external_procurement_after_sale_info>();
|
||||
public oms_wei_external_procurement_after_sale_info ItemTransitOrderAfterSale
|
||||
{
|
||||
get { return this.GetValue(x => x.ItemTransitOrderAfterSale); }
|
||||
@@ -533,9 +559,15 @@ namespace AllBase.Model.DBModel
|
||||
public string BuyerTransitWaybillStatusStr
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyerTransitWaybillStatusStr); }
|
||||
set { this.SetValue(x => x.BuyerTransitWaybillStatusStr, value); }
|
||||
set { this.SetValue(x => x.BuyerTransitWaybillStatusStr, value); BuyerTransitWaybillStatusStrVisibility = value.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible; }
|
||||
}
|
||||
public void SetBuyerTransitWaybillStatusStr()
|
||||
public Visibility BuyerTransitWaybillStatusStrVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyerTransitWaybillStatusStrVisibility); }
|
||||
set { this.SetValue(x => x.BuyerTransitWaybillStatusStrVisibility, value); }
|
||||
}
|
||||
|
||||
public void SetBuyerTransitWaybillStatusStr()
|
||||
{
|
||||
BuyerTransitWaybillStatusStr = "";
|
||||
|
||||
@@ -642,9 +674,15 @@ namespace AllBase.Model.DBModel
|
||||
public string WarehouseWaybillStatusStr
|
||||
{
|
||||
get { return this.GetValue(x => x.WarehouseWaybillStatusStr); }
|
||||
set { this.SetValue(x => x.WarehouseWaybillStatusStr, value); }
|
||||
set { this.SetValue(x => x.WarehouseWaybillStatusStr, value); WarehouseWaybillStatusStrVisibility = value.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible; }
|
||||
}
|
||||
public void SetWarehouseWaybillStatusStr()
|
||||
public Visibility WarehouseWaybillStatusStrVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.WarehouseWaybillStatusStrVisibility); }
|
||||
set { this.SetValue(x => x.WarehouseWaybillStatusStrVisibility, value); }
|
||||
}
|
||||
|
||||
public void SetWarehouseWaybillStatusStr()
|
||||
{
|
||||
if (order_id == "3737682230178873344")
|
||||
{
|
||||
@@ -763,7 +801,12 @@ namespace AllBase.Model.DBModel
|
||||
public string TransitRefundVoidStatusStr
|
||||
{
|
||||
get { return this.GetValue(x => x.TransitRefundVoidStatusStr); }
|
||||
set { this.SetValue(x => x.TransitRefundVoidStatusStr, value); }
|
||||
set { this.SetValue(x => x.TransitRefundVoidStatusStr, value); TransitRefundVoidStatusStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||||
}
|
||||
public Visibility TransitRefundVoidStatusStrVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.TransitRefundVoidStatusStrVisibility); }
|
||||
set { this.SetValue(x => x.TransitRefundVoidStatusStrVisibility, value); }
|
||||
}
|
||||
public void SetTransitRefundStatusStr()
|
||||
{
|
||||
@@ -803,6 +846,8 @@ namespace AllBase.Model.DBModel
|
||||
// return "中转作废失败";
|
||||
if (ItemTransitOrderWithVoid?.order_void_status == 1)
|
||||
TransitRefundVoidStatusStr = "中转已作废";
|
||||
else
|
||||
TransitRefundVoidStatusStr = "";
|
||||
}
|
||||
|
||||
|
||||
@@ -1531,6 +1576,15 @@ namespace AllBase.Model.DBModel
|
||||
SetOutOrderTimeQualifiedStr();
|
||||
CalcOrderPrice();
|
||||
SetOrderItemStatusAndColor();
|
||||
|
||||
if (this.ItemTransitOrders != null)
|
||||
{
|
||||
foreach (var tOrder in this.ItemTransitOrders)
|
||||
{
|
||||
tOrder.SetOutOrderBuyerStr();
|
||||
}
|
||||
ItemTransitOutOrderBuyerStrVisibility = (ItemTransitOrderWithVoid?.OutOrderBuyerStr).IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> 初始化物流明细信息 </summary>
|
||||
|
||||
@@ -50,12 +50,19 @@ namespace AllBase.Model.DBModel
|
||||
get { return this.GetValue(x => x.ReasonTextStrVisibility); }
|
||||
set { this.SetValue(x => x.ReasonTextStrVisibility, value); }
|
||||
}
|
||||
|
||||
|
||||
public Visibility AfterSaleOrderIdVisibility
|
||||
{
|
||||
get { return this.GetValue(x => x.ReasonTextStrVisibility); }
|
||||
set { this.SetValue(x => x.ReasonTextStrVisibility, value); }
|
||||
}
|
||||
|
||||
public long id { get; set; }
|
||||
public long? shop_id { get; set; }
|
||||
public string after_sale_order_id { get; set; }
|
||||
public string after_sale_order_id
|
||||
{
|
||||
get { return this.GetValue(x => x.after_sale_order_id); }
|
||||
set { this.SetValue(x => x.after_sale_order_id, value); ReasonTextStrVisibility = value.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 售后单当前状态,参考:
|
||||
/// USER_CANCELD 用户取消申请
|
||||
|
||||
Reference in new issue
Block a user