Explorar el Código

提交更新

样式分支
fyf hace 2 años
padre
commit
2f73a52f8e
Se han modificado 23 ficheros con 991 adiciones y 208 borrados
  1. +3
    -0
      BPASmartClient.ScreenALL/App.config
  2. +328
    -0
      BPASmartClient.ScreenLib/Helper/HttpRequestHelper.cs
  3. +53
    -0
      BPASmartClient.ScreenLib/Helper/Main.cs
  4. +81
    -0
      BPASmartClient.ScreenLib/Model/OrderMakeModel.cs
  5. +4
    -4
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml
  6. +49
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml.cs
  7. +16
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs
  8. +189
    -188
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml
  9. +49
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml.cs
  10. +16
    -0
      BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2ViewModel.cs
  11. +4
    -4
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml
  12. +48
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml.cs
  13. +15
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs
  14. +4
    -4
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml
  15. +48
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml.cs
  16. +16
    -0
      BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs
  17. +6
    -6
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml
  18. +48
    -0
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml.cs
  19. +1
    -0
      BPASmartClient.ScreenLib/煮面机/ScreenMorksControlViewModel.cs
  20. +3
    -0
      BPASmartClient.ScreenMaxWok/App.config
  21. +3
    -0
      BPASmartClient.ScreenMinWok/App.config
  22. +4
    -1
      BPASmartClient.ScreenMorks/App.config
  23. +3
    -1
      BPASmartClient.ScreenSplitMeals/App.config

+ 3
- 0
BPASmartClient.ScreenALL/App.config Ver fichero

@@ -6,5 +6,8 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 328
- 0
BPASmartClient.ScreenLib/Helper/HttpRequestHelper.cs Ver fichero

@@ -0,0 +1,328 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.ScreenLib
{
/// <summary>
/// 该类实现客户端http 同步请求
/// 支持环境 -.net4.0/-.net4.5
/// 创建人:奉友福
/// </summary>
public class HttpRequestHelper
{
#region 私有变量
#endregion

#region 公用函数
/// <summary>
/// GET 同步请求
/// 创建人:奉友福
/// 创建时间:2020-11-19
/// </summary>
/// <param name="url">请求地址</param>
/// <returns>超时时间设置,默认5秒</returns>
public static string HttpGetRequest(string url, int _timeout = 2000)
{
string resultData = string.Empty;

try
{
WebClient wc = new WebClient();
byte[] bytes = wc.DownloadData(url);
string s = Encoding.UTF8.GetString(bytes);
return s;
}
catch (Exception e)
{
throw e;
}
return "";

try
{
var getrequest = HttpRequest.GetInstance().CreateHttpRequest(url, "GET", _timeout);
var getreponse = getrequest.GetResponse() as HttpWebResponse;
resultData = HttpRequest.GetInstance().GetHttpResponse(getreponse, "GET");
}
catch (Exception)
{
throw;
}
return resultData;
}
/// <summary>
/// POST 同步请求
/// 创建人:奉友福
/// 创建时间:2020-11-19
/// </summary>
/// <param name="url">请求地址</param>
/// <param name="PostJsonData">请求数据</param>
/// <returns></returns>
public static string HttpPostRequest(string url, string PostJsonData, int _timeout = 2000)
{
string resultData = string.Empty;
try
{
var postrequest = HttpRequest.GetInstance().CreateHttpRequest(url, "POST", _timeout, PostJsonData);
var postreponse = postrequest.GetResponse() as HttpWebResponse;
resultData = HttpRequest.GetInstance().GetHttpResponse(postreponse, "POST");
}
catch (Exception ex)
{
return ex.Message;
}
return resultData;
}

public static string HttpDeleteRequest(string url, string PostJsonData, int _timeout = 10000)
{
string resultData = string.Empty;
try
{
var deleteRequest = HttpRequest.CreateDeleteHttpRequest(url, PostJsonData, _timeout);
var deleteReponse = deleteRequest.GetResponse() as HttpWebResponse;
using (StreamReader reader = new StreamReader(deleteReponse.GetResponseStream(), Encoding.GetEncoding("UTF-8")))
{
resultData = reader.ReadToEnd();
}
}
catch (Exception ex)
{
}
return resultData;
}

/// <summary>
/// GET 同步请求
/// </summary>
/// <param name="url">地址</param>
/// <param name="head">头</param>
/// <param name="headInfo">内容</param>
/// <returns></returns>
public static string GetHttpGetResponseWithHead(string url, HttpRequestHeader head, string headInfo)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.ContentType = "application/json;charset=UTF-8";
request.Timeout = 6000;
request.Headers.Set(head, headInfo);
StreamReader sr = null;
HttpWebResponse response = null;
Stream stream = null;
try
{
response = (HttpWebResponse)request.GetResponse();
stream = response.GetResponseStream();
sr = new StreamReader(stream, Encoding.GetEncoding("utf-8"));
var resultData = sr.ReadToEnd();
return resultData;
}
catch (Exception ex)
{
Console.WriteLine(url + " 访问失败:" + ex.Message);
//return ex.Message;
}
finally
{
if (response != null)
{
response.Dispose();
}
if (stream != null)
{
stream.Dispose();
}
if (sr != null)
{
sr.Dispose();
}
}
return null;
}



/// <summary>
/// Post请求带Token
/// 2021-2-2 by dulf
/// </summary>
/// <param name="url"></param>
/// <param name="head"></param>
/// <param name="headInfo"></param>
/// <param name="postParam"></param>
/// <returns></returns>
public static string HttpPostResponseWithHead(string url, HttpRequestHeader head, string headInfo, string postParam, int Timeout = 6000)
{
string resultData = string.Empty;
try
{
var postrequest = WebRequest.Create(url) as HttpWebRequest;
postrequest.Timeout = Timeout;
postrequest.Method = "POST";
postrequest.ContentType = "application/json;charset=UTF-8";
postrequest.Headers.Set(head, headInfo);
byte[] data = Encoding.UTF8.GetBytes(postParam);
using (Stream reqStream = postrequest.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
var postreponse = postrequest.GetResponse() as HttpWebResponse;
resultData = HttpRequest.GetInstance().GetHttpResponse(postreponse, "POST");
reqStream.Close();
}
return resultData;
}
catch (Exception ex)
{
Console.Write("请求<HttpPostResponseWithHead>异常:" + ex.Message);
}
return "";
}
#endregion

}
/// <summary>
/// HTTP请求类
/// </summary>
public class HttpRequest
{
#region 私有变量
/// <summary>
/// http请求超时时间设置
/// 默认值:5秒
/// </summary>
private static int Timeout = 5000;
#endregion

#region 单例模式
private static HttpRequest _HttpRequest = null;
public static HttpRequest GetInstance()
{
if (_HttpRequest == null)
{
_HttpRequest = new HttpRequest();
}
return _HttpRequest;
}
private HttpRequest()
{

}
#endregion

#region 公用函数
/// <summary>
/// 函数名称:创建http请求
/// 创建人:奉友福
/// 创建时间:2020-11-19
/// 例如GET 请求: 地址 + "GET"
/// 例如POST请求: 地址 + "POST" + JSON
/// </summary>
/// <param name="url">http请求地址</param>
/// <param name="requestType">http请求方式:GET/POST</param>
/// <param name="strjson">http请求附带数据</param>
/// <returns></returns>
public HttpWebRequest CreateHttpRequest(string url, string requestType, int _timeout = 5000, params object[] strjson)
{
HttpWebRequest request = null;
const string get = "GET";
const string post = "POST";
Timeout = _timeout;
if (string.Equals(requestType, get, StringComparison.OrdinalIgnoreCase))
{
request = CreateGetHttpRequest(url);
}
if (string.Equals(requestType, post, StringComparison.OrdinalIgnoreCase))
{
request = CreatePostHttpRequest(url, strjson[0].ToString());
}
return request;
}
/// <summary>
/// http获取数据
/// </summary>
/// <param name="response"></param>
/// <param name="requestType"></param>
/// <returns></returns>
public string GetHttpResponse(HttpWebResponse response, string requestType)
{
var resultData = string.Empty;
const string post = "POST";
string encoding = "UTF-8";
if (string.Equals(requestType, post, StringComparison.OrdinalIgnoreCase))
{
encoding = response.ContentEncoding;
if (encoding == null || encoding.Length < 1)
encoding = "UTF-8";
}
using (StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding(encoding)))
{
resultData = reader.ReadToEnd();
}
return resultData;
}
#endregion

#region 私有函数
/// <summary>
/// http+GET请求
/// </summary>
/// <param name="url">请求地址</param>
/// <returns>请求结果</returns>
private static HttpWebRequest CreateGetHttpRequest(string url)
{
var getrequest = WebRequest.Create(url) as HttpWebRequest;
getrequest.Method = "GET";
getrequest.Timeout = Timeout;
getrequest.ContentType = "application/json;charset=UTF-8";
getrequest.Proxy = null;
getrequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
return getrequest;
}
/// <summary>
/// http+POST请求
/// </summary>
/// <param name="url">请求地址</param>
/// <param name="postData"></param>
/// <returns>请求结果</returns>
private static HttpWebRequest CreatePostHttpRequest(string url, string postData)
{
var postrequest = WebRequest.Create(url) as HttpWebRequest;
//postrequest.KeepAlive = false;
postrequest.Timeout = Timeout;
postrequest.Method = "POST";
postrequest.ContentType = "application/json;charset=UTF-8";
//postrequest.ContentLength = postData.Length;
//postrequest.AllowWriteStreamBuffering = false;
//StreamWriter writer = new StreamWriter(postrequest.GetRequestStream(), Encoding.UTF8);
//writer.Write(postData);
//writer.Flush();
byte[] data = Encoding.UTF8.GetBytes(postData);
using (Stream reqStream = postrequest.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
return postrequest;
}

public static HttpWebRequest CreateDeleteHttpRequest(string url, string postJson, int _timeout = 5000)
{
var deleteRequest = WebRequest.Create(url) as HttpWebRequest;
deleteRequest.Timeout = _timeout;
deleteRequest.Method = "DELETE";
deleteRequest.ContentType = "application/json;charset=UTF-8";
byte[] data = Encoding.UTF8.GetBytes(postJson);
using (Stream reqStream = deleteRequest.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Close();
}
return deleteRequest;
}
#endregion
}
}

+ 53
- 0
BPASmartClient.ScreenLib/Helper/Main.cs Ver fichero

@@ -1,6 +1,7 @@
using BPA.Communication;
using BPA.Helper;
using BPA.Message;
using Microsoft.Web.WebView2.Wpf;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
@@ -9,6 +10,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace BPASmartClient.ScreenLib
{
@@ -43,6 +45,10 @@ namespace BPASmartClient.ScreenLib

#region 自建变量
/// <summary>
/// 分餐机广告
/// </summary>
public List<AdDTO> SaasRouteReturn =new List<AdDTO> { };
/// <summary>
/// 是否运行
/// </summary>
public bool IsRunning { get; set; }
@@ -134,6 +140,7 @@ namespace BPASmartClient.ScreenLib
{
try
{
ReadSass();
//连接MQTT、Redis
Connection();
IsRunning = true;
@@ -184,6 +191,52 @@ namespace BPASmartClient.ScreenLib

#region 调用事件
/// <summary>
/// 调用Sass接口拿到广告
/// </summary>
public void ReadSass()
{
try
{
string SaasRoute = System.Configuration.ConfigurationManager.AppSettings["SaasRoute"].ToString();
string res = HttpRequestHelper.HttpGetRequest(SaasRoute);
if (!string.IsNullOrEmpty(res))
{
HttpReturn httpReturn= JsonConvert.DeserializeObject<HttpReturn>(res);
var Init =httpReturn?.data?.Devices?.Join(httpReturn?.data?.Stalls, t => t.GateId, x => x.Id, (t, x) => new AdDTO
{
Ad = x.Remaek,
Device = t.Name,
Stalls = x.Name,
Address = t.Address,
}).ToList();
SaasRouteReturn= Init;
}
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示地址
/// </summary>
/// <param name="input"></param>
/// <param name="view2"></param>
public async void InitView2(string input, WebView2 view2, GroupBox group)
{
var height = 540;
var width = 940;
input = input.Replace("style=\"width: 100%;\"", "");
StringBuilder sb = new StringBuilder();
sb.Append("<html><style>body {width: " + width + "px;height: " + height + "px;margin: 0;padding:0;}body p {width: " + width + "px;height: " + height + "px;}body p img {width: 100%;height: 100%;}</style><script>function Set(width, height) { var body = document.getElementsByTagName('body')[0]; body.style.width = width + 'px';body.style.height = height + 'px';var p = document.getElementsByTagName('p')[0]; p.style.width = width + 'px';p.style.height = height + 'px';}</script><body>" + input + "</body></html>");
var html = sb.ToString();
await view2.EnsureCoreWebView2Async(null);
view2.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false;
view2.CoreWebView2.Settings.AreDevToolsEnabled = false;
view2.CoreWebView2.NavigateToString(html);
}
/// <summary>
/// 读取配置
/// </summary>
public void ReadPZ()


+ 81
- 0
BPASmartClient.ScreenLib/Model/OrderMakeModel.cs Ver fichero

@@ -1,5 +1,6 @@
using BPA.Helper;
using BPA.Message.Enum;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -104,4 +105,84 @@ namespace BPASmartClient.ScreenLib
}
}

public class HttpReturn
{
public bool isSuccess { get; set; }

public StoreInfoResponse data { get; set; }
}

public class StoreInfoResponse
{
/// <summary>
/// 档口
/// </summary>
[JsonProperty("gateList")]
public List<StallModelResponse> Stalls { get; set; }
/// <summary>
/// 设备
/// </summary>
[JsonProperty("payCardList")]
public List<DeviceModelResponse> Devices { get; set; }
}
public class StallModelResponse
{

public string Id { get; set; }
/// <summary>
/// 档口名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 归属门店
/// </summary>
public string StoreId { get; set; }
/// <summary>
/// 收费方式(1,固定金额2,自由设定)
/// </summary>
public int Mode { get; set; }
/// <summary>
/// 收款金额
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 广告
/// </summary>
public string Remaek { get; set; }
/// <summary>
///状态0正常,1停用
/// </summary>
public int Status { get; set; }
}
public class DeviceModelResponse
{
public string Id { get; set; }
/// <summary>
/// 刷卡设备名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 档口id
/// </summary>
public string GateId { get; set; }
/// <summary>
/// 地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 刷卡间隔时间
/// </summary>
public int SleepTime { get; set; }
/// <summary>
/// 状态0正常,1停用
/// </summary>
public int Status { get; set; }
}
public class AdDTO
{
public string Device { get; set; }
public string Ad { get; set; }
public string Stalls { get; set; }
public string Address { get; set; }
}
}

+ 4
- 4
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml Ver fichero

@@ -86,13 +86,13 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>


+ 49
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1.xaml.cs Ver fichero

@@ -25,6 +25,55 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenSplitMealsControl1ViewModel();

if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "01");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 16
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl1ViewModel.cs Ver fichero

@@ -37,6 +37,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.分餐机;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount = 0;
#endregion

public ScreenSplitMealsControl1ViewModel()
@@ -51,6 +65,8 @@ namespace BPASmartClient.ScreenLib
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;

OrderCount = modelMaxWok.SplitMeals_CreditCardCount_1 + modelMaxWok.SplitMeals_CreditCardCount_2;
}
}));
Thread.Sleep(1000);


+ 189
- 188
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml Ver fichero

@@ -1,188 +1,189 @@
<UserControl x:Class="BPASmartClient.ScreenLib.ScreenSplitMealsControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.ScreenLib"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:con="clr-namespace:BPA.CustomResource.UserControls;assembly=BPA.CustomResource"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPA.CustomResource;component/Themes/ProlineStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

<StackPanel Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="4 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</GroupBox>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="信息时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="详细描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>

<StackPanel Grid.Column="2" Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="3 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>

</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
</Grid>

</UserControl>
<UserControl x:Class="BPASmartClient.ScreenLib.ScreenSplitMealsControl2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.ScreenLib"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
xmlns:con="clr-namespace:BPA.CustomResource.UserControls;assembly=BPA.CustomResource"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPA.CustomResource;component/Themes/ProlineStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="4 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_4,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
<DataGridTemplateColumn.Header>
<TextBlock Text="信息时间" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmTime}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<TextBlock Text="详细描述" Foreground="White"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0,5,0,5" Text="{Binding AlarmMs}" Foreground="#a70909" FontSize="16" HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="2" Margin="0,10,0,0">
<GroupBox Grid.Row="0" Margin="10,0,10,0" Height="460" Width="450" Header="3 号档口" Style="{DynamicResource from}" Tag="Start">
<StackPanel>
<GroupBox Header="设备运行情况" Margin="20,10,0,0"/>
<Grid Height="160" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" FontSize="42" Text="{Binding ViewData.WorkStatus_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Lime"></Setter>
<Style.Triggers>
<Trigger Property="Text" Value="停止">
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">设备工作状态</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardCount_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">今日刷卡数</TextBlock>
</StackPanel>
</Grid>
<GroupBox Header="当前操作信息" Margin="20,10,0,0"/>
<Grid Height="160">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2" Background="{DynamicResource 竖线}" Height="100" Width="2"></Border>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" FontSize="52" Foreground="#FFD2C106" Text="{Binding ViewData.SplitMeals_CreditCardNameBefore_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">前一位刷卡人</TextBlock>
</StackPanel>
<StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Style="{DynamicResource 数码管Text}" Foreground="Lime" FontSize="52" Text="{Binding ViewData.SplitMeals_CreditCardName_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
<TextBlock Style="{DynamicResource textms}" Margin="0,10,0,0">当前刷卡人</TextBlock>
</StackPanel>
</Grid>
</StackPanel>
</GroupBox>
<GroupBox Margin="0,20,10,0" Height="480" Width="450" Header="今日菜品列表" Style="{DynamicResource from}" Tag="Start">
<ListBox ItemsSource="{Binding ViewData.SplitMeals_CookType_3,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Border Style="{DynamicResource border顶部背景}" Width="370" Height="100" Margin="20,20,0,0" >
<TextBlock HorizontalAlignment="Center" Foreground="{DynamicResource foreground}" VerticalAlignment="Center" Text="{Binding .}" FontSize="60"></TextBlock>
</Border>
</WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</StackPanel>
</Grid>
</UserControl>

+ 49
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2.xaml.cs Ver fichero

@@ -24,6 +24,55 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenSplitMealsControl2ViewModel();

if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "02");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 16
- 0
BPASmartClient.ScreenLib/分餐机/ScreenSplitMealsControl2ViewModel.cs Ver fichero

@@ -37,6 +37,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.分餐机;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount = 0;
#endregion

public ScreenSplitMealsControl2ViewModel()
@@ -51,6 +65,8 @@ namespace BPASmartClient.ScreenLib
if (modelMaxWok != null && modelMaxWok.Alarm != null)
modelMaxWok.Alarm = modelMaxWok.Alarm?.OrderByDescending(k => DateTime.Parse(k.AlarmTime)).ToList();
ViewData = modelMaxWok;
OrderCount = modelMaxWok.SplitMeals_CreditCardCount_3 + modelMaxWok.SplitMeals_CreditCardCount_4;

}
}));
Thread.Sleep(1000);


+ 4
- 4
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml Ver fichero

@@ -194,13 +194,13 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">


+ 48
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControl.xaml.cs Ver fichero

@@ -24,6 +24,54 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenMaxWokControlViewModel();
if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "05");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 15
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMaxWokControlViewModel.cs Ver fichero

@@ -67,6 +67,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.大炒;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount =0;
#endregion

public ScreenMaxWokControlViewModel()
@@ -86,6 +100,7 @@ namespace BPASmartClient.ScreenLib
ProcessModel1?.ToList().ForEach(par => { if (par.Id+1 == ProcessModel1.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ProcessModel2?.ToList().ForEach(par => { if (par.Id+1 == ProcessModel2.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ViewData = modelMaxWok;
OrderCount = modelMaxWok.MaxWok_OrderCount_1 + modelMaxWok.MaxWok_OrderCount_2;
}
}));
Thread.Sleep(1000);


+ 4
- 4
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml Ver fichero

@@ -194,13 +194,13 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>


+ 48
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControl.xaml.cs Ver fichero

@@ -24,6 +24,54 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenMinWokControlViewModel();
if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}


/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str = string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >= 6)
{
AdDTO dto = Main.GetInstance.SaasRouteReturn?.Find(par => par.Address == "06");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 16
- 0
BPASmartClient.ScreenLib/炒锅/ScreenMinWokControlViewModel.cs Ver fichero

@@ -66,6 +66,20 @@ namespace BPASmartClient.ScreenLib
/// 当前刷新数据类型
/// </summary>
public ScreenDeviceType type = ScreenDeviceType.小炒;

/// <summary>
/// 订单总数
/// </summary>
public int OrderCount
{
get { return _OrderCount; }
set
{
_OrderCount = value;
OnPropertyChanged();
}
}
private int _OrderCount = 0;
#endregion

public ScreenMinWokControlViewModel()
@@ -84,6 +98,8 @@ namespace BPASmartClient.ScreenLib
ProcessModel1?.ToList().ForEach(par => { if (par.Id + 1 == ProcessModel1.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ProcessModel2?.ToList().ForEach(par => { if (par.Id + 1 == ProcessModel2.Count) { par.IsLast = 1; } else { par.IsLast = 0; } });
ViewData = modelMaxWok;
OrderCount = modelMaxWok.MinWok_OrderCount_1 + modelMaxWok.MinWok_OrderCount_2;

}
}));
Thread.Sleep(1000);


+ 6
- 6
BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml Ver fichero

@@ -116,15 +116,15 @@
</GroupBox>
</StackPanel>
<StackPanel Grid.Column="1" >
<GroupBox Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<StackPanel Grid.Column="1" MouseLeftButtonDown="StackPanel_MouseLeftButtonDown" VerticalAlignment="Bottom" Margin="0,0,0,10">
<GroupBox x:Name="guanggao" Height="600" Width="950" Margin="0,10,0,20" Header="广告区域" HorizontalAlignment="Center" VerticalAlignment="Top" Style="{DynamicResource from}" Tag="Start">
<Grid>
<wv2:WebView2 Name="webView" Source="{Binding GgAdder,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<wv2:WebView2 Name="webView" />
</Grid>
</GroupBox>
<!--<Grid Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding GZallCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="告警次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding UserCout,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>-->
<Grid x:Name="diqiu" Height="600" Width="950" Margin="0,10,0,20" > <Image Style="{DynamicResource imagezhu}"></Image> <Image Style="{DynamicResource image中1}" Margin="0,400,0,0"></Image> <GroupBox Margin="600,100,0,500" Header="{Binding ViewData.FailuresCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="累计故障数" Content="次" Width="100"/> <GroupBox Margin="600,400,0,0" Header="0" Style="{DynamicResource GroupStyle圆形}" Tag="故障次数" Content="次" Width="160"/> <GroupBox Margin="-500,100,0,0" Header="{Binding ViewData.MorkS_OrderCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource GroupStyle圆形}" Tag="日总接待人数" Content="人" Width="160"/> </Grid>
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<GroupBox Margin="0,0,0,0" Height="340" Width="950" Header="信息通知区域" Style="{DynamicResource from}">
<DataGrid Margin="10,10,10,0" ItemsSource="{Binding ViewData.Alarm,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="250">
@@ -220,7 +220,7 @@
<Setter Property="Foreground" Value="#FFD2C106"></Setter>
<Setter Property="Text" Value="空闲"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ViewData..Morks_NoodleUpOrDown[1]}" Value="true">
<DataTrigger Binding="{Binding ViewData.Morks_NoodleUpOrDown[1]}" Value="true">
<Setter Property="Foreground" Value="Lime"/>
<Setter Property="Text" Value="煮面"></Setter>
</DataTrigger>


