Commit e84b3033 authored by 姜春辉's avatar 姜春辉

完成二维码读卡器对接

完成未预约界面
parent 7427deda
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<Key Caption="面部识别SDK版本" Choice="" Name="SDKVersion" Value="2" /> <Key Caption="面部识别SDK版本" Choice="" Name="SDKVersion" Value="2" />
<Key Caption="摄像头输出图像尺寸" Choice="" Name="VideoOutPutSize" Value="352,288" /> <Key Caption="摄像头输出图像尺寸" Choice="" Name="VideoOutPutSize" Value="352,288" />
<Key Caption="摄像头通道编号" Choice="" Name="VideoPort" Value="0" /> <Key Caption="摄像头通道编号" Choice="" Name="VideoPort" Value="0" />
<Key Caption="摄像头启动模式" Choice="" Name="VideoMode" Value="Aforge" /> <Key Caption="摄像头启动模式" Choice="" Name="VideoMode" Value="" />
<Key Caption="识别间隔" Choice="" Name="RecognizationInterval" Value="1000" /> <Key Caption="识别间隔" Choice="" Name="RecognizationInterval" Value="1000" />
<Key Caption="是否开启活体检测,进针对SDKVersion为2时生效" Choice="" Name="EnableAliveness" Value="true" /> <Key Caption="是否开启活体检测,进针对SDKVersion为2时生效" Choice="" Name="EnableAliveness" Value="true" />
<Key Caption="摄像头图像输出间隔(毫秒)" Choice="" Name="VideoOutputSpan" Value="20" /> <Key Caption="摄像头图像输出间隔(毫秒)" Choice="" Name="VideoOutputSpan" Value="1" />
<Key Caption="面部特征值阀值" Choice="" Name="FaceRecognizationValue" Value="0.8" /> <Key Caption="面部特征值阀值" Choice="" Name="FaceRecognizationValue" Value="0.8" />
</Dict> </Dict>
</Dictionaries> </Dictionaries>
......
Design @ e1a04ea1
Subproject commit d818dd2a50f8e4676ceb1e747fe55f9f84d28ad1 Subproject commit e1a04ea150baf8b0facc63ccd4198a3b8f28748b
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:gs="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf"
xmlns:local="clr-namespace:GS.Terminal.VisitorSelfService.Addons.GS.Terminal.Theme.Themes.Default">
<Style x:Key="NoAppointmentContent" TargetType="ContentControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<Border Background="#CC000000" >
<Border Width="860" Height="560"
Padding="60,0,60,0"
Background="White" CornerRadius="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="220"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="关注微信公众号预约"
FontSize="60"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
<gs:IconButton Icon="圆圈叉号" FontSize="100"
Command="{Binding CloseCommand}"
HorizontalAlignment="Right" VerticalAlignment="Center"/>
<Image Source="resources/qrcode.png" VerticalAlignment="Top" Grid.Row="1"/>
</Grid>
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
\ No newline at end of file
ThemeName=Default ThemeName=Default
ThemeDescribe=默认 ThemeDescribe=默认
NoAppointment.xaml
...@@ -154,6 +154,11 @@ ...@@ -154,6 +154,11 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Addons\GS.Terminal.Theme\Themes\Default\NoAppointment.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Page Include="MainWindow.xaml"> <Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
...@@ -316,6 +321,9 @@ ...@@ -316,6 +321,9 @@
<Content Include="Addons\GS.Terminal.Theme\CommonResourceDictionary\manifest.txt"> <Content Include="Addons\GS.Terminal.Theme\CommonResourceDictionary\manifest.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Addons\GS.Terminal.Theme\Themes\Default\resources\qrcode.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="log4net.config"> <Content Include="log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
......
...@@ -7,10 +7,12 @@ using OpenCvSharp.Extensions; ...@@ -7,10 +7,12 @@ using OpenCvSharp.Extensions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input;
using WebSocket4Net; using WebSocket4Net;
namespace GS.Terminal.VisitorSelfService.Logic.Core namespace GS.Terminal.VisitorSelfService.Logic.Core
...@@ -25,6 +27,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -25,6 +27,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
public partial class AuthenticationPageHandler : Corebase<ViewModels.Pages.AuthenticationPage.ViewModel> public partial class AuthenticationPageHandler : Corebase<ViewModels.Pages.AuthenticationPage.ViewModel>
{ {
private string _FaceEngineId = string.Empty; private string _FaceEngineId = string.Empty;
private string _FaceDetectEngineId = string.Empty;
private AuthenticationSuccessDelegate _AuthSuccessCallback; private AuthenticationSuccessDelegate _AuthSuccessCallback;
private IViewModel _ExitView; private IViewModel _ExitView;
/*读取二代证任务*/ /*读取二代证任务*/
...@@ -34,6 +37,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -34,6 +37,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
/*读取二代证任务*/ /*读取二代证任务*/
private WebSocket _faceWebSocket; private WebSocket _faceWebSocket;
private bool _faceValidating = false; private bool _faceValidating = false;
private bool _qrcodeValidating = false;
private string _fid = ""; private string _fid = "";
private byte[] _currentFeature = null; private byte[] _currentFeature = null;
public override void Init() public override void Init()
...@@ -43,7 +47,9 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -43,7 +47,9 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
VM.OnNavigateOut += VM_OnNavigateOut; VM.OnNavigateOut += VM_OnNavigateOut;
VM.OnAuthModeChanged += VM_OnAuthModeChanged; VM.OnAuthModeChanged += VM_OnAuthModeChanged;
_FaceEngineId = ThirdAddon.FastRecognization.CreateFastFaceRecognized(null, FaceAlivness, null, 0.85f); _FaceEngineId = ThirdAddon.FastRecognization.CreateFastFaceRecognized(null, FaceAlivness, null, 0.85f);
_FaceDetectEngineId = ThirdAddon.FastRecognization.CreateFastFaceRecognized(null, null, null, 0.85f, true);
ThirdAddon.FastRecognization.Pause(_FaceEngineId); ThirdAddon.FastRecognization.Pause(_FaceEngineId);
ThirdAddon.FastRecognization.Pause(_FaceDetectEngineId);
ThirdAddon.FastRecognization.RegistFeatureExtracted(_FaceEngineId, FaceFeatureExtracted); ThirdAddon.FastRecognization.RegistFeatureExtracted(_FaceEngineId, FaceFeatureExtracted);
_secondCardReader = Task.Factory.StartNew(_SecondCardRead); _secondCardReader = Task.Factory.StartNew(_SecondCardRead);
_CTS = new CancellationTokenSource(); _CTS = new CancellationTokenSource();
...@@ -54,6 +60,29 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -54,6 +60,29 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
_faceWebSocket.Error += _faceWebSocket_Error; _faceWebSocket.Error += _faceWebSocket_Error;
_faceWebSocket.MessageReceived += _faceWebSocket_MessageReceived; _faceWebSocket.MessageReceived += _faceWebSocket_MessageReceived;
} }
private string _qrcode = "";
private void WindowKeyUp(KeyEventArgs e)
{
if (e.Key != Key.Return)
_qrcode += e.Key;
else
{
if (!_qrcodeValidating)
{
if (_AuthSuccessCallback != null)
{
_qrcodeValidating = true;
_AuthSuccessCallback.Invoke(VM.AuthMode, _qrcode)
.ContinueWith(task =>
{
if (!task.Result)
_qrcodeValidating = false;
});
}
}
_qrcode = "";
}
}
private void _faceWebSocket_MessageReceived(object sender, MessageReceivedEventArgs e) private void _faceWebSocket_MessageReceived(object sender, MessageReceivedEventArgs e)
{ {
...@@ -62,6 +91,10 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -62,6 +91,10 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
try try
{ {
var result = JsonConvert.DeserializeObject<FaceValidateResult>(e.Message); var result = JsonConvert.DeserializeObject<FaceValidateResult>(e.Message);
if (result != null)
{
MainShell.ShowPrompt($"score:{result.score}");
}
if (result?.result != null && if (result?.result != null &&
result.score >= LocalSetting.AddonDefaultConfig.FaceMinValue) result.score >= LocalSetting.AddonDefaultConfig.FaceMinValue)
{ {
...@@ -123,6 +156,16 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -123,6 +156,16 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{ {
_waiter.Reset(); _waiter.Reset();
} }
if (nowMode == ViewModels.Pages.AuthenticationPage.AuthenticationMode.QRCode)
{
_qrcodeValidating = false;
MainShell.AddWindowKeyUp(WindowKeyUp);
}
else
{
MainShell.RemoveWindowKeyUp(WindowKeyUp);
}
} }
private void FaceFeatureExtracted(byte[] feature, string fid) private void FaceFeatureExtracted(byte[] feature, string fid)
...@@ -139,8 +182,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -139,8 +182,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{ {
if (!_faceValidating) if (!_faceValidating)
{ {
if (fid == _fid && result == 1) if (fid == _fid)
if (result == 1)
_faceWebSocket.Send(_currentFeature, 0, _currentFeature.Length); _faceWebSocket.Send(_currentFeature, 0, _currentFeature.Length);
else
MainShell.ShowPrompt($"活体检测失败");
} }
} }
/// <summary> /// <summary>
...@@ -167,6 +213,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -167,6 +213,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
ThirdAddon.FastRecognization.Pause(_FaceEngineId); ThirdAddon.FastRecognization.Pause(_FaceEngineId);
ThirdAddon.FaceRecognization.UnRegistOutPutMatEvent(VideoOut); ThirdAddon.FaceRecognization.UnRegistOutPutMatEvent(VideoOut);
_waiter.Reset(); _waiter.Reset();
MainShell.RemoveWindowKeyUp(WindowKeyUp);
} }
private void VM_OnNavigateInto() private void VM_OnNavigateInto()
...@@ -177,6 +224,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -177,6 +224,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
private void VideoOut(Mat mat) private void VideoOut(Mat mat)
{ {
if (!LocalSetting.AddonDefaultConfig.DisableVideoDetect)
{
var facelocation = FastRecognization.Detect(_FaceDetectEngineId, mat.ToBitmap());
mat.Rectangle(new Rect(facelocation.X, facelocation.Y, facelocation.Width, facelocation.Height), Scalar.Green, 2);
}
DispatcherHelper.CheckBeginInvokeOnUI(() => DispatcherHelper.CheckBeginInvokeOnUI(() =>
{ {
VM.VideoOutput = mat.ToBitmapSource(); VM.VideoOutput = mat.ToBitmapSource();
......
...@@ -33,7 +33,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core ...@@ -33,7 +33,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
} }
else if (menuItem == ViewModels.Pages.MenuPage.MenuItemType.NoAppointment) else if (menuItem == ViewModels.Pages.MenuPage.MenuItemType.NoAppointment)
{ {
Handlers.GetHandler<FeatureCompareHandler>()?.Open(); Handlers.GetHandler<NoAppointmentHandler>()?.Open();
} }
else else
{ {
......
...@@ -6,10 +6,30 @@ using System.Threading.Tasks; ...@@ -6,10 +6,30 @@ using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.Core namespace GS.Terminal.VisitorSelfService.Logic.Core
{ {
public class FeatureCompareHandler : Corebase<ViewModels.PopWindows.FeatureCompare.ViewModel> public class NoAppointmentHandler :
Corebase<ViewModels.PopWindows.NoAppointment.ViewModel>
{ {
public override void Init() public override void Init()
{ {
VM.OnOpened += VM_OnOpened;
VM.OnClosed += VM_OnClosed;
VM.OnCloseClicked += VM_OnCloseClicked;
}
private void VM_OnCloseClicked()
{
ThirdAddon.LogicShell.Close(VM);
}
private void VM_OnClosed()
{
}
private void VM_OnOpened()
{
} }
} }
} }
...@@ -103,12 +103,12 @@ ...@@ -103,12 +103,12 @@
<Reference Include="WebSocket4Net, Version=0.15.2.11, Culture=neutral, PublicKeyToken=eb4e154b696bf72a, processorArchitecture=MSIL"> <Reference Include="WebSocket4Net, Version=0.15.2.11, Culture=neutral, PublicKeyToken=eb4e154b696bf72a, processorArchitecture=MSIL">
<HintPath>..\..\packages\WebSocket4Net.0.15.2\lib\net45\WebSocket4Net.dll</HintPath> <HintPath>..\..\packages\WebSocket4Net.0.15.2\lib\net45\WebSocket4Net.dll</HintPath>
</Reference> </Reference>
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Core\AppointmentDetailPageHandler.cs" /> <Compile Include="Core\AppointmentDetailPageHandler.cs" />
<Compile Include="Core\AuthenticationPageHandler.cs" /> <Compile Include="Core\AuthenticationPageHandler.cs" />
<Compile Include="Core\Corebase.cs" /> <Compile Include="Core\Corebase.cs" />
<Compile Include="Core\FeatureCompareHandler.cs" />
<Compile Include="Core\FootHandler.cs" /> <Compile Include="Core\FootHandler.cs" />
<Compile Include="Core\HeadHandler.cs" /> <Compile Include="Core\HeadHandler.cs" />
<Compile Include="Core\HistoryAppointmentPageHandler.cs" /> <Compile Include="Core\HistoryAppointmentPageHandler.cs" />
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
<Compile Include="Core\HistoryVisitPageHandler.cs" /> <Compile Include="Core\HistoryVisitPageHandler.cs" />
<Compile Include="Core\MenuPageHandler.cs" /> <Compile Include="Core\MenuPageHandler.cs" />
<Compile Include="Core\MenuPageHandler.FindAppointment.cs" /> <Compile Include="Core\MenuPageHandler.FindAppointment.cs" />
<Compile Include="Core\NoAppointmentHandler.cs" />
<Compile Include="Core\SubmitVisitInfoResultHandler.cs" /> <Compile Include="Core\SubmitVisitInfoResultHandler.cs" />
<Compile Include="Handlers.cs" /> <Compile Include="Handlers.cs" />
<Compile Include="LocalSetting.cs" /> <Compile Include="LocalSetting.cs" />
......
...@@ -24,6 +24,7 @@ namespace GS.Terminal.VisitorSelfService.Logic ...@@ -24,6 +24,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
{ {
public float FaceMinValue { get; set; } public float FaceMinValue { get; set; }
public int HeartPort { get; set; } public int HeartPort { get; set; }
public bool DisableVideoDetect { get; set; }
public string DictName => "defaultconfig"; public string DictName => "defaultconfig";
} }
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -25,11 +26,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon ...@@ -25,11 +26,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
public static string CreateFastFaceRecognized(Action<string, float, string> action, public static string CreateFastFaceRecognized(Action<string, float, string> action,
Action<string, int> alivnessaction, Action<string, int> alivnessaction,
List<KeyValuePair<string, byte[]>> facelib, List<KeyValuePair<string, byte[]>> facelib,
float minscore) float minscore, bool usevideo = false)
{ {
if (_Service != null) if (_Service != null)
{ {
return _Service.CreateFastFaceRecognized(action, alivnessaction, facelib, minscore); return _Service.CreateFastFaceRecognized(action, alivnessaction, facelib, minscore, usevideo);
} }
return null; return null;
} }
...@@ -67,5 +68,14 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon ...@@ -67,5 +68,14 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{ {
_Service.RegistFeatureExtracted(fid, action); _Service.RegistFeatureExtracted(fid, action);
} }
public static Rectangle Detect(string fid, Bitmap img)
{
if (_Service != null)
{
return _Service.Detect(fid, img);
}
return new Rectangle();
}
} }
} }
...@@ -4,6 +4,7 @@ using System.Linq; ...@@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input;
namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{ {
...@@ -52,9 +53,14 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon ...@@ -52,9 +53,14 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
return _UIService.AddGarnitureControl(uc, top, left); return _UIService.AddGarnitureControl(uc, top, left);
} }
public static void RemoveGarnitureControl(string id) internal static void AddWindowKeyUp(Action<KeyEventArgs> action)
{ {
_UIService.RemoveGarnitureControl(id); _UIService?.AddWindowKeyUp(action);
}
internal static void RemoveWindowKeyUp(Action<KeyEventArgs> action)
{
_UIService?.RemoveWindowKeyUp(action);
} }
} }
} }
...@@ -25,8 +25,8 @@ namespace ViewModels ...@@ -25,8 +25,8 @@ namespace ViewModels
CheckRegistVM<Pages.HistoryVisitPage.ViewModel>(); CheckRegistVM<Pages.HistoryVisitPage.ViewModel>();
CheckRegistVM<Pages.HistoryAppointmentPage.ViewModel>(); CheckRegistVM<Pages.HistoryAppointmentPage.ViewModel>();
CheckRegistVM<Pages.HistoryMenuPage.ViewModel>(); CheckRegistVM<Pages.HistoryMenuPage.ViewModel>();
CheckRegistVM<PopWindows.FeatureCompare.ViewModel>();
CheckRegistVM<Pages.SubmitVisitInfoResult.ViewModel>(); CheckRegistVM<Pages.SubmitVisitInfoResult.ViewModel>();
CheckRegistVM<PopWindows.NoAppointment.ViewModel>();
} }
private void CheckRegistVM<T>() where T : class private void CheckRegistVM<T>() where T : class
...@@ -103,14 +103,6 @@ namespace ViewModels ...@@ -103,14 +103,6 @@ namespace ViewModels
} }
} }
public PopWindows.FeatureCompare.ViewModel FeatureCompare
{
get
{
return SimpleIoc.Default.GetInstance<PopWindows.FeatureCompare.ViewModel>();
}
}
public Pages.SubmitVisitInfoResult.ViewModel SubmitVisitInfoResult public Pages.SubmitVisitInfoResult.ViewModel SubmitVisitInfoResult
{ {
get get
...@@ -118,5 +110,7 @@ namespace ViewModels ...@@ -118,5 +110,7 @@ namespace ViewModels
return SimpleIoc.Default.GetInstance<Pages.SubmitVisitInfoResult.ViewModel>(); return SimpleIoc.Default.GetInstance<Pages.SubmitVisitInfoResult.ViewModel>();
} }
} }
public PopWindows.NoAppointment.ViewModel NoAppointment => SimpleIoc.Default.GetInstance<PopWindows.NoAppointment.ViewModel>();
} }
} }
...@@ -3,9 +3,11 @@ using GalaSoft.MvvmLight.Command; ...@@ -3,9 +3,11 @@ using GalaSoft.MvvmLight.Command;
using GS.Terminal.LogicShell.Interface; using GS.Terminal.LogicShell.Interface;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
namespace ViewModels.Pages.AuthenticationPage namespace ViewModels.Pages.AuthenticationPage
...@@ -36,6 +38,9 @@ namespace ViewModels.Pages.AuthenticationPage ...@@ -36,6 +38,9 @@ namespace ViewModels.Pages.AuthenticationPage
AuthMode = (AuthenticationMode)int.Parse(para); AuthMode = (AuthenticationMode)int.Parse(para);
}); });
private ImageSource _VideoOutput; private ImageSource _VideoOutput;
public ImageSource VideoOutput public ImageSource VideoOutput
...@@ -44,7 +49,7 @@ namespace ViewModels.Pages.AuthenticationPage ...@@ -44,7 +49,7 @@ namespace ViewModels.Pages.AuthenticationPage
set { _VideoOutput = value; RaisePropertyChanged("VideoOutput"); } set { _VideoOutput = value; RaisePropertyChanged("VideoOutput"); }
} }
private AuthenticationMode _AuthMode = AuthenticationMode.Face; private AuthenticationMode _AuthMode = AuthenticationMode.QRCode;
public AuthenticationMode AuthMode public AuthenticationMode AuthMode
{ {
......
using GalaSoft.MvvmLight; using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GS.Terminal.LogicShell.Interface; using GS.Terminal.LogicShell.Interface;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -6,20 +7,28 @@ using System.Linq; ...@@ -6,20 +7,28 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace ViewModels.PopWindows.FeatureCompare namespace ViewModels.PopWindows.NoAppointment
{ {
public class ViewModel : ViewModelBase, IViewModel, IPopWindowBehavior public class ViewModel : ViewModelBase, IViewModel, IPopWindowBehavior
{ {
public string ViewID => "2ee6db65-26f4-4783-8be3-62e7de5b3914"; public string ViewID => "516f3bb0-c892-4ca0-9599-44dc20d3cc71";
public void Closed() public event Action OnCloseClicked;
public RelayCommand CloseCommand => new RelayCommand(() =>
{ {
OnCloseClicked?.Invoke();
});
}
public event Action OnClosed;
public void Closed()
{
OnClosed?.Invoke();
}
public event Action OnOpened;
public void Opened() public void Opened()
{ {
OnOpened?.Invoke();
} }
public void Reset() public void Reset()
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Foot.cs" /> <Compile Include="Foot.cs" />
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
<Compile Include="Pages\HistoryVisitPage\ViewModel.cs" /> <Compile Include="Pages\HistoryVisitPage\ViewModel.cs" />
<Compile Include="Pages\MenuPage\ViewModel.cs" /> <Compile Include="Pages\MenuPage\ViewModel.cs" />
<Compile Include="Pages\SubmitVisitInfoResult\ViewModel.cs" /> <Compile Include="Pages\SubmitVisitInfoResult\ViewModel.cs" />
<Compile Include="PopWindows\FeatureCompare\ViewModel.cs" /> <Compile Include="PopWindows\NoAppointment\ViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Views.Pages.AuthenticationPage" xmlns:local="clr-namespace:Views.Pages.AuthenticationPage"
xmlns:mvvm="http://www.galasoft.ch/mvvmlight"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:gs="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf" xmlns:gs="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="1695" d:DesignWidth="1080" d:DesignHeight="1695" d:DesignWidth="1080"
...@@ -24,13 +26,12 @@ ...@@ -24,13 +26,12 @@
<RowDefinition Height="140"/> <RowDefinition Height="140"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ContentControl Style="{StaticResource Authentication_CurrentMode}"/> <ContentControl Style="{StaticResource Authentication_CurrentMode}"/>
<!--识别方式--> <!--识别方式-->
<ContentControl Grid.Row="1" Template="{StaticResource Authentication_OtherMode}"/> <ContentControl Grid.Row="1" Template="{StaticResource Authentication_OtherMode}"/>
<Button Grid.Row="2" Template="{StaticResource CommonButton}" <Button Grid.Row="2" Template="{StaticResource CommonButton}"
Command="{Binding ExitCommand}" Command="{Binding ExitCommand}"
Width="250" Height="60" Content="退出" Foreground="#2a2b2d" FontSize="24"/> Width="250" Height="60" Content="退出" Foreground="#2a2b2d" FontSize="24" Focusable="False"/>
</Grid> </Grid>
</Grid> </Grid>
</Page> </Page>
...@@ -3,6 +3,7 @@ using GS.Unitive.Framework.Security.Core; ...@@ -3,6 +3,7 @@ using GS.Unitive.Framework.Security.Core;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.Composition; using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
......
...@@ -12,7 +12,15 @@ ...@@ -12,7 +12,15 @@
<Grid Margin="0,100,0,0"> <Grid Margin="0,100,0,0">
<Border Width="600" Height="600" BorderThickness="10" BorderBrush="#02eea6" CornerRadius="300"> <Border Width="600" Height="600" BorderThickness="10" BorderBrush="#02eea6" CornerRadius="300">
<!--580*580--> <!--580*580-->
<Image Source="{Binding VideoOutput}" Stretch="Fill"> <Image Source="{Binding VideoOutput}" 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.Clip> <Image.Clip>
<GeometryGroup FillRule="Nonzero"> <GeometryGroup FillRule="Nonzero">
<EllipseGeometry RadiusX="290" RadiusY="290" Center="290, 290"></EllipseGeometry> <EllipseGeometry RadiusX="290" RadiusY="290" Center="290, 290"></EllipseGeometry>
...@@ -45,6 +53,11 @@ ...@@ -45,6 +53,11 @@
</TextBlock> </TextBlock>
<Image Source="/Views;component/Resources/auth_mode_current_qrcode.png"/> <Image Source="/Views;component/Resources/auth_mode_current_qrcode.png"/>
</StackPanel> </StackPanel>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding AuthMode}" Value="2">
<!--<Setter Property="FocusManager.IsFocusScope" TargetName="PART_btn" Value="True"/>-->
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
<Style x:Key="Authentication_CurrentMode" TargetType="ContentControl"> <Style x:Key="Authentication_CurrentMode" TargetType="ContentControl">
<Setter Property="Template" Value="{StaticResource Authentication_CurrentMode_QRCode}"/> <Setter Property="Template" Value="{StaticResource Authentication_CurrentMode_QRCode}"/>
...@@ -70,11 +83,11 @@ ...@@ -70,11 +83,11 @@
<TextBlock Text="其他识别方式" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Top"/> <TextBlock Text="其他识别方式" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Top"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Height="296"> <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Height="296">
<Border Visibility="{Binding EnableIdCard, Converter={StaticResource BooleanToVisibilityConverter}}"> <Border Visibility="{Binding EnableIdCard, Converter={StaticResource BooleanToVisibilityConverter}}">
<Button x:Name="PART_idcard" Command="{Binding ChangeAuthModeCommand}" CommandParameter="1" Width="330" Height="296" Margin="50,0,50,0"> <Button x:Name="PART_idcard" Focusable="False" Command="{Binding ChangeAuthModeCommand}" CommandParameter="1" Width="330" Height="296" Margin="50,0,50,0">
<Button.Template> <Button.Template>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<StackPanel> <StackPanel>
<gs:ImageButtonFix Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}" <gs:ImageButtonFix Focusable="False" Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"
Width="330" Height="250" HorizontalAlignment="Center" VerticalAlignment="Center" Width="330" Height="250" HorizontalAlignment="Center" VerticalAlignment="Center"
Image="/Views;component/Resources/auth_mode_idcard.png" /> Image="/Views;component/Resources/auth_mode_idcard.png" />
<TextBlock Text="二代证识别" HorizontalAlignment="Center" FontSize="36"/> <TextBlock Text="二代证识别" HorizontalAlignment="Center" FontSize="36"/>
...@@ -84,11 +97,11 @@ ...@@ -84,11 +97,11 @@
</Button> </Button>
</Border> </Border>
<Border Visibility="{Binding EnableQRCode, Converter={StaticResource BooleanToVisibilityConverter}}"> <Border Visibility="{Binding EnableQRCode, Converter={StaticResource BooleanToVisibilityConverter}}">
<Button x:Name="PART_qrcode" Command="{Binding ChangeAuthModeCommand}" CommandParameter="2" Width="330" Height="296" Margin="50,0,50,0"> <Button x:Name="PART_qrcode" Focusable="False" Command="{Binding ChangeAuthModeCommand}" CommandParameter="2" Width="330" Height="296" Margin="50,0,50,0">
<Button.Template> <Button.Template>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<StackPanel> <StackPanel>
<gs:ImageButtonFix Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}" <gs:ImageButtonFix Focusable="False" Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"
Width="330" Height="250" HorizontalAlignment="Center" VerticalAlignment="Center" Width="330" Height="250" HorizontalAlignment="Center" VerticalAlignment="Center"
Image="/Views;component/Resources/auth_mode_qrcode.png" /> Image="/Views;component/Resources/auth_mode_qrcode.png" />
<TextBlock Text="预约二维码识别" HorizontalAlignment="Center" FontSize="36"/> <TextBlock Text="预约二维码识别" HorizontalAlignment="Center" FontSize="36"/>
...@@ -98,11 +111,11 @@ ...@@ -98,11 +111,11 @@
</Button> </Button>
</Border> </Border>
<Border Visibility="{Binding EnableFace, Converter={StaticResource BooleanToVisibilityConverter}}"> <Border Visibility="{Binding EnableFace, Converter={StaticResource BooleanToVisibilityConverter}}">
<Button x:Name="PART_face" Command="{Binding ChangeAuthModeCommand}" CommandParameter="0" Width="330" Height="296" Margin="50,0,50,0"> <Button x:Name="PART_face" Focusable="False" Command="{Binding ChangeAuthModeCommand}" CommandParameter="0" Width="330" Height="296" Margin="50,0,50,0">
<Button.Template> <Button.Template>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<StackPanel> <StackPanel>
<gs:ImageButtonFix Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}" <gs:ImageButtonFix Focusable="False" Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"
Width="330" Height="250" HorizontalAlignment="Center" VerticalAlignment="Center" Width="330" Height="250" HorizontalAlignment="Center" VerticalAlignment="Center"
Image="/Views;component/Resources/auth_mode_face.png" /> Image="/Views;component/Resources/auth_mode_face.png" />
<TextBlock Text="刷脸识别" HorizontalAlignment="Center" FontSize="36"/> <TextBlock Text="刷脸识别" HorizontalAlignment="Center" FontSize="36"/>
......
<Page x:Class="Views.PopWindows.FeatureCompare.Index" <Page x:Class="Views.PopWindows.NoAppointment.Index"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Views.PopWindows.FeatureCompare" xmlns:local="clr-namespace:Views.PopWindows.NoAppointment"
mc:Ignorable="d" mc:Ignorable="d"
xmlns:gs="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf"
d:DesignHeight="1920" d:DesignWidth="1080" d:DesignHeight="1920" d:DesignWidth="1080"
Title="Index"> Title="Index">
<Grid> <Grid>
<ContentControl Style="{DynamicResource NoAppointmentContent}"/>
</Grid> </Grid>
</Page> </Page>
...@@ -17,14 +17,14 @@ using System.Windows.Media.Imaging; ...@@ -17,14 +17,14 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace Views.PopWindows.FeatureCompare namespace Views.PopWindows.NoAppointment
{ {
/// <summary> /// <summary>
/// Index.xaml 的交互逻辑 /// Index.xaml 的交互逻辑
/// </summary> /// </summary>
[Export(typeof(IView))] [Export(typeof(IView))]
[PopWindow(1080, 1920)] [PopWindow(1080, 1920)]
[UnitiveView("验证特征值", "", "2ee6db65-26f4-4783-8be3-62e7de5b3914", null)] [UnitiveView("无预约单页面", "", "516f3bb0-c892-4ca0-9599-44dc20d3cc71", null)]
public partial class Index : Page, IView public partial class Index : Page, IView
{ {
public Index() public Index()
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Views.PopWindows.FeatureCompare"> xmlns:local="clr-namespace:Views.PopWindows.NoAppointment">
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
...@@ -32,9 +32,21 @@ ...@@ -32,9 +32,21 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
<HintPath>..\..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
</Reference>
<Reference Include="Develop.Extension.Wpf"> <Reference Include="Develop.Extension.Wpf">
<HintPath>..\..\..\..\Tools\Develop.Extension.Wpf.dll</HintPath> <HintPath>..\..\..\..\Tools\Develop.Extension.Wpf.dll</HintPath>
</Reference> </Reference>
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
</Reference>
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
</Reference>
<Reference Include="GS.Terminal.LogicShell.Attributes"> <Reference Include="GS.Terminal.LogicShell.Attributes">
<HintPath>..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll</HintPath> <HintPath>..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll</HintPath>
</Reference> </Reference>
...@@ -50,6 +62,9 @@ ...@@ -50,6 +62,9 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" /> <Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
...@@ -91,7 +106,7 @@ ...@@ -91,7 +106,7 @@
<Compile Include="Pages\SubmitVisitInfoResult\Index.xaml.cs"> <Compile Include="Pages\SubmitVisitInfoResult\Index.xaml.cs">
<DependentUpon>Index.xaml</DependentUpon> <DependentUpon>Index.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="PopWindows\FeatureCompare\Index.xaml.cs"> <Compile Include="PopWindows\NoAppointment\Index.xaml.cs">
<DependentUpon>Index.xaml</DependentUpon> <DependentUpon>Index.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
...@@ -174,11 +189,11 @@ ...@@ -174,11 +189,11 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="PopWindows\FeatureCompare\Index.xaml"> <Page Include="PopWindows\NoAppointment\Index.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="PopWindows\FeatureCompare\Style.xaml"> <Page Include="PopWindows\NoAppointment\Style.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
...@@ -222,5 +237,6 @@ ...@@ -222,5 +237,6 @@
<ItemGroup> <ItemGroup>
<Resource Include="Resources\result_correct.png" /> <Resource Include="Resources\result_correct.png" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net452" />
<package id="GS.Unitive.Framework.Security" version="1.4.0.2" targetFramework="net452" /> <package id="GS.Unitive.Framework.Security" version="1.4.0.2" targetFramework="net452" />
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" /> <package id="Newtonsoft.Json" version="10.0.2" targetFramework="net452" />
</packages> </packages>
\ 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