From 8a2abefd518e50e5bcfffb266a8d2aa893bdee7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=C2=B7=C3=A6?= <279202647@qq.com> Date: Fri, 22 Oct 2021 19:13:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=93=E6=A0=87=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HuiYan/teamitemsBusiness.cs | 10 +- .../WpfNoticeMsg/NoticeMessage.xaml | 92 +++++++++++++++++++ .../WpfNoticeMsg/NoticeMessage.xaml.cs | 63 +++++++++++++ .../WpfNoticeMsg/WpfNoticeMsg.csproj | 23 +++++ 客户端/齐越慧眼/齐越慧眼.sln | 10 ++ .../UserControls/BrowerControl.xaml.cs | 25 ++++- .../齐越慧眼/齐越慧眼.csproj | 4 + 7 files changed, 218 insertions(+), 9 deletions(-) create mode 100644 客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml create mode 100644 客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml.cs create mode 100644 客户端/齐越慧眼/WpfNoticeMsg/WpfNoticeMsg.csproj diff --git a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs index 75179ea..4cb2287 100644 --- a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs @@ -162,12 +162,14 @@ namespace Coldairarrow.Business.HuiYan public AjaxResult SetItem(TeamitemDto model) { - if (model.RivalGoodsId.Contains(".")) + if (!string.IsNullOrEmpty(model.RivalGoodsId)) { - model.RivalGoodsId = Regex.Match(model.RivalGoodsId+"&", "id=(.*?)&").Groups[1].Value; + if (model.RivalGoodsId.Contains(".")) + { + model.RivalGoodsId = Regex.Match(model.RivalGoodsId + "&", "id=(.*?)&").Groups[1].Value; + } } - - int row= Db.Update(c=>c.Id==model.Id,(item)=> { + int row= Db.Update(c=>c.Id==model.Id,(item)=> { item.ExtensionJson = Newtonsoft.Json.JsonConvert.SerializeObject(model.Extensions); item.RivalGoodsId = model.RivalGoodsId; item.RivalPLCount = model.RivalPLCount; diff --git a/客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml b/客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml new file mode 100644 index 0000000..5881742 --- /dev/null +++ b/客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml.cs b/客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml.cs new file mode 100644 index 0000000..957c167 --- /dev/null +++ b/客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace WpfNoticeMsg +{ + /// + /// NoticeMessage.xaml 的交互逻辑 + /// + public partial class NoticeMessage : Window + { + public NoticeMessage() + { + InitializeComponent(); + } + + /// + /// 显示消息 + /// + /// + /// + /// + public static void Show(string msg, string title = "提示", int sleep = 2000) + { + Application.Current.Dispatcher.BeginInvoke(new Action(() => + { + NoticeMessage noticeMessage = new NoticeMessage(); + noticeMessage.Owner = Application.Current.MainWindow; + noticeMessage.txt_Title.Text = title; + noticeMessage.txtMsg.Text = msg; + + noticeMessage.Height= noticeMessage.grid.ActualHeight; + noticeMessage.Width = noticeMessage.grid.ActualWidth + 30; + + noticeMessage.Show(); + + Task.Factory.StartNew(() => + { + Thread.Sleep(sleep); + Application.Current.Dispatcher.Invoke(() => + { + noticeMessage.Close(); + }); + }); + })); + } + + private void close_Click(object sender, RoutedEventArgs e) + { + this.Close(); + } + } +} diff --git a/客户端/齐越慧眼/WpfNoticeMsg/WpfNoticeMsg.csproj b/客户端/齐越慧眼/WpfNoticeMsg/WpfNoticeMsg.csproj new file mode 100644 index 0000000..80afe0a --- /dev/null +++ b/客户端/齐越慧眼/WpfNoticeMsg/WpfNoticeMsg.csproj @@ -0,0 +1,23 @@ + + + + netcoreapp3.1 + true + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + diff --git a/客户端/齐越慧眼/齐越慧眼.sln b/客户端/齐越慧眼/齐越慧眼.sln index d687459..e0f6f3b 100644 --- a/客户端/齐越慧眼/齐越慧眼.sln +++ b/客户端/齐越慧眼/齐越慧眼.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.30804.86 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "齐越慧眼", "齐越慧眼\齐越慧眼.csproj", "{BAF5933E-1C5F-4316-ABFF-D02263E4AC5A}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfNoticeMsg", "WpfNoticeMsg\WpfNoticeMsg.csproj", "{5206154B-5317-4473-B818-8164CFCED06D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,6 +23,14 @@ Global {BAF5933E-1C5F-4316-ABFF-D02263E4AC5A}.Release|Any CPU.Build.0 = Release|Any CPU {BAF5933E-1C5F-4316-ABFF-D02263E4AC5A}.Release|x64.ActiveCfg = Release|x64 {BAF5933E-1C5F-4316-ABFF-D02263E4AC5A}.Release|x64.Build.0 = Release|x64 + {5206154B-5317-4473-B818-8164CFCED06D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5206154B-5317-4473-B818-8164CFCED06D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5206154B-5317-4473-B818-8164CFCED06D}.Debug|x64.ActiveCfg = Debug|Any CPU + {5206154B-5317-4473-B818-8164CFCED06D}.Debug|x64.Build.0 = Debug|Any CPU + {5206154B-5317-4473-B818-8164CFCED06D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5206154B-5317-4473-B818-8164CFCED06D}.Release|Any CPU.Build.0 = Release|Any CPU + {5206154B-5317-4473-B818-8164CFCED06D}.Release|x64.ActiveCfg = Release|Any CPU + {5206154B-5317-4473-B818-8164CFCED06D}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs index ede5c0d..44c9d97 100644 --- a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs +++ b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs @@ -144,21 +144,30 @@ namespace 齐越慧眼.UserControls if (item.IsFilter) { DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').addClass(""falseBg"")"); + DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")"); } - //判断是否集团过滤 - if (item.HasFilter){ - DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').prepend('
')"); + else + { + //判断是否集团过滤 + if (item.HasFilter) + { + DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').prepend('
')"); + DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")"); + } } + if (item.IsCompeting) { //
DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').prepend('
')"); + DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")"); } if (item.IsScreening) { DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').addClass(""trueBg"")"); + DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")"); } } } @@ -244,9 +253,13 @@ namespace 齐越慧眼.UserControls { width:100%; height:100%; + display:none; background-color: rgba(85, 85, 85, 0.45); } - + .divshow + { + display:block; + } .myopdiv { width:85%; @@ -372,7 +385,9 @@ namespace 齐越慧眼.UserControls BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.myitemState').addClass(""trueBg"")"); } } - MessageBox.Show(result.msg, "提示"); + + + WpfNoticeMsg.NoticeMessage.Show(result.msg, "提示"); return result.isOk; } diff --git a/客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj b/客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj index c81613e..13a0cdf 100644 --- a/客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj +++ b/客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj @@ -89,4 +89,8 @@ + + + +