+ 48
- 0
BPASmartClient.ScreenLib/煮面机/ScreenMorksControl.xaml.cs Ver fichero

@@ -24,6 +24,54 @@ namespace BPASmartClient.ScreenLib
{
InitializeComponent();
this.DataContext = new ScreenMorksControlViewModel();

if (int.Parse(System.Configuration.ConfigurationManager.AppSettings["ShowForm"].ToString()) == 0)
{
guanggao.Visibility = Visibility.Visible;
diqiu.Visibility = Visibility.Collapsed;
}
else
{
guanggao.Visibility = Visibility.Collapsed;
diqiu.Visibility = Visibility.Visible;
}
Show();
}

/// <summary>
/// 点击切换广告
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void StackPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
guanggao.Visibility = guanggao.Visibility==Visibility.Collapsed? Visibility.Visible: Visibility.Collapsed;
diqiu.Visibility = guanggao.Visibility == Visibility.Collapsed ? Visibility.Visible : Visibility.Collapsed;
Show();
}
catch (Exception ex)
{

}
}

/// <summary>
/// 显示广告
/// </summary>
public void Show()
{
string str=string.Empty;
if (Main.GetInstance.SaasRouteReturn != null && Main.GetInstance.SaasRouteReturn.Count >=6)
{
AdDTO dto= Main.GetInstance.SaasRouteReturn?.Find(par => par.Address =="04");
if (dto != null)
{
str = dto.Ad;
Main.GetInstance.InitView2(str, webView, guanggao);
}
}
}
}
}

+ 1
- 0
BPASmartClient.ScreenLib/煮面机/ScreenMorksControlViewModel.cs Ver fichero

@@ -9,6 +9,7 @@ using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using BPA.Message;
using System.Windows;

namespace BPASmartClient.ScreenLib
{


+ 3
- 0
BPASmartClient.ScreenMaxWok/App.config Ver fichero

@@ -6,5 +6,8 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 3
- 0
BPASmartClient.ScreenMinWok/App.config Ver fichero

@@ -6,5 +6,8 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 4
- 1
BPASmartClient.ScreenMorks/App.config Ver fichero

@@ -5,6 +5,9 @@
<add key="MQTTConnection" value="10.2.1.254,1883,admin,public"/>
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://klxxcdn.oss-cn-hangzhou.aliyuncs.com/histudy/hrm/media/bg1.mp4"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>
<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
</appSettings>
</configuration>

+ 3
- 1
BPASmartClient.ScreenSplitMeals/App.config Ver fichero

@@ -6,7 +6,9 @@
<!--订阅主题设置:大炒,小炒,分餐机,煮面机-->
<add key="DeviceMC" value="大炒,小炒,分餐机,煮面机"/>
<add key="GgAdder" value="https://stream7.iqilu.com/10339/upload_transcode/202002/18/20200218114723HDu3hhxqIT.mp4"/>

<add key="SaasRoute" value="https://witt.black-pa.com/kitchen/api/StoreHelper/GeBasisGateList?StoreId=0c32b2e2-0dc9-4941-b73d-3dc91f7268ab"/>
<!--显示窗体:0 广告 1 地球-->
<add key="ShowForm" value="1"/>
<add key="一号屏" value="0"/>
<add key="二号屏" value="1"/>
<add key="三号屏" value="0"/>


Cargando…
Cancelar
Guardar