Browse Source

优化打标样式

master
С·æ 4 years ago
parent
commit
8a2abefd51
  1. 10
      src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs
  2. 92
      客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml
  3. 63
      客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml.cs
  4. 23
      客户端/齐越慧眼/WpfNoticeMsg/WpfNoticeMsg.csproj
  5. 10
      客户端/齐越慧眼/齐越慧眼.sln
  6. 25
      客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs
  7. 4
      客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj

10
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<teamitems>(c=>c.Id==model.Id,(item)=> {
int row= Db.Update<teamitems>(c=>c.Id==model.Id,(item)=> {
item.ExtensionJson = Newtonsoft.Json.JsonConvert.SerializeObject(model.Extensions);
item.RivalGoodsId = model.RivalGoodsId;
item.RivalPLCount = model.RivalPLCount;

92
客户端/齐越慧眼/WpfNoticeMsg/NoticeMessage.xaml

@ -0,0 +1,92 @@
<Window x:Class="WpfNoticeMsg.NoticeMessage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfNoticeMsg"
mc:Ignorable="d"
AllowsTransparency="True"
WindowStyle="None"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
Background="Transparent"
Foreground="White"
Title="NoticeMessage" MinHeight="75" MinWidth="350">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="-1" CaptionHeight="2"/>
</WindowChrome.WindowChrome>
<Window.Style>
<Style TargetType="{x:Type Window}">
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Window}">
<Border BorderBrush="#D7D7D7"
BorderThickness="1"
CornerRadius="6"
x:Name="WindowBorder">
<Border.Background>
<SolidColorBrush Opacity="0.6" Color="Black"></SolidColorBrush>
</Border.Background>
<Grid x:Name="LayoutRoot"
Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid x:Name="WindowTitlePanel"
Background="{TemplateBinding BorderBrush}"
Margin="0,-1,0,0">
<ContentPresenter Content="{TemplateBinding Tag}"></ContentPresenter>
</Grid>
<AdornerDecorator Grid.Row="1"
KeyboardNavigation.IsTabStop="False">
<ContentPresenter Content="{TemplateBinding Content}"
x:Name="MainContentPresenter"
KeyboardNavigation.TabNavigation="Cycle" />
</AdornerDecorator>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Style>
<Window.Tag>
<Border Padding="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="提示" FontSize="14" Padding="20 5" x:Name="txt_Title"></TextBlock>
<Button Padding="10" Grid.Column="1" HorizontalAlignment="Right" Name="close" Click="close_Click">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Padding="{TemplateBinding Padding}">
<Border.Background>
<SolidColorBrush Color="White" Opacity="0.01"></SolidColorBrush>
</Border.Background>
<Path Data="M0 0 10 10 M5 5 10 0 M5 5 0 10" Stroke="White" ></Path>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</Border>
</Window.Tag>
<Grid x:Name="grid" >
<TextBlock Margin="20 0 20 15" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="txtMsg"></TextBlock>
</Grid>
</Window>

63
客户端/齐越慧眼/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
{
/// <summary>
/// NoticeMessage.xaml 的交互逻辑
/// </summary>
public partial class NoticeMessage : Window
{
public NoticeMessage()
{
InitializeComponent();
}
/// <summary>
/// 显示消息
/// </summary>
/// <param name="msg"></param>
/// <param name="title"></param>
/// <param name="sleep"></param>
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();
}
}
}

23
客户端/齐越慧眼/WpfNoticeMsg/WpfNoticeMsg.csproj

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MvvmLightLibsStd10" Version="5.4.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
</Project>

10
客户端/齐越慧眼/齐越慧眼.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

25
客户端/齐越慧眼/齐越慧眼/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('<div class=""smallfalseBg""></div>')");
else
{
//判断是否集团过滤
if (item.HasFilter)
{
DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').prepend('<div class=""smallfalseBg""></div>')");
DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")");
}
}
if (item.IsCompeting)
{
//<div style=""width:20%;height:20%"" class=""bgYellow"">竞</div>
DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').prepend('<div style=""width:20%;height:20%"" class=""bgYellow"">竞</div>')");
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;
}

4
客户端/齐越慧眼/齐越慧眼/齐越慧眼.csproj

@ -89,4 +89,8 @@
<Folder Include="vuepage\client\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WpfNoticeMsg\WpfNoticeMsg.csproj" />
</ItemGroup>
</Project>

Loading…
Cancel
Save