Commit 4f337a8f authored by 姜春辉's avatar 姜春辉

feat: 增加防疫信息获取

parent 084c8037
......@@ -47,6 +47,8 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// <param name="cardMsg"></param>
public static void CardCallback(dynamic cardMsg)
{
if (Program.Loading) return;
string cardNum = cardMsg.OperaDeviceData.Message;
#if DEBUG
......
......@@ -19,6 +19,7 @@
#endregion
using GS.EnterpriseIdentification.ServiceModel;
using GS.Terminal.Frame.AddonServices;
using GS.Terminal.Identification.Enterprise.Logic.Core;
using GS.Unitive.Framework.Core;
using IdentificationViewModels;
......@@ -39,7 +40,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
internal static void OnRecognized(string key, float score)
{
if (Program.Loading) return;
try
{
ViewModel.IsStandby = false;
......@@ -50,7 +51,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
if (visitor != null)
{
Program.speakService.VoiceBySoundPlayer("识别成功");
LogicHandler.HandlerIdentify(visitor, false, score);
LogicHandler.HandlerIdentify(visitor, false, score);
return;
}
......@@ -58,7 +59,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
if (employee != null)
{
Program.speakService.VoiceBySoundPlayer("已识别");
LogicHandler.HandlerIdentify(employee, false, score);
LogicHandler.HandlerIdentify(employee, false, score);
return;
}
......@@ -66,7 +67,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
if (temp != null)
{
Program.speakService.VoiceBySoundPlayer("已识别");
LogicHandler.HandlerIdentify(temp, false, score);
LogicHandler.HandlerIdentify(temp, false, score);
return;
}
......@@ -84,5 +85,32 @@ namespace GS.Terminal.Identification.Enterprise.Logic
MainHandler.CleanViewTimer.Start();
}
}
internal static HealthStatus CheckStatus(VisitInfo visitInfo = null, Employee employee = null, TemporaryStaff temporaryStaff = null)
{
try
{
Program.Loading = true;
MainShell.ShowLoading("健康码核验中,请稍后....");
if (visitInfo != null)
{
return Heath.GetEmployeeStatus(visitInfo.VisitorName, visitInfo.VisitorIdNum);
}
else if (employee != null)
{
return Heath.GetEmployeeStatus(employee.Id);
}
else if (temporaryStaff != null)
{
return Heath.GetEmployeeStatus(temporaryStaff.id);
}
return null;
}
finally
{
MainShell.HideLoading();
Program.Loading = false;
}
}
}
}
......@@ -20,6 +20,7 @@
using GalaSoft.MvvmLight.Threading;
using GS.EnterpriseIdentification.ServiceModel;
using GS.Terminal.Frame.AddonServices;
using GS.Terminal.Identification.DbHandler;
using GS.Terminal.Identification.Enterprise.Logic.Core;
using GS.Terminal.Identification.LocalDbModel;
......@@ -40,6 +41,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// </summary>
public class LogicHandler
{
private static MainPageViewModel ViewModel => Program.locator.MainPage;
/// <summary>
......@@ -68,12 +72,13 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// <param name="human"></param>
internal static void AddToHistory(Human human)
{
var size = Program.config.LogicConfig.HealthScope == Config.HealthScope.不核验 ? 8 : 4;
DispatcherHelper.RunAsync(() =>
{
ViewModel.VisitHistory.Insert(0, human);
if (ViewModel.VisitHistory.Count > 8)
if (ViewModel.VisitHistory.Count > size)
{
ViewModel.VisitHistory.RemoveAt(8);
ViewModel.VisitHistory.RemoveAt(size);
}
});
}
......@@ -83,7 +88,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
/// </summary>
/// <param name="human"></param>
/// <param name="employee"></param>
private static void InsertToDb(Human human, Employee employee, double faceResult)
private static void InsertToDb(Human human, Employee employee, double faceResult, HealthStatus status)
{
var id = Guid.NewGuid();
Task.Run(() =>
......@@ -104,6 +109,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic
是否访客 = false,
面部识别对比结果 = faceResult,
进出标识 = human.Tag,
健康码颜色 = status?.healthcolor,
核酸检测结果 = status != null ? status.nat : 0,
疫苗接种剂次 = status != null ? status.inoculationtimes : 0,
现场照片 = Program.config.LogicConfig.IsTakePhoto ? Tools.SaveFile(ViewModel.ActiveVideo) : null,
});
}
......@@ -273,13 +281,21 @@ namespace GS.Terminal.Identification.Enterprise.Logic
//处理本次识别
var human = GenHuman(identifyVisit, isCard);
human.Tag = identityTag;
#if DEBUG
///测试人脸阈值
//human.Name += faceResult.ToString("f2");
///测试人脸阈值
#endif
HealthStatus status = null;
if (Program.config.LogicConfig.HealthScope.HasFlag(Config.HealthScope.验证访客))
{
status = Heath.GetEmployeeStatus(identifyVisit.VisitEmplyName, identifyVisit.VisitorIdNum);
if (!status.success)
{
MainShell.ShowPrompt(status.message);
Program.speakService.VoiceBySoundPlayer(status.message);
}
else
{
Program.speakService.VoiceBySoundPlayer(status.message);
}
human.SetHealth(status);
}
ViewModel.ActiveHuman = human;
AddToHistory(human);
......@@ -310,15 +326,26 @@ namespace GS.Terminal.Identification.Enterprise.Logic
//处理本次识别
var human = GenHuman(identifyEmployee, isCard);
human.Tag = identityTag;
#if DEBUG
//测试人脸阈值
human.Name += faceResult.ToString("f2");
///测试人脸阈值
#endif
ViewModel.ActiveHuman = human;
HealthStatus status = null;
if (Program.config.LogicConfig.HealthScope.HasFlag(Config.HealthScope.验证员工))
{
status = Heath.GetEmployeeStatus(identifyEmployee.Id);
if (!status.success)
{
MainShell.ShowPrompt(status.message);
Program.speakService.VoiceBySoundPlayer(status.message);
}
else
{
Program.speakService.VoiceBySoundPlayer(status.message);
}
human.SetHealth(status);
}
AddToHistory(human);
InsertToDb(human, identifyEmployee, faceResult);
InsertToDb(human, identifyEmployee, faceResult, status);
}
}
......@@ -345,16 +372,89 @@ namespace GS.Terminal.Identification.Enterprise.Logic
//处理本次识别
var human = GenHuman(identifyEmployee, isCard);
human.Tag = identityTag;
#if DEBUG
//测试人脸阈值
human.Name += faceResult.ToString("f2");
///测试人脸阈值
#endif
HealthStatus status = null;
if (Program.config.LogicConfig.HealthScope.HasFlag(Config.HealthScope.验证临时人员))
{
status = Heath.GetEmployeeStatus(identifyEmployee.id);
if (!status.success)
{
MainShell.ShowPrompt(status.message);
Program.speakService.VoiceBySoundPlayer(status.message);
}
else
{
Program.speakService.VoiceBySoundPlayer(status.message);
}
human.SetHealth(status);
}
ViewModel.ActiveHuman = human;
AddToHistory(human);
InsertToDb(human, identifyEmployee, faceResult);
}
}
}
public static class HumanExtendsion
{
public const string GRAY = "#b7b7b7";
public const string BLUE = "#4cb5f5";
public const string GREEN = "#23b601";
public const string YELLOW = "#f9ab15";
public const string RED = "#FF0000";
public static void SetHealth(this Human human, HealthStatus healthStatus)
{
human.ShowHealthColor = Program.config.LogicConfig.HealthItem.HasFlag(Config.HealthItemType.健康码) ? Visibility.Visible : Visibility.Collapsed;
human.ShowNat = Program.config.LogicConfig.HealthItem.HasFlag(Config.HealthItemType.核酸) ? Visibility.Visible : Visibility.Collapsed;
human.ShowInoculationt = Program.config.LogicConfig.HealthItem.HasFlag(Config.HealthItemType.疫苗接种剂次) ? Visibility.Visible : Visibility.Collapsed;
human.HealthColor = healthStatus.healthcolor;
human.NatTime_Date = healthStatus.nattime == DateTime.MinValue ? "- -" : healthStatus.nattime.ToString("MM-dd");
human.NatTime_Time = healthStatus.nattime == DateTime.MinValue ? "--:--:--" : healthStatus.nattime.ToString("HH:mm:ss");
if (healthStatus.nat == -99)
{
human.Nat = "阳";
human.NatUnit = "";
human.NatColor = RED;
}
if (healthStatus.nat > 168)
{ human.Nat = "7"; human.NatUnit = "d"; }
if (healthStatus.nat <= 168)
{ human.Nat = "4"; human.NatUnit = "d"; }
if (healthStatus.nat <= 48)
{ human.Nat = "48"; human.NatUnit = "h"; }
human.NatColor = Program.config.LogicConfig.NATExpirationHours >= healthStatus.nat ? BLUE : YELLOW;
if (healthStatus.nat == -1)
{
human.Nat = "无";
human.NatUnit = "";
human.NatColor = GRAY;
}
if (healthStatus.nat == -99)
{
human.Nat = "阳";
human.NatColor = RED;
}
switch (healthStatus.inoculationtimes)
{
case 0:
human.InoculationtText = "未接种疫苗";
break;
case 1:
human.InoculationtText = "已接种1剂次";
break;
case 2:
human.InoculationtText = "已接种2剂次";
break;
case 3:
human.InoculationtText = "已全程接种";
break;
default:
human.InoculationtText = "无数据";
break;
}
}
}
}
......@@ -2,10 +2,31 @@
<Settings xmlns="urn:Chinags-Configuration" AddonName="GS.Terminal.Identification.Enterprise.Logic">
<Dictionaries>
<Dict Caption="业务逻辑基本配置" Name="LogicConfig">
<Key Caption="同一个人面部识别间隔" Choice="" Name="IdentifyTimeSpan" Value="15"/>
<Key Caption="同一个人面部识别间隔" Choice="" Name="IdentifyTimeSpan" Value="3"/>
<Key Caption="面部识别阈值" Choice="" Name="FaceCompareValue" Value="0.8"/>
<Key Caption="是否拍照" Choice="" Name="IsTakePhoto" Value="true"/>
<Key Caption="自动待机延时(秒)" Choice="" Name="CleanViewDelay" Value="15"/>
<Key Caption="疫情核验开关" Choice="" Name="HealthScope" Value="7">
<![CDATA[
0: 不核验
1: 验证员工
2: 验证临时人员
4: 验证访客
支持按位与组合
]]>
</Key>
<Key Caption="疫情核验项" Choice="" Name="HealthItem" Value="7">
<![CDATA[
1: 健康码
2: 核酸
4: 疫苗接种剂次
支持按位与组合
]]>
</Key>
<Key Caption="核酸过期小时数" Choice="" Name="NATExpirationHours" Value="96">
<![CDATA[
]]>
</Key>
</Dict>
</Dictionaries>
......@@ -37,6 +58,7 @@
<Datas>
<Data ServiceKey="SaveIdentityBatch" ServiceName="批量上传员工识别记录" ServiceUrl="/api/GS.WebApi.Terminal.Identification.Enterprise/Record/EmployeeUpload"/>
<Data ServiceKey="SaveVisitorIdentifyBatch" ServiceName="批量上传访客识别记录" ServiceUrl="/api/GS.WebApi.Terminal.Visitor/Identification/UploadRecord"/>
<Data ServiceKey="QrCodeParse" ServiceName="获取用户健康码状态" ServiceUrl="/api/GS.WebApi.Terminal/IdentityQRCode/Parse"/>
</Datas>
</Structure>
</Structures>
......
......@@ -49,6 +49,21 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
}
}
private string _QrCodeParse;
public string QrCodeParse
{
get
{
if (_QrCodeParse == null)
{
_QrCodeParse = getConfigUrlByKey("QrCodeParse", "/api/GS.WebApi.Terminal/IdentityQRCode/Parse");
}
return _QrCodeParse;
}
}
private string getConfigUrlByKey(string key, string defaultUrl)
{
......
......@@ -73,6 +73,8 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
/// 资源文件地址
/// </summary>
public string ResourcePath { get; set; }
}
public class LogicConfig : IDictSetting
......@@ -95,6 +97,12 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
/// 自动待机延时(秒)
/// </summary>
public int CleanViewDelay { get; set; }
public HealthScope HealthScope { get; set; }
public HealthItemType HealthItem { get; set; }
public int NATExpirationHours { get; set; }
}
public class DataSyncConfig : IStructureSetting<DataSyncConfigItem>
......@@ -113,5 +121,29 @@ namespace GS.Terminal.Identification.Enterprise.Logic.Config
public bool Enable { get; set; }
}
public enum HealthScope
{
/*
* 0: 不核验
1: 验证员工
2: 验证临时人员
4: 验证访客
*/
不核验 = 0,
验证员工 = 1,
验证临时人员 = 2,
验证访客 = 4
}
public enum HealthItemType
{
/*
* 1: 健康码
2: 核酸
4: 疫苗接种剂次
*/
健康码 = 1,
核酸 = 2,
疫苗接种剂次 = 4
}
}
using GS.Terminal.Frame.Network.WebApiModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GS.Terminal.Identification.Enterprise.Logic.Core
{
public static class Heath
{
public static HealthStatus GetEmployeeStatus(Guid userid)
{
CancellationTokenSource cancellationToken = new CancellationTokenSource();
var code = $"GSUID{userid:N}";
Task.Delay(2000, cancellationToken.Token).ContinueWith(task =>
{
if (!task.IsCanceled)
{
Program.locator.MainPage.ExtendInfoLoading = true;
}
});
var result = Program.WebApiClient.Post<SuccessObject<QrCodeResult>>(Program.serviceListing.QrCodeParse, new
{
tcode = Program.config.GlobalConfig.tCode,
content = code
});
cancellationToken.Cancel();
Program.locator.MainPage.ExtendInfoLoading = false;
if (result != null && result.record != null && result.record.Extends != null)
{
//healthcolor 健康码颜色
//nat 核酸结果
//nattime 核酸结果时间(暂无)
//inoculationtimes 疫苗接种剂次
var status = new HealthStatus() { success = true, message = "防疫信息核验通过" };
var healthcolor = result.record.Extends.FirstOrDefault(s => s.Key == "healthcolor");
if (healthcolor != null)
{
status.healthcolor = healthcolor.Content;
if (status.healthcolor != "绿色")
{
status.success = false;
status.message = "健康码状态异常";
}
}
var nat = result.record.Extends.FirstOrDefault(s => s.Key == "nat");
if (nat != null && int.TryParse(nat.Content, out int inat))
{
status.nat = inat;
if (inat > Program.config.LogicConfig.NATExpirationHours)
{
if (status.success)
{
status.success = false;
status.message = "核酸检测结果已过期";
}
}
else if (inat == -1)//未检测
{
if (status.success)
{
status.success = false;
status.message = "核酸未检测";
}
}
else if (inat == -99)//阳性
{
if (status.success)
{
status.success = false;
status.message = "核酸检测阳性";
}
}
}
var nattime = result.record.Extends.FirstOrDefault(s => s.Key == "nattime");
if (nattime != null && DateTime.TryParse(nattime.Content, out DateTime tnat))
{
status.nattime = tnat;
}
var inoculationtimes = result.record.Extends.FirstOrDefault(s => s.Key == "inoculationtimes");
if (inoculationtimes != null && int.TryParse(inoculationtimes.Content, out int itimes))
{
status.inoculationtimes = itimes;
}
return status;
}
return new HealthStatus { success = false, message = "服务异常" };
}
public static HealthStatus GetEmployeeStatus(string name, string idnum)
{
var code = $"SFZ{idnum}{name}";
CancellationTokenSource cancellationToken = new CancellationTokenSource();
Task.Delay(2000, cancellationToken.Token).ContinueWith(task =>
{
if (!task.IsCanceled)
{
Program.locator.MainPage.ExtendInfoLoading = true;
}
});
var result = Program.WebApiClient.Post<SuccessObject<QrCodeResult>>(Program.serviceListing.QrCodeParse, new
{
tcode = Program.config.GlobalConfig.tCode,
content = code
});
cancellationToken.Cancel();
Program.locator.MainPage.ExtendInfoLoading = false;
if (result != null && result.record != null && result.record.Extends != null)
{
//healthcolor 健康码颜色
//nat 核酸结果
//nattime 核酸结果时间(暂无)
//inoculationtimes 疫苗接种剂次
var status = new HealthStatus() { success = true, message = "防疫信息核验通过" };
var healthcolor = result.record.Extends.FirstOrDefault(s => s.Key == "healthcolor");
if (healthcolor != null)
{
status.healthcolor = healthcolor.Content;
if (status.healthcolor != "绿色")
{
status.success = false;
status.message = "健康码状态异常";
}
}
var nat = result.record.Extends.FirstOrDefault(s => s.Key == "nat");
if (nat != null && int.TryParse(nat.Content, out int inat))
{
status.nat = inat;
if (inat > Program.config.LogicConfig.NATExpirationHours)
{
if (status.success)
{
status.success = false;
status.message = "核酸检测结果已过期";
}
}
else if (inat == -1)//未检测
{
if (status.success)
{
status.success = false;
status.message = "核酸未检测";
}
}
else if (inat == -99)//阳性
{
if (status.success)
{
status.success = false;
status.message = "核酸检测阳性";
}
}
}
var inoculationtimes = result.record.Extends.FirstOrDefault(s => s.Key == "inoculationtimes");
if (inoculationtimes != null && int.TryParse(inoculationtimes.Content, out int itimes))
{
status.inoculationtimes = itimes;
}
return status;
}
return new HealthStatus { success = false, message = "服务异常" };
}
}
public class HealthStatus
{
public bool success { get; set; }
public string message { get; set; }
public string healthcolor { get; set; }
/// <summary>
/// -1:未检测 -99:阳性 >0:核酸检测距离现在的小时数
/// </summary>
public int nat { get; set; }
public DateTime nattime { get; set; }
public int inoculationtimes { get; set; }
}
public class QrCodeResult
{
public string CodeType { get; set; }
public string UserKey { get; set; }
public string Name { get; set; }
public string Phone { get; set; }
public string IdCard { get; set; }
public string IsSystemUser { get; set; }
public string IsVisitor { get; set; }
public List<QrCodeResult_ExtendInfo> Extends { get; set; }
}
public class QrCodeResult_ExtendInfo
{
public string Key { get; set; }
public string Name { get; set; }
public string Content { get; set; }
}
}
......@@ -67,6 +67,9 @@ namespace GS.Terminal.Identification.Enterprise.Logic
IdentifyMethod = ss.是否刷卡识别 ? 0 : 1,
FaceResult = ss.面部识别对比结果,
Tag = ss.进出标识,
HealthColor = ss.健康码颜色,
Nat = ss.核酸检测结果,
InoculationTimes = ss.疫苗接种剂次
}).ToList();
if (visitData.Count > 0)
......@@ -107,7 +110,10 @@ namespace GS.Terminal.Identification.Enterprise.Logic
SitePhoto = Tools.ReadFile(ss.现场照片),
Tag = ss.进出标识,
IdentifyMethod = ss.是否刷卡识别 ? 0 : 1,
FaceResult = ss.面部识别对比结果
FaceResult = ss.面部识别对比结果,
HealthColor = ss.健康码颜色,
Nat = ss.核酸检测结果,
InoculationTimes = ss.疫苗接种剂次
}).ToList();
if (emplyData.Count > 0)
......
......@@ -145,6 +145,7 @@
<Compile Include="Config\ServiceListing.cs" />
<Compile Include="Config\TerminalSetting.cs" />
<Compile Include="Core\FaceFeatureLoader.cs" />
<Compile Include="Core\Heath.cs" />
<Compile Include="Core\LocalDataCenter.cs" />
<Compile Include="Core\Uploader.cs" />
<Compile Include="Face\FaceRecognizationService.cs" />
......
......@@ -48,10 +48,11 @@ namespace GS.Terminal.Identification.Enterprise.Logic
internal static Config.ServiceListing serviceListing; // 服务清单配置
internal static Uploader uploader; // 数据上传
internal static IEasyTaskService syncService; // 数据同步插件服务
internal static string _logicVersion = "210928"; // 业务版本
internal static string _logicVersion = "220907"; // 业务版本
internal static WebApiClient WebApiClient;
internal static ILogWriter Logger;
internal static FaceFeatureLoader FaceFeatureLoader;
internal static bool Loading = false;
public void Start(IAddonContext Context)
{
......@@ -162,6 +163,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
private void Instance_onRuntimeCompleted(object sender)
{
GetAndRegistServices();
TerminalStatusCenter.Instance.SetStatus(TerminalStatusDefined.STANDBY, "system");
addonContext.CreateIntercativeData<string>("TERMINAL_STATUS");
var terminal_status = $"{Frame.Utility.EnvironmentInfo.GetApplicationVersion()}({_logicVersion}) Standby {Frame.Network.HardwareInfo.GetMACAddress()}";
......@@ -175,6 +177,7 @@ namespace GS.Terminal.Identification.Enterprise.Logic
RegistViewModel();
MainHandler.ViewModel.tCode = config.GlobalConfig.tCode;
MainHandler.ViewModel.VersionString = new ApplicationBase().Info.Version.ToString();
MainHandler.ViewModel.ViewMode = config.LogicConfig.HealthScope == Config.HealthScope.不核验 ? 视图模式.一般 : 视图模式.疫情核验;
logicShellService.ShowView(SimpleIoc.Default.GetInstance<Locator>().MainPage, args =>
{
//注册数据同步监听
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="MainShell_LogoText" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="60"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Margin" Value="20,0,0,0"/>
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="FontFamily" Value="/GS.Terminal.Theme;component/Fonts/#锐字云字库行草体1.0"/>
</Style>
<!-- 头部-->
<Style x:Key="MainShell_HeaderBackground" TargetType="Grid">
<Setter Property="Height" Value="120"></Setter>
......@@ -11,11 +19,7 @@
<Setter Property="Background" Value="#006766"></Setter>
</Style>
<Style x:Key="LogoTextBlockStyle" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="60"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Margin" Value="20,0,0,0"/>
<Setter Property="FontFamily" Value="/GS.Terminal.Theme;component/Fonts/#锐字云字库行草体1.0"/>
<Style x:Key="MainShell_HeadRight" TargetType="Grid">
<Setter Property="Grid.Column" Value="1"/>
</Style>
</ResourceDictionary>
\ No newline at end of file
......@@ -2,5 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="Main_ADImage" TargetType="Image">
<Setter Property="Source" Value="Images/ad.png"/>
<Setter Property="Margin" Value="35,0,35,35"/>
</Style>
</ResourceDictionary>
\ No newline at end of file
......@@ -7,9 +7,9 @@
<clear />
<add key="UpdateUrl" value="http://192.168.1.210/Soft/update" />
<add key="ServerIP" value="192.168.1.7" />
<add key="tCode" value="DN01" />
<add key="WebPath" value="http://192.168.1.7:5888" />
<add key="ResourcePath" value="http://192.168.1.7:8888" />
<add key="tCode" value="SNM1" />
<add key="WebPath" value="http://192.168.1.7:5084" />
<add key="ResourcePath" value="http://192.168.1.7:8084" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<system.web>
......
......@@ -63,5 +63,9 @@ namespace GS.Terminal.Identification.LocalDbModel
/// 进 = 1,出 = 0,已识别 = 2,
/// </summary>
public int 进出标识 { get; set; }
public string 健康码颜色 { get; set; }
public int 核酸检测结果 { get; set; }
public int 疫苗接种剂次 { get; set; }
}
}
......@@ -7,17 +7,24 @@ using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
namespace IdentificationViewModels
{
public enum 视图模式
{
一般,
疫情核验
}
[Export(typeof(IViewModel))]
public partial class MainPageViewModel : ViewModelBase, IViewModel
{
#region 方法
public void Reset()
{
ActiveHuman = new Human { IsCard = false, IsVisitor = false };
ActiveHuman = new Human { IsCard = false, IsVisitor = false, ShowHealthColor = Visibility.Collapsed, ShowInoculationt = Visibility.Collapsed, ShowNat = Visibility.Collapsed };
IsStandby = true;
ShowError = false;
ErrorText = "";
......@@ -35,6 +42,7 @@ namespace IdentificationViewModels
private string _VersionString = "-";
private bool _ShowError;
private string _ErrorText;
private bool _ExtendInfoLoading;
#endregion
#region 属性
......@@ -49,6 +57,15 @@ namespace IdentificationViewModels
set { _IsStandby = value; RaisePropertyChanged(nameof(IsStandby)); }
}
private 视图模式 _ViewMode = 视图模式.一般;
public 视图模式 ViewMode
{
get { return _ViewMode; }
set { _ViewMode = value; RaisePropertyChanged("ViewMode"); }
}
/// <summary>
/// 无人操作界面重置倒计时(秒)
/// </summary>
......@@ -126,6 +143,13 @@ namespace IdentificationViewModels
set { _ErrorText = value; RaisePropertyChanged("ErrorText"); }
}
public bool ExtendInfoLoading
{
get { return _ExtendInfoLoading; }
set { _ExtendInfoLoading = value; RaisePropertyChanged("ExtendInfoLoading"); }
}
#endregion
}
......@@ -194,6 +218,112 @@ namespace IdentificationViewModels
set { _IsCard = value; RaisePropertyChanged(nameof(IsCard)); }
}
private Visibility _ShowHealthColor = Visibility.Collapsed;
public Visibility ShowHealthColor
{
get { return _ShowHealthColor; }
set { _ShowHealthColor = value; RaisePropertyChanged("ShowHealthColor"); }
}
private string _HealthColor;
/// <summary>
/// 健康码颜色 红色 黄色 绿色
/// </summary>
public string HealthColor
{
get
{
switch (_HealthColor)
{
case "红色": return "红码";
case "黄色": return "黄码";
case "绿色": return "绿码";
default:
break;
}
return _HealthColor;
}
set { _HealthColor = value; RaisePropertyChanged("HealthColor"); }
}
private Visibility _ShowNat = Visibility.Collapsed;
public Visibility ShowNat
{
get { return _ShowNat; }
set { _ShowNat = value; RaisePropertyChanged("ShowNat"); }
}
private string _Nat;
/// <summary>
/// 核酸状态 48h 4d 7d
/// </summary>
public string Nat
{
get { return _Nat; }
set { _Nat = value; RaisePropertyChanged("Nat"); }
}
private string _NatTime_Date;
public string NatTime_Date
{
get { return _NatTime_Date; }
set { _NatTime_Date = value; RaisePropertyChanged("NatTime_Date"); }
}
private string _NatTime_Time;
public string NatTime_Time
{
get { return _NatTime_Time; }
set { _NatTime_Time = value; RaisePropertyChanged("NatTime_Time"); }
}
private string _NatUnit;
public string NatUnit
{
get { return _NatUnit; }
set { _NatUnit = value; RaisePropertyChanged("NatUnit"); }
}
private string _NatColor;
public string NatColor
{
get { return _NatColor; }
set { _NatColor = value; RaisePropertyChanged("NatColor"); }
}
private Visibility _ShowInoculationt = Visibility.Collapsed;
public Visibility ShowInoculationt
{
get { return _ShowInoculationt; }
set { _ShowInoculationt = value; RaisePropertyChanged("ShowInoculationt"); }
}
private string _InoculationtText;
public string InoculationtText
{
get { return _InoculationtText; }
set { _InoculationtText = value; RaisePropertyChanged("InoculationtText"); }
}
public int Tag { get; set; }
}
#endregion
......
......@@ -120,6 +120,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Templates\Main.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="Images\bg.png" />
......
......@@ -11,22 +11,11 @@
d:DesignHeight="1770" d:DesignWidth="1080"
Title="MainPage">
<Page.Resources>
<collections:ArrayList x:Key="testList">
<TextBlock/>
<TextBlock/>
<TextBlock/>
<TextBlock/>
<TextBlock/>
<TextBlock/>
<TextBlock/>
<TextBlock/>
</collections:ArrayList>
<converter:ReverseBooleanToVisibilityConverter x:Key="ReverseBooleanToVisibilityConverter"/>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<!--用来裁切圆形头像-->
<GeometryGroup x:Key="clipGeometry" FillRule="Nonzero">
<EllipseGeometry RadiusX="205" RadiusY="205" Center="205, 205"/>
</GeometryGroup>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Templates/Main.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Page.Resources>
<Grid >
......@@ -40,149 +29,46 @@
<ImageBrush ImageSource="Images/bg.png"/>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="563"/>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--Main 上-->
<Border Grid.Row="0" Height="895" Margin="16,16,16,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="563"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Source="Images/picborder.png" Margin="0,40,0,40"/>
<Image Source="{Binding ActiveVideo}" Width="410" Height="410" Clip="{StaticResource ResourceKey=clipGeometry}" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
<!--水平反转-->
<!---->
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="1" ScaleX="-1"/>
<SkewTransform AngleY="0" AngleX="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<!--当前信息 - 员工-->
<Border Visibility="{Binding ActiveHuman.IsVisitor, Converter={StaticResource ReverseBooleanToVisibilityConverter}}" d:IsHidden="False" Grid.Row="1" Width="881" Margin="84,0,84,31" CornerRadius="25" BorderThickness="0" Background="#4Cffffff">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="510"/>
</Grid.ColumnDefinitions>
<wpf:HttpImage Stretch="Fill" Grid.Column="0" Url="{Binding ActiveHuman.HumanPhoto}" DefaultImage="/IdentificationViews;component/Images/standby.png" Height="257" Width="181"/>
<StackPanel Orientation="Vertical" Grid.Column="1">
<StackPanel Orientation="Horizontal" Margin="0,64,0,0">
<TextBlock Text="部门:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Depart}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="姓名:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Name}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="时间:" FontSize="36" />
<TextBlock Text="{Binding ActiveHuman.Time}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<!--当前信息 - 访客-->
<Border Visibility="{Binding ActiveHuman.IsVisitor, Converter={StaticResource BooleanToVisibilityConverter}}" d:IsHidden="True" Grid.Row="1" Width="881" Margin="84,0,84,31" CornerRadius="25" BorderThickness="2" Background="#aa1e96c5" BorderBrush="#4Cffffff">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="510"/>
</Grid.ColumnDefinitions>
<wpf:HttpImage Stretch="Fill" Grid.Column="0" Url="{Binding ActiveHuman.HumanPhoto}" DefaultImage="/IdentificationViews;component/Images/standby.png" Height="257" Width="181"/>
<StackPanel Orientation="Vertical" Grid.Column="1">
<StackPanel Orientation="Horizontal" Margin="0,64,0,0">
<TextBlock Text="被访部门:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Depart}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="访客姓名:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Name}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="访问时间:" FontSize="36" />
<TextBlock Text="{Binding ActiveHuman.Time}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<Border d:IsHidden="True" Visibility="{Binding ShowError, Converter={StaticResource BooleanToVisibilityConverter}}"
Grid.Row="1" Width="881" Margin="84,0,84,31"
CornerRadius="25" BorderThickness="2"
Background="#FF0000" BorderBrush="#4Cffffff">
<TextBlock Text="{Binding ErrorText}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="64" Foreground="white"/>
</Border>
</Grid>
<Border Grid.Row="0" Margin="16,16,16,0">
<ContentControl Template="{StaticResource VideoControl}"/>
</Border>
<Border Grid.Row="1">
<ContentControl Grid.Row="1" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<ContentControl x:Name="PART_TEMP" />
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding ViewMode}" Value="0">
<Setter Property="Template" TargetName="PART_TEMP" Value="{StaticResource Normal_UserInfo}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ViewMode}" Value="1">
<Setter Property="Template" TargetName="PART_TEMP" Value="{StaticResource Extend_UserInfo}"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</Border>
<Border Margin="16" Grid.RowSpan="2" Background="#33FFFFFF"/>
<!--Main 下-->
<Border Grid.Row="1" Margin="16,14,16,24" Padding="36,27,36,27">
<Border Grid.Row="2" Margin="16,14,16,24" Background="#33FFFFFF" Padding="36,27,36,27">
<Grid>
<!--有人-->
<ListView ItemsSource="{Binding VisitHistory}" Visibility="{Binding IsStandby, Converter={StaticResource ReverseBooleanToVisibilityConverter}}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.Template>
<ControlTemplate>
<ItemsPresenter/>
</ControlTemplate>
</ListView.Template>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<!--历史识别样式-->
<Grid Background="Transparent" Width="217" Height="297" Margin="16,0,0,30">
<Border Margin="27,18,0,11" BorderBrush="#AAFFFFFF" BorderThickness="2" Grid.RowSpan="2" Grid.ColumnSpan="2">
<wpf:HttpImage Url="{Binding HumanPhoto}" Height="264" Width="186" DefaultImage="/IdentificationViews;component/Images/defaultphoto.png" Stretch="Fill"/>
</Border>
<Image x:Name="CameraOrCard" Source="Images/camera.png"/>
<!--历史姓名-->
<Border x:Name="NameBg" Background="#AAFFFFFF" Width="186" Height="55" Margin="27,0,0,13" BorderThickness="0,2,0,0" BorderBrush="#AAFFFFFF" Grid.RowSpan="2" Grid.ColumnSpan="2" VerticalAlignment="Bottom">
<TextBlock FontSize="22" Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid.RowDefinitions>
<RowDefinition Height="77"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="77"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
</Grid>
<ControlTemplate.Triggers>
<!--打卡图标触发器-->
<DataTrigger Binding="{Binding IsCard}" Value="true">
<Setter Property="Source" TargetName="CameraOrCard" Value="Images/card.png"/>
</DataTrigger>
<!--访客颜色触发器-->
<DataTrigger Binding="{Binding IsVisitor}" Value="true">
<Setter Property="Background" TargetName="NameBg" Value="#ee4ab8b4"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
<Image Visibility="{Binding IsStandby, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource Main_ADImage}" Stretch="UniformToFill"/>
<ContentControl Template="{StaticResource Normal_HistoryList}"/>
</Grid>
</Border>
<Image Visibility="{Binding IsStandby, Converter={StaticResource BooleanToVisibilityConverter}}"
Grid.Row="1" Grid.RowSpan="2"
Style="{DynamicResource Main_ADImage}" Stretch="UniformToFill"/>
</Grid>
<!--Foot-->
<Grid Grid.Row="1" Background="#00456d">
<!--<local:ScrollingTextControl Content="{Binding Footer}" RunSpeed="200" StopSecond="2000" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="72"/>-->
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal">
<TextBlock Text="版权所有 © 青岛通软网络科技有限公司" HorizontalAlignment="Right" VerticalAlignment="Bottom" Foreground="White" Margin="0,0,5,5"/>
......
<ResourceDictionary 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"
mc:Ignorable="d"
xmlns:collections="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:converter="clr-namespace:Develop.Extension.Wpf.Converter;assembly=Develop.Extension.Wpf"
xmlns:wpf="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf">
<collections:ArrayList x:Key="testList">
<TextBlock/>
<TextBlock/>
<TextBlock/>
<TextBlock/>
<!--<TextBlock/>
<TextBlock/>
<TextBlock/>
<TextBlock/>-->
</collections:ArrayList>
<converter:ReverseBooleanToVisibilityConverter x:Key="ReverseBooleanToVisibilityConverter"/>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<GeometryGroup x:Key="clipGeometry" FillRule="Nonzero">
<EllipseGeometry RadiusX="205" RadiusY="205" Center="205, 205"/>
</GeometryGroup>
<ControlTemplate x:Key="VideoControl" TargetType="ContentControl">
<Border Height="563">
<Grid>
<Image Source="../Images/picborder.png" Margin="0,40,0,40"/>
<Image Source="{Binding ActiveVideo}" Width="410" Height="410" Clip="{StaticResource ResourceKey=clipGeometry}" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="1" ScaleX="-1"/>
<SkewTransform AngleY="0" AngleX="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Grid>
</Border>
</ControlTemplate>
<ControlTemplate x:Key="Normal_UserInfo" TargetType="ContentControl">
<Grid>
<!--当前信息 - 员工-->
<Border Visibility="{Binding ActiveHuman.IsVisitor, Converter={StaticResource ReverseBooleanToVisibilityConverter}}"
Height="317"
d:IsHidden="False" Grid.Row="1" Width="881" Margin="84,0,84,31" CornerRadius="25" BorderThickness="0" Background="#4Cffffff">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="510"/>
</Grid.ColumnDefinitions>
<wpf:HttpImage Stretch="Fill" Grid.Column="0" Url="{Binding ActiveHuman.HumanPhoto}" DefaultImage="/IdentificationViews;component/Images/standby.png" Height="257" Width="181"/>
<StackPanel Orientation="Vertical" Grid.Column="1">
<StackPanel Orientation="Horizontal" Margin="0,64,0,0">
<TextBlock Text="部门:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Depart}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="姓名:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Name}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="时间:" FontSize="36" />
<TextBlock Text="{Binding ActiveHuman.Time}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<!--当前信息 - 访客-->
<Border Visibility="{Binding ActiveHuman.IsVisitor, Converter={StaticResource BooleanToVisibilityConverter}}" d:IsHidden="True" Grid.Row="1" Height="317" Width="881" Margin="84,0,84,31" CornerRadius="25" BorderThickness="2" Background="#aa1e96c5" BorderBrush="#4Cffffff">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="510"/>
</Grid.ColumnDefinitions>
<wpf:HttpImage Stretch="Fill" Grid.Column="0" Url="{Binding ActiveHuman.HumanPhoto}" DefaultImage="/IdentificationViews;component/Images/standby.png" Height="257" Width="181"/>
<StackPanel Orientation="Vertical" Grid.Column="1">
<StackPanel Orientation="Horizontal" Margin="0,64,0,0">
<TextBlock Text="被访部门:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Depart}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="访客姓名:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Name}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="访问时间:" FontSize="36" />
<TextBlock Text="{Binding ActiveHuman.Time}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<Border d:IsHidden="True" Visibility="{Binding ShowError, Converter={StaticResource BooleanToVisibilityConverter}}"
Grid.Row="1" Width="881" Margin="84,0,84,31" Height="317"
CornerRadius="25" BorderThickness="2"
Background="#FF0000" BorderBrush="#4Cffffff">
<TextBlock Text="{Binding ErrorText}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="64" Foreground="white"/>
</Border>
</Grid>
</ControlTemplate>
<ControlTemplate x:Key="Normal_HistoryList" TargetType="ContentControl">
<!--ItemsSource="{Binding VisitHistory}"-->
<ListView ItemsSource="{Binding VisitHistory}" Visibility="{Binding IsStandby, Converter={StaticResource ReverseBooleanToVisibilityConverter}}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.Template>
<ControlTemplate>
<ItemsPresenter/>
</ControlTemplate>
</ListView.Template>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<!--历史识别样式-->
<Grid Background="Transparent" Width="217" Height="297" Margin="16,0,0,30">
<Border Margin="27,18,0,11" BorderBrush="#AAFFFFFF" BorderThickness="2" Grid.RowSpan="2" Grid.ColumnSpan="2">
<wpf:HttpImage Url="{Binding HumanPhoto}" Height="264" Width="186" DefaultImage="/IdentificationViews;component/Images/defaultphoto.png" Stretch="Fill"/>
</Border>
<Image x:Name="CameraOrCard" Source="../Images/camera.png"/>
<!--历史姓名-->
<Border x:Name="NameBg" Background="#AAFFFFFF" Width="186" Height="55" Margin="27,0,0,13" BorderThickness="0,2,0,0" BorderBrush="#AAFFFFFF" Grid.RowSpan="2" Grid.ColumnSpan="2" VerticalAlignment="Bottom">
<TextBlock FontSize="22" Text="{Binding Name}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid.RowDefinitions>
<RowDefinition Height="77"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="77"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
</Grid>
<ControlTemplate.Triggers>
<!--打卡图标触发器-->
<DataTrigger Binding="{Binding IsCard}" Value="true">
<Setter Property="Source" TargetName="CameraOrCard" Value="../Images/card.png"/>
</DataTrigger>
<!--访客颜色触发器-->
<DataTrigger Binding="{Binding IsVisitor}" Value="true">
<Setter Property="Background" TargetName="NameBg" Value="#ee4ab8b4"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
</ControlTemplate>
<ControlTemplate x:Key="Extend_UserInfo" TargetType="ContentControl">
<Grid>
<!--当前信息 - 员工-->
<Border
d:IsHidden="False" Grid.Row="1" Width="881" Margin="84,0,84,31" CornerRadius="25"
BorderThickness="0" Background="#4Cffffff">
<Grid Height="597">
<Grid.RowDefinitions>
<RowDefinition Height="317"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Visibility="{Binding ActiveHuman.IsVisitor, Converter={StaticResource ReverseBooleanToVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="510"/>
</Grid.ColumnDefinitions>
<wpf:HttpImage Stretch="Fill" Grid.Column="0" Url="{Binding ActiveHuman.HumanPhoto}" DefaultImage="/IdentificationViews;component/Images/standby.png" Height="257" Width="181"/>
<StackPanel Orientation="Vertical" Grid.Column="1">
<StackPanel Orientation="Horizontal" Margin="0,64,0,0">
<TextBlock Text="部门:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Depart}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="姓名:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Name}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="时间:" FontSize="36" />
<TextBlock Text="{Binding ActiveHuman.Time}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
<Grid Visibility="{Binding ActiveHuman.IsVisitor, Converter={StaticResource BooleanToVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="510"/>
</Grid.ColumnDefinitions>
<wpf:HttpImage Stretch="Fill" Grid.Column="0" Url="{Binding ActiveHuman.HumanPhoto}" DefaultImage="/IdentificationViews;component/Images/standby.png" Height="257" Width="181"/>
<StackPanel Orientation="Vertical" Grid.Column="1">
<StackPanel Orientation="Horizontal" Margin="0,64,0,0">
<TextBlock Text="被访部门:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Depart}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="访客姓名:" FontSize="36"/>
<TextBlock Text="{Binding ActiveHuman.Name}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,30,0,0">
<TextBlock Text="访问时间:" FontSize="36" />
<TextBlock Text="{Binding ActiveHuman.Time}" FontSize="36" Margin="40,0,0,0"/>
</StackPanel>
</StackPanel>
</Grid>
<TextBlock Text="请稍后,防疫信息获取中..." Visibility="{Binding ExtendInfoLoading,Converter={StaticResource BooleanToVisibilityConverter}}" FontSize="48" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1"/>
<StackPanel d:IsHidden="True" Orientation="Horizontal" Visibility="{Binding ExtendInfoLoading,Converter={StaticResource ReverseBooleanToVisibilityConverter}}" HorizontalAlignment="Center" Grid.Row="1">
<Grid Margin="20,0,20,0" Visibility="{Binding ActiveHuman.ShowNat}">
<Grid.RowDefinitions>
<RowDefinition Height="200"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="200" Height="200" CornerRadius="10" Background="#FF1b7fc7">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<Border Background="{Binding ActiveHuman.NatColor}" CornerRadius="54" Height="108" Width="108">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White">
<Run Text="{Binding ActiveHuman.Nat}" FontSize="50"/>
<Run Text="{Binding ActiveHuman.NatUnit}" FontSize="24"/>
</TextBlock>
</Border>
<StackPanel Grid.Row="1" Orientation="Vertical">
<TextBlock HorizontalAlignment="Center"
FontSize="24" Text="{Binding ActiveHuman.NatTime_Date}" Foreground="White"/>
<TextBlock HorizontalAlignment="Center"
FontSize="24" Text="{Binding ActiveHuman.NatTime_Time}" Foreground="White"/>
</StackPanel>
</Grid>
</Border>
<!--<TextBlock FontSize="24" HorizontalAlignment="Center" Margin="0,10,0,0" Grid.Row="1" Text="核酸检测"/>-->
</Grid>
<Grid Margin="20,0,20,0" Visibility="{Binding ActiveHuman.ShowHealthColor}">
<Grid.RowDefinitions>
<RowDefinition Height="200"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="200" Height="200" CornerRadius="10" Background="#FF1b7fc7">
<ContentControl>
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<Border Background="White" CornerRadius="10" Height="100" Width="100">
<Path x:Name="PART_qrcode" Margin="20" Stretch="Uniform">
<Path.Data>
<PathGeometry Figures="M423.836543 114.819049l0-0.274246L204.08256 114.544803c-45.911656 0-83.09451 36.932144-83.356476 82.59309l-0.023536 0 0 207.579709c0 2.468215 0.500397 4.782933 1.239224 7.000438 6.678096 39.245839 40.831964 69.164243 82.140789 69.164243L423.836543 480.882282l0-0.237407c38.877449-2.432399 70.477144-31.363312 76.798107-68.926836 0.763386-2.217505 1.289366-4.532223 1.289366-7.000438L501.924016 197.137893l-0.025583 0C501.683539 153.253406 467.244168 117.538997 423.836543 114.819049zM458.038506 393.46021c0 24.14798-19.654642 43.705408-43.88551 43.705408L208.445938 437.165618c-24.230867 0-43.858904-19.557428-43.858904-43.705408L164.587034 201.980177c0-24.149003 19.628036-43.717687 43.858904-43.717687l205.708082 0c24.230867 0 43.88551 19.569708 43.88551 43.717687L458.039529 393.46021zM902.246517 195.111746c-0.215918-42.799782-33.818223-77.644381-76.153424-80.304977l0-0.261966L634.384863 114.544803c-44.790112 0-81.040734 36.037774-81.304747 80.56592l-0.023536 0 0 202.511273c0 2.407839 0.476861 4.673439 1.240247 6.831592 6.487761 38.292118 39.830147 67.472717 80.08906 67.472717l191.70823 0 0-0.226151c37.921681-2.385327 68.734454-30.613228 74.961272-67.246567 0.738827-2.158153 1.216711-4.423753 1.216711-6.831592L902.2721 195.111746 902.246517 195.111746zM859.461061 386.638851c0 23.551392-19.152199 42.643216-42.813085 42.643216L638.678656 429.282067c-23.658839 0-42.834574-19.091824-42.834574-42.643216L595.844082 199.832258c0-23.552415 19.175735-42.643216 42.834574-42.643216l177.969321 0c23.660886 0 42.813085 19.091824 42.813085 42.643216L859.461061 386.638851zM415.680792 539.887141l0-0.260943L201.839473 539.626197c-44.670385 0-80.874959 35.94363-81.114412 80.375585l-0.023536 0 0 201.974038c0 2.420119 0.477884 4.687766 1.215688 6.821359 6.464225 38.181601 39.73498 67.316152 79.922261 67.316152L415.680792 896.113331l0-0.236384c37.824467-2.350534 68.567655-30.529317 74.744331-67.079768 0.762363-2.133593 1.24127-4.40124 1.24127-6.821359L491.666394 620.001783l-0.049119 0C491.402381 577.308425 457.919802 542.53648 415.680792 539.887141zM448.975083 811.04077c0 23.493064-19.127639 42.524512-42.691311 42.524512L212.953601 853.565283c0 0-0.022513 0-0.047072 0l-6.822382 0c-23.563672 0-42.690288-19.031449-42.690288-42.524512L163.393859 624.687502c0-23.469528 19.126616-42.525536 42.690288-42.525536l200.200648 0c23.563672 0 42.691311 19.056008 42.691311 42.525536L448.976106 811.04077zM721.154066 753.120616c-14.741749 0-26.66736 11.508102-26.66736 25.699312l0 51.395554c0 14.228049 11.924587 25.721825 26.66736 25.721825 14.736633 0 26.663266-11.492752 26.663266-25.721825l0-51.395554C747.817332 764.628718 735.891721 753.120616 721.154066 753.120616zM834.775846 727.398792c-14.739702 0-26.665313 11.494799-26.665313 25.697265l0 77.118402c0 14.214746 11.924587 25.701358 26.665313 25.701358 14.763239 0 26.688849-11.487635 26.688849-25.701358l0-77.118402C861.464695 738.894613 849.538061 727.398792 834.775846 727.398792zM834.775846 573.172221c-14.739702 0-26.665313 11.506055-26.665313 25.722848l0 51.395554c0 14.189164 11.924587 25.697265 26.665313 25.697265 14.763239 0 26.688849-11.508102 26.688849-25.697265l0-51.395554C861.464695 584.679299 849.538061 573.172221 834.775846 573.172221zM721.154066 573.195757c-14.741749 0-26.66736 11.507078-26.66736 25.709545L694.486706 701.735295c0 14.192234 11.924587 25.686009 26.66736 25.686009 14.736633 0 26.663266-11.492752 26.663266-25.686009L747.817332 598.905302C747.817332 584.702835 735.891721 573.195757 721.154066 573.195757zM606.050538 701.735295c-14.68956 0-26.640754 11.435447-26.640754 25.663496l0 102.81669c0 14.214746 11.951193 25.701358 26.640754 25.701358 14.787798 0 26.712385-11.487635 26.712385-25.701358L632.762923 727.398792C632.763946 713.170742 620.838336 701.735295 606.050538 701.735295zM606.050538 573.172221c-14.68956 0-26.640754 11.506055-26.640754 25.722848l0 25.709545c0 14.201443 11.951193 25.686009 26.640754 25.686009 14.787798 0 26.712385-11.484565 26.712385-25.686009l0-25.709545C632.763946 584.679299 620.838336 573.172221 606.050538 573.172221z" />
</Path.Data>
</Path>
</Border>
<TextBlock x:Name="PART_txt" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1"
FontSize="24" Text="{Binding ActiveHuman.HealthColor}" Foreground="White"/>
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding ActiveHuman.HealthColor}" Value="红码">
<Setter Property="Fill" TargetName="PART_qrcode" Value="#ff0000"/>
<!--<Setter Property="Foreground" TargetName="PART_txt" Value="Red"/>-->
</DataTrigger>
<DataTrigger Binding="{Binding ActiveHuman.HealthColor}" Value="黄码">
<Setter Property="Fill" TargetName="PART_qrcode" Value="#f9ab15"/>
<!--<Setter Property="Foreground" TargetName="PART_txt" Value="Orange"/>-->
</DataTrigger>
<DataTrigger Binding="{Binding ActiveHuman.HealthColor}" Value="绿码">
<Setter Property="Fill" TargetName="PART_qrcode" Value="#23b601"/>
<!--<Setter Property="Foreground" TargetName="PART_txt" Value="green"/>-->
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</Border>
<!--<TextBlock FontSize="24" HorizontalAlignment="Center" Margin="0,10,0,0" Grid.Row="1" Text="健康码"/>-->
</Grid>
<Grid Margin="20,0,20,0" Visibility="{Binding ActiveHuman.ShowInoculationt}">
<Grid.RowDefinitions>
<RowDefinition Height="200"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width="200" Height="200" CornerRadius="10" Background="#FF1b7fc7">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<Path Margin="20" Stretch="Uniform" Fill="#54d3cc"
HorizontalAlignment="Center" VerticalAlignment="Center"
Data="M759.048629 551.737026 440.73184 870.054839c-32.891108 32.850176-86.756923 32.443923-120.096239-0.89437L155.479097 704.002942c-33.348526-33.358759-33.745569-87.224574-0.89437-120.096239l318.316789-318.316789c12.20088-12.190647 12.20088-31.976272 0-44.166919-12.20088-12.20088-31.966039-12.20088-44.166919 0L110.416785 539.739784c-57.211003 57.221236-56.814983 150.729933 0.89437 208.429053l60.494793 60.494793-97.859795 97.859795c-12.20088 12.190647-12.20088 31.976272 0 44.166919 6.099928 6.099928 14.09195 9.150404 22.082948 9.150404s15.98302-3.050476 22.082948-9.150404l97.859795-97.859795 60.494793 60.494793c29.017894 29.017894 67.073628 43.546795 105.038288 43.546795 37.517475 0 74.942853-14.20349 103.390765-42.651402l318.316789-318.316789c12.20088-12.190647 12.20088-31.976272 0-44.166919C791.014668 539.53717 771.249509 539.53717 759.048629 551.737026zM906.84986 365.523951c6.099928 6.099928 14.09195 9.150404 22.082948 9.150404 7.992021 0 15.98302-3.050476 22.082948-9.150404 12.20088-12.190647 12.20088-31.976272 0-44.166919L703.281511 73.621764c-12.20088-12.20088-31.966039-12.20088-44.166919 0-12.20088 12.190647-12.20088 31.976272 0 44.166919l101.784174 101.784174-68.928882 68.928882L498.654041 95.185896c-12.20088-12.20088-31.966039-12.20088-44.166919 0-12.20088 12.190647-12.20088 31.976272 0 44.166919l430.797583 430.797583c6.099928 6.099928 14.09195 9.150404 22.082948 9.150404 7.990998 0 15.98302-3.050476 22.082948-9.150404 12.20088-12.190647 12.20088-31.976272 0-44.166919L736.136803 332.668659l68.928882-68.928882L906.84986 365.523951zM449.40436 377.378953l-22.855544 22.855544c-12.20088 12.190647-12.20088 31.976272 0 44.166919 6.099928 6.099928 14.09195 9.150404 22.082948 9.150404 7.990998 0 15.98302-3.050476 22.082948-9.150404l22.855544-22.855544c12.20088-12.190647 12.20088-31.976272 0-44.166919C481.370399 365.178073 461.60524 365.178073 449.40436 377.378953zM623.121843 596.829014l22.865777-22.855544c12.20088-12.20088 12.20088-31.976272 0.010233-44.177152-12.20088-12.20088-31.976272-12.190647-44.177152-0.010233l-22.865777 22.856567c-12.20088 12.20088-12.20088 31.976272-0.010233 44.177152 6.099928 6.099928 14.102183 9.150404 22.093181 9.150404S617.021915 602.919732 623.121843 596.829014zM403.764903 511.565095c-16.798595-3.929496-33.596166 6.506181-37.517475 23.303752-4.834098 20.687158-4.676509 64.039525 26.560936 95.27697 31.085996 31.087019 74.538647 31.676443 95.318926 27.121707 16.70138-3.659343 27.14729-20.029172 23.695678-36.766368-3.439332-16.740266-19.917632-27.567869-36.70804-24.329105-0.230244 0.042979-23.595394 4.342912-38.136575-10.19827-14.137998-14.137998-10.125615-35.734876-9.827833-37.219693C430.865121 532.066011 420.458097 515.447519 403.764903 511.565095z"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1"
FontSize="24" Text="{Binding ActiveHuman.InoculationtText}" Foreground="White"/>
</Grid>
</Border>
<!--<TextBlock FontSize="24" HorizontalAlignment="Center" Margin="0,10,0,0" Grid.Row="1" Text="疫苗接种"/>-->
</Grid>
</StackPanel>
</Grid>
</Border>
</Grid>
</ControlTemplate>
</ResourceDictionary>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment