From 7380763c1d6c42b432f17f74c2bfc85f0d58ebc9 Mon Sep 17 00:00:00 2001 From: wule Date: Mon, 19 Oct 2026 19:55:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BA=97=E9=93=BA=E8=AF=BB?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 29WxOrderWpf/MainWindow.xaml.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/29WxOrderWpf/MainWindow.xaml.cs b/29WxOrderWpf/MainWindow.xaml.cs index def6e9b..03e3741 100644 --- a/29WxOrderWpf/MainWindow.xaml.cs +++ b/29WxOrderWpf/MainWindow.xaml.cs @@ -254,16 +254,19 @@ namespace _29WxOrderWpf var tList = new ConcurrentList(); List list = new List(); - Dispatcher.Invoke(new Action(() => - { - })); + List listTmp = new List(); + //Dispatcher.Invoke(new Action(() => + //{ + //})); isReadShop = true; int page = 0; while (true) { + Thread.Sleep(1); + page++; var url = BaseClass.Build29WxObjString("shop/get_shop_list"); - var data = UserLogin.GetSignaturex() + "&page=" + page; + var data = UserLogin.GetSignaturex() + "&page=" + page + "&page_size=100"; data += "&is_get_erp_shop_id=true"; var html = GetHtml.PostUtf8(url, data); if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) @@ -295,12 +298,9 @@ namespace _29WxOrderWpf } list.Add(shop); - if (!GlobalConfig.ShopLoginList.Any(s => s.ShopId == shop.ShopId && !shop.is_point_shop_expire)) + if (!listTmp.Any(s => s.ShopId == shop.ShopId && !shop.is_point_shop_expire)) { - Dispatcher.Invoke(new Action(() => - { - GlobalConfig.ShopLoginList.Add(shop); - })); + listTmp.Add(shop); Task.Run(() => { @@ -352,8 +352,12 @@ namespace _29WxOrderWpf } } } + Dispatcher.Invoke(new Action(() => { + GlobalConfig.ShopLoginList = new AllBase.Util.ObservableCollectionThreadSafe(list); + shopListCtrl.lbxShop.ItemsSource = GlobalConfig.ShopLoginList; + foreach (var shop in GlobalConfig.ShopLoginList.Where(s => !list.Any(ss => ss.ShopId == s.ShopId)).ToList()) { GlobalConfig.ShopLoginList.Remove(shop);