From fbc37da5e4c68ac1571de87ac180efe56a4c1aa0 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Mon, 30 May 2022 20:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AB=AF=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Client/ViewModels/MainViewModel.cs | 44 ++++++++++++++----------- BBWY.Client/Views/MainWindow.xaml | 2 +- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/BBWY.Client/ViewModels/MainViewModel.cs b/BBWY.Client/ViewModels/MainViewModel.cs index 0e7822f3..f4ae849b 100644 --- a/BBWY.Client/ViewModels/MainViewModel.cs +++ b/BBWY.Client/ViewModels/MainViewModel.cs @@ -147,8 +147,11 @@ namespace BBWY.Client.ViewModels GlobalContext.User = mdsUserResponse.Data.Map(); #if RELEASE - if (GlobalContext.User.TeamName != "财务部") - App.Current.Dispatcher.Invoke(() => MenuList.RemoveAt(MenuList.Count() - 1)); + if (GlobalContext.User.TeamName == "财务部") + App.Current.Dispatcher.Invoke(() => + { + for (var i = 0; i < 3; i++) { MenuList.RemoveAt(0); } + }); #endif //请求用户信息接口 @@ -165,24 +168,27 @@ namespace BBWY.Client.ViewModels // } //}; - var shopListResponse = mdsApiService.GetShopsByUserTeam(GlobalContext.User.Id); - if (!shopListResponse.Success) - throw new Exception(shopListResponse.Msg); - if (shopListResponse.Data == null || shopListResponse.Data.Count == 0) - throw new Exception("未绑定店铺"); - var shopList = shopListResponse.Data.Map>(); - if (shopList.Count == 1) - { - ChooseShop(shopList[0], true); - } - else + if (GlobalContext.User.TeamName != "财务部") { - App.Current.Dispatcher.Invoke(() => + var shopListResponse = mdsApiService.GetShopsByUserTeam(GlobalContext.User.Id); + if (!shopListResponse.Success) + throw new Exception(shopListResponse.Msg); + if (shopListResponse.Data == null || shopListResponse.Data.Count == 0) + throw new Exception("未绑定店铺"); + var shopList = shopListResponse.Data.Map>(); + if (shopList.Count == 1) { - foreach (var s in shopList) - ShopList.Add(s); - }); - ShowShopChoosePanel = true; + ChooseShop(shopList[0], true); + } + else + { + App.Current.Dispatcher.Invoke(() => + { + foreach (var s in shopList) + ShopList.Add(s); + }); + ShowShopChoosePanel = true; + } } } catch (Exception ex) @@ -275,6 +281,6 @@ namespace BBWY.Client.ViewModels { Wb2DownloadProgress = e.ProgressPercentage; } -#endregion + #endregion } } diff --git a/BBWY.Client/Views/MainWindow.xaml b/BBWY.Client/Views/MainWindow.xaml index 6e3fb1f5..7b518e08 100644 --- a/BBWY.Client/Views/MainWindow.xaml +++ b/BBWY.Client/Views/MainWindow.xaml @@ -26,7 +26,7 @@ - +