From 57441f853c235d863edce2b8183d071d7ad49be7 Mon Sep 17 00:00:00 2001 From: wule Date: Wed, 5 Aug 2026 14:08:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=B0=E6=89=8B=E8=AF=BB=E5=8D=95=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BuyerCtrls/PDDBuyerOrderReadCtrl.xaml | 60 ++++++++- .../BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs | 118 ++++++++++++++---- .../Ctrls/ShopCtrls/ShopListCtrl.xaml.cs | 4 +- AllBase/BaseClass.cs | 2 +- AllBase/Helper/GlobalConfig.cs | 4 +- AllBase/Model/DBModel/BuyerLoginInfo.cs | 12 +- 6 files changed, 169 insertions(+), 31 deletions(-) diff --git a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml index 7d31828..72891d0 100644 --- a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml +++ b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls" mc:Ignorable="d" Loaded="UserControl_Loaded" - d:DesignHeight="450" d:DesignWidth="1000"> + d:DesignHeight="450" d:DesignWidth="1000" x:Name="pddBuyerOrderReadCtrl"> @@ -42,7 +42,65 @@ + diff --git a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs index 218aeea..c9ce70e 100644 --- a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs @@ -42,6 +42,7 @@ using Work; using Work._29Tools.BLL; using Work._29Tools.CefTools; using Work.BaseForms; +using Work.BuyUsers; using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab; namespace _29WxOrderWpf.Ctrls.BuyerCtrls @@ -149,6 +150,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls private void UserControl_Loaded(object sender, RoutedEventArgs e) { + this.lbPddBuyer.ItemsSource = GlobalConfig.PDDBuyerLoginList; + buyerReadOrderConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig("pdd_buyer_read_order_config"); if (buyerReadOrderConfig == null) buyerReadOrderConfig = new BuyerReadOrderConfig(); @@ -249,24 +252,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls public void InitCef() { - //CefSharp.Wpf.ChromiumWebBrowser cefWebBrowser = new CefSharp.Wpf.ChromiumWebBrowser(); - //cefWebBrowser.Address = "https://www.baidu.com"; - //cefWebBrowser = WPFCEFBrowser.CreateChromiumWebBrowser("https://www.baidu.com", false); - //Grid.SetRow(cefWebBrowser, 0); - //this.GridCef.Children.Add(cefWebBrowser); - - //LocalResourceRequestHandler resourceRequestHandler = new LocalResourceRequestHandler(); - //resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete; - //resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad; - //cefWebBrowser.RequestHandler = new LocalRequestHandler(resourceRequestHandler); - //var lifeSapnHandler = new LocalLifeSpanHandler(PopWindowType.SelfWindow); - //cefWebBrowser.LifeSpanHandler = lifeSapnHandler; - //cefWebBrowser.KeyboardHandler = new KeyboardHandler(); - //cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd; - //cefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged; - //cefWebBrowser.LoadError += CefWebBrowser_LoadError; - - foreach (var buyer in GlobalConfig.PDDBuyerLoginList) { Thread.Sleep(1); @@ -1413,6 +1398,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls readBuyer = buyer.buyer_id; currentReadBuyer = buyer.buyer_id; buyer.wpf_browser.Load("https://mobile.yangkeduo.com/complaint_list.html?refer_page_name=personal&refer_page_sn=10001&tab=all"); + + Dispatcher.Invoke(new Action(() => + { + Panel.SetZIndex(buyer.wpf_browser, maxZIndex++); + if (buyer.IsSelect != true) + { + foreach (var b in GlobalConfig.PDDBuyerLoginList) + { + b.IsSelect = false; + } + buyer.IsSelect = true; + } + })); + Thread.Sleep(Randomx.GetId(2000, 3000)); Dispatcher.Invoke(new Action(() => { MainWindow.Instance.Title = buyer.buyer_nick + " 售后读取中"; })); @@ -1441,8 +1440,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls break; } - Dispatcher.Invoke(new Action(() => { Panel.SetZIndex(buyer.wpf_browser, maxZIndex++); })); - top += Randomx.GetId(450, 600); Thread.Sleep(Randomx.GetId(100, 300)); @@ -1478,6 +1475,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls readBuyer = buyer.buyer_id; currentReadBuyer = buyer.buyer_id; buyer.wpf_browser.Load("https://mobile.yangkeduo.com/orders.html?type=2"); + + Dispatcher.Invoke(new Action(() => + { + Panel.SetZIndex(buyer.wpf_browser, maxZIndex++); + if (buyer.IsSelect != true) + { + foreach (var b in GlobalConfig.PDDBuyerLoginList) + { + b.IsSelect = false; + } + buyer.IsSelect = true; + } + })); + Thread.Sleep(Randomx.GetId(2000, 3000)); Dispatcher.Invoke(new Action(() => { MainWindow.Instance.Title = buyer.buyer_nick + " 待发货读取中"; })); @@ -1513,8 +1524,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls break; times++; - Dispatcher.Invoke(new Action(() => { Panel.SetZIndex(buyer.wpf_browser, maxZIndex++); })); - top += Randomx.GetId(450, 600); Thread.Sleep(Randomx.GetId(100, 300)); @@ -1551,6 +1560,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls readBuyer = buyer.buyer_id; currentReadBuyer = buyer.buyer_id; buyer.wpf_browser.Load("https://mobile.yangkeduo.com/orders.html?type=3"); + + Dispatcher.Invoke(new Action(() => + { + Panel.SetZIndex(buyer.wpf_browser, maxZIndex++); + if (buyer.IsSelect != true) + { + foreach (var b in GlobalConfig.PDDBuyerLoginList) + { + b.IsSelect = false; + } + buyer.IsSelect = true; + } + })); + Thread.Sleep(Randomx.GetId(2000, 3000)); top = 0; @@ -1575,8 +1598,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls break; } - Dispatcher.Invoke(new Action(() => { Panel.SetZIndex(buyer.wpf_browser, maxZIndex++); })); - top += Randomx.GetId(450, 600); Thread.Sleep(Randomx.GetId(100, 300)); @@ -2342,6 +2363,20 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls } } + private void btnHideBuyer_Click(object sender, RoutedEventArgs e) + { + if (btnHideBuyer.Content.ParseToString() == "▶") + { + btnHideBuyer.Content = "◀"; + borderPddBuyer.Visibility = Visibility.Visible; + } + else + { + btnHideBuyer.Content = "▶"; + borderPddBuyer.Visibility = Visibility.Collapsed; + } + } + private void chkAutoAfterSale_Checked(object sender, RoutedEventArgs e) { if (isLoad) @@ -2360,6 +2395,41 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls else Panel.SetZIndex(MainWindow.Instance.gridPddBuyerOrderReadCtrl, -1); } + + private void CheckBox_Click(object sender, RoutedEventArgs e) + { + if (sender is CheckBox chk) + { + if (chk.DataContext is BuyerLoginInfo pddBuyer) + { + foreach (var buyer in GlobalConfig.PDDBuyerLoginList) + { + buyer.IsSelect = false; + } + pddBuyer.IsSelect = true; + if (pddBuyer.wpf_browser != null) + Panel.SetZIndex(pddBuyer.wpf_browser, maxZIndex++); + } + } + //if (e.Source) + } + + private void TextBox_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + if (sender is TextBox txt) + { + if (txt.DataContext is BuyerLoginInfo pddBuyer) + { + foreach (var buyer in GlobalConfig.PDDBuyerLoginList) + { + buyer.IsSelect = false; + } + pddBuyer.IsSelect = true; + if (pddBuyer.wpf_browser != null) + Panel.SetZIndex(pddBuyer.wpf_browser, maxZIndex++); + } + } + } } public class YkdBuyerOrder diff --git a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml.cs b/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml.cs index bb4cd04..8abeedc 100644 --- a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml.cs @@ -39,7 +39,7 @@ namespace _29WxOrderWpf.Ctrls.ShopCtrls private void shopListCtrl_Loaded(object sender, RoutedEventArgs e) { - this.lbxShop.ItemsSource = new ObservableCollection(GlobalConfig.ShopLoginList); + this.lbxShop.ItemsSource = GlobalConfig.ShopLoginList; Task.Run(() => { while(MainWindow.Instance.hasReadShop == false) @@ -168,7 +168,7 @@ namespace _29WxOrderWpf.Ctrls.ShopCtrls txtShopName.Text = ""; cmbNotes.Text = ""; cmbGroup.Text = ""; - this.lbxShop.ItemsSource = new ObservableCollection(GlobalConfig.ShopLoginList); + this.lbxShop.ItemsSource = GlobalConfig.ShopLoginList; } private void btnRefreshShop_Click(object sender, RoutedEventArgs e) diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index fce2d68..7821e8c 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -32,7 +32,7 @@ namespace AllBase /// 版本ID /// - public static int VersionCount = 207; + public static int VersionCount = 208; public static string ServerUrl { get; set; } = "http://1.13.195.131:9000"; public static string DebugUrl { get; set; } = "http://localhost:9000"; diff --git a/AllBase/Helper/GlobalConfig.cs b/AllBase/Helper/GlobalConfig.cs index 2702910..fd0680c 100644 --- a/AllBase/Helper/GlobalConfig.cs +++ b/AllBase/Helper/GlobalConfig.cs @@ -26,11 +26,11 @@ namespace AllBase.Helper /// /// 店铺列表 /// - public static ConcurrentList ShopLoginList { get; set; } = new ConcurrentList(); + public static ObservableCollectionThreadSafe ShopLoginList { get; set; } = new ObservableCollectionThreadSafe(); /// /// 拼多多买手列表 /// - public static ObservableCollection PDDBuyerLoginList { get; set; } = new ObservableCollection(); + public static ObservableCollectionThreadSafe PDDBuyerLoginList { get; set; } = new ObservableCollectionThreadSafe(); /// /// 当前拼多多买手 /// diff --git a/AllBase/Model/DBModel/BuyerLoginInfo.cs b/AllBase/Model/DBModel/BuyerLoginInfo.cs index 7662d05..3c7d4f3 100644 --- a/AllBase/Model/DBModel/BuyerLoginInfo.cs +++ b/AllBase/Model/DBModel/BuyerLoginInfo.cs @@ -10,11 +10,21 @@ namespace AllBase.Model.DBModel { public class BuyerLoginInfo : PropertyNotifyObject { + public bool IsSelect + { + get { return this.GetValue(x => x.IsSelect); } + set { this.SetValue(x => x.IsSelect, value); } + } + public int id { get; set; } public string user_name { get; set; } public string buyer_id { get; set; } public string buyer_name { get; set; } - public string buyer_nick { get; set; } + public string buyer_nick + { + get { return this.GetValue(x => x.buyer_nick); } + set { this.SetValue(x => x.buyer_nick, value); } + } public string cookie { get; set; } public string status {