diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml index 5fc1405..7414187 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml @@ -25,17 +25,18 @@ + - - + + - + @@ -45,14 +46,28 @@ - - - - diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs index 5083c40..48ae0e1 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml.cs @@ -45,6 +45,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls public partial class OrderListCtrl : UserControl { public CheckBox chkSelectAll = null; + public OrderFilterConfig orderFilterConfig = null; public bool IsAutoReadOrder = true; public DateTime nextGetOrderTime = DateTime.MinValue; @@ -62,6 +63,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls { lbxOrder.ItemsSource = GlobalConfig.lstFilterOrder; + orderFilterConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig("wx_order_filter_config"); + if (orderFilterConfig == null) + orderFilterConfig = new OrderFilterConfig(); + this.txtFilterGoodsName.Text = string.Join(";", orderFilterConfig.FilterGoodsName); + this.cmbFilterGoodsNameType.SelectedItem = cmbFilterGoodsNameType.Items.Cast().FirstOrDefault(tb => (tb.Content as TextBlock)?.Text == orderFilterConfig.FilterGoodsNameType); + dateStart.SelectedDate = DateTime.Now.Date.AddDays(-7); dateEnd.SelectedDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1); @@ -950,9 +957,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls return true; } // 过滤商品名称 - if (!string.IsNullOrEmpty(txtGoodsName.Text.Trim()) && !order.orderItems.Any(it => it.title.Contains(txtGoodsName.Text.Trim()))) + if (!string.IsNullOrEmpty(txtFilterGoodsName.Text.Trim())) { - return true; + if (orderFilterConfig.FilterGoodsNameType == "标题包含" && !orderFilterConfig.FilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) + return true; + else if (orderFilterConfig.FilterGoodsNameType == "标题不含" && orderFilterConfig.FilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) + return true; } // 过滤id if (!string.IsNullOrEmpty(txtOrderId.Text.Trim()) && !(";" + txtOrderId.Text.Trim().Replace(' ', ';').Replace(',', ';') + ";").Contains(";" + order.order_id + ";")) @@ -1783,5 +1793,35 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls return HttpResponseYkdBLL.YangkeduoPostResponse(buyer, url, body, referer); } + + private void txtGoodsNameFilter_TextChanged(object sender, TextChangedEventArgs e) + { + if (IsLoaded) + { + if (string.Join(";", orderFilterConfig.FilterGoodsName) != txtFilterGoodsName.Text) + { + orderFilterConfig.FilterGoodsName = txtFilterGoodsName.Text.Split(new string[] { ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); + NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_order_filter_config", orderFilterConfig); + } + } + } + + private void cmbFilterGoodsNameType_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (IsLoaded) + { + if (orderFilterConfig.FilterGoodsNameType != ((cmbFilterGoodsNameType.SelectedItem as ComboBoxItem)?.Content as TextBlock)?.Text) + { + orderFilterConfig.FilterGoodsNameType = ((cmbFilterGoodsNameType.SelectedItem as ComboBoxItem)?.Content as TextBlock)?.Text; + NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_order_filter_config", orderFilterConfig); + } + } + } + } + + public class OrderFilterConfig + { + public string FilterGoodsNameType { get; set; } = "标题包含"; + public List FilterGoodsName { get; set; } = new List(); } } diff --git a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml index 1b13b26..a4d9aff 100644 --- a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml +++ b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml @@ -12,7 +12,8 @@ - diff --git a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml.cs b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml.cs index 9ea503b..31a66cc 100644 --- a/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml.cs +++ b/29WxOrderWpf/UserControls/UcWaterMarkTextBox.xaml.cs @@ -45,16 +45,24 @@ namespace _29WxOrderWpf.UserControls { get { return (string)GetValue(WaterMarkProperty) == null ? "" : (string)GetValue(WaterMarkProperty); } set { SetValue(WaterMarkProperty, value); } - } + } - public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register("TextWrapping", typeof(TextWrapping), typeof(UcWaterMarkTextBox), null); - public TextWrapping TextWrapping - { - get { return (TextWrapping)GetValue(TextWrappingProperty); } - set { SetValue(TextWrappingProperty, value); } - } + public static readonly DependencyProperty TextWrappingProperty = DependencyProperty.Register("TextWrapping", typeof(TextWrapping), typeof(UcWaterMarkTextBox), null); + public TextWrapping TextWrapping + { + get { return (TextWrapping)GetValue(TextWrappingProperty); } + set { SetValue(TextWrappingProperty, value); } + } - private void txt_TextChanged(object sender, TextChangedEventArgs e) + public static readonly DependencyProperty TextBorderThicknessProperty = DependencyProperty.Register("TextBorderThickness", typeof(Thickness), typeof(UcWaterMarkTextBox), + new PropertyMetadata(new Thickness(1))); + public Thickness TextBorderThickness + { + get { return (Thickness)GetValue(TextBorderThicknessProperty); } + set { SetValue(TextBorderThicknessProperty, value); } + } + + private void txt_TextChanged(object sender, TextChangedEventArgs e) { this.Text = txt.Text; TextChanged?.Invoke(this, e); diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 1f358ba..6907b06 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -32,7 +32,7 @@ namespace AllBase /// 版本ID /// - public static int VersionCount = 219; + public static int VersionCount = 221; public static string ServerUrl { get; set; } = "http://1.13.195.131:9000"; public static string DebugUrl { get; set; } = "http://localhost:9000"; diff --git a/Work/UserLogin.cs b/Work/UserLogin.cs index a686d0f..fb3b5a1 100644 --- a/Work/UserLogin.cs +++ b/Work/UserLogin.cs @@ -135,7 +135,8 @@ namespace Work BaseClass.ShopPointsPerMonth = BaseRegex.GetStringJson(ref html, "shop_points_per_month").ParseToInt(); BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance"); BaseClass.PostagePerOrder = Math.Max(2.2m, BaseRegex.GetDecimalJson(ref html, "postage_per_order")); - BaseClass.OemId = BaseRegex.GetStringJson(ref html, "oem_id"); + BaseClass.RechargeAmountTotal = BaseRegex.GetDecimalJson(ref html, "recharge_amount_total"); + BaseClass.OemId = BaseRegex.GetStringJson(ref html, "oem_id"); BaseClass.OemName = BaseRegex.GetStringJson(ref html, "oem_name"); BaseClass.IsOemOwner = BaseRegex.GetBoolJson(ref html, "is_oem_owner");