Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
G
GS.Terminal.VisitorSelfService
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
终端组
GS.Terminal.VisitorSelfService
Commits
e84b3033
Commit
e84b3033
authored
Aug 11, 2020
by
姜春辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成二维码读卡器对接
完成未预约界面
parent
7427deda
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
260 additions
and
41 deletions
+260
-41
Config.xml
Addons/GS.Terminal.FaceRecognization/Config.xml
+2
-2
GS.Terminal.FaceRecognization.dll
...minal.FaceRecognization/GS.Terminal.FaceRecognization.dll
+0
-0
GS.Terminal.MainShell.dll
Addons/GS.Terminal.MainShell/GS.Terminal.MainShell.dll
+0
-0
Design
Design
+1
-1
NoAppointment.xaml
...ddons/GS.Terminal.Theme/Themes/Default/NoAppointment.xaml
+32
-0
manifest.txt
...vice/Addons/GS.Terminal.Theme/Themes/Default/manifest.txt
+2
-1
qrcode.png
...ons/GS.Terminal.Theme/Themes/Default/resources/qrcode.png
+0
-0
GS.Terminal.VisitorSelfService.csproj
....VisitorSelfService/GS.Terminal.VisitorSelfService.csproj
+8
-0
AuthenticationPageHandler.cs
...isitorSelfService.Logic/Core/AuthenticationPageHandler.cs
+54
-2
MenuPageHandler.cs
...Terminal.VisitorSelfService.Logic/Core/MenuPageHandler.cs
+1
-1
NoAppointmentHandler.cs
...nal.VisitorSelfService.Logic/Core/NoAppointmentHandler.cs
+35
-0
GS.Terminal.VisitorSelfService.Logic.csproj
...Service.Logic/GS.Terminal.VisitorSelfService.Logic.csproj
+2
-1
LocalSetting.cs
...ogic/GS.Terminal.VisitorSelfService.Logic/LocalSetting.cs
+1
-0
FastRecognization.cs
....VisitorSelfService.Logic/ThirdAddon/FastRecognization.cs
+12
-2
MainShell.cs
...Terminal.VisitorSelfService.Logic/ThirdAddon/MainShell.cs
+8
-2
Locator.cs
...al.VisitorSelfService/ViewModelView/ViewModels/Locator.cs
+3
-9
ViewModel.cs
...odelView/ViewModels/Pages/AuthenticationPage/ViewModel.cs
+6
-1
ViewModel.cs
...odelView/ViewModels/PopWindows/NoAppointment/ViewModel.cs
+39
-0
ViewModels.csproj
...torSelfService/ViewModelView/ViewModels/ViewModels.csproj
+2
-1
Index.xaml
...e/ViewModelView/Views/Pages/AuthenticationPage/Index.xaml
+3
-2
Index.xaml.cs
...iewModelView/Views/Pages/AuthenticationPage/Index.xaml.cs
+1
-0
Style.xaml
...e/ViewModelView/Views/Pages/AuthenticationPage/Style.xaml
+20
-7
Index.xaml
...e/ViewModelView/Views/PopWindows/NoAppointment/Index.xaml
+4
-3
Index.xaml.cs
...iewModelView/Views/PopWindows/NoAppointment/Index.xaml.cs
+2
-2
Style.xaml
...e/ViewModelView/Views/PopWindows/NoAppointment/Style.xaml
+1
-1
Views.csproj
...minal.VisitorSelfService/ViewModelView/Views/Views.csproj
+19
-3
packages.config
...al.VisitorSelfService/ViewModelView/Views/packages.config
+2
-0
No files found.
Addons/GS.Terminal.FaceRecognization/Config.xml
View file @
e84b3033
...
...
@@ -5,10 +5,10 @@
<Key
Caption=
"面部识别SDK版本"
Choice=
""
Name=
"SDKVersion"
Value=
"2"
/>
<Key
Caption=
"摄像头输出图像尺寸"
Choice=
""
Name=
"VideoOutPutSize"
Value=
"352,288"
/>
<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=
"是否开启活体检测,进针对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"
/>
</Dict>
</Dictionaries>
...
...
Addons/GS.Terminal.FaceRecognization/GS.Terminal.FaceRecognization.dll
View file @
e84b3033
No preview for this file type
Addons/GS.Terminal.MainShell/GS.Terminal.MainShell.dll
View file @
e84b3033
No preview for this file type
Design
@
e1a04ea1
Subproject commit
d818dd2a50f8e4676ceb1e747fe55f9f84d28ad1
Subproject commit
e1a04ea150baf8b0facc63ccd4198a3b8f28748b
Src/GS.Terminal.VisitorSelfService/GS.Terminal.VisitorSelfService/Addons/GS.Terminal.Theme/Themes/Default/NoAppointment.xaml
0 → 100644
View file @
e84b3033
<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
Src/GS.Terminal.VisitorSelfService/GS.Terminal.VisitorSelfService/Addons/GS.Terminal.Theme/Themes/Default/manifest.txt
View file @
e84b3033
ThemeName=Default
ThemeDescribe=默认
\ No newline at end of file
ThemeDescribe=默认
NoAppointment.xaml
Src/GS.Terminal.VisitorSelfService/GS.Terminal.VisitorSelfService/Addons/GS.Terminal.Theme/Themes/Default/resources/qrcode.png
0 → 100644
View file @
e84b3033
This diff is collapsed.
Click to expand it.
Src/GS.Terminal.VisitorSelfService/GS.Terminal.VisitorSelfService/GS.Terminal.VisitorSelfService.csproj
View file @
e84b3033
...
...
@@ -154,6 +154,11 @@
<SubType>
Designer
</SubType>
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
</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"
>
<Generator>
MSBuild:Compile
</Generator>
<SubType>
Designer
</SubType>
...
...
@@ -316,6 +321,9 @@
<Content
Include=
"Addons\GS.Terminal.Theme\CommonResourceDictionary\manifest.txt"
>
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
</Content>
<Content
Include=
"Addons\GS.Terminal.Theme\Themes\Default\resources\qrcode.png"
>
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
</Content>
<Content
Include=
"log4net.config"
>
<CopyToOutputDirectory>
Always
</CopyToOutputDirectory>
</Content>
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/AuthenticationPageHandler.cs
View file @
e84b3033
...
...
@@ -7,10 +7,12 @@ using OpenCvSharp.Extensions;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Windows.Input
;
using
WebSocket4Net
;
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
>
{
private
string
_FaceEngineId
=
string
.
Empty
;
private
string
_FaceDetectEngineId
=
string
.
Empty
;
private
AuthenticationSuccessDelegate
_AuthSuccessCallback
;
private
IViewModel
_ExitView
;
/*读取二代证任务*/
...
...
@@ -34,6 +37,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
/*读取二代证任务*/
private
WebSocket
_faceWebSocket
;
private
bool
_faceValidating
=
false
;
private
bool
_qrcodeValidating
=
false
;
private
string
_fid
=
""
;
private
byte
[]
_currentFeature
=
null
;
public
override
void
Init
()
...
...
@@ -43,7 +47,9 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
VM
.
OnNavigateOut
+=
VM_OnNavigateOut
;
VM
.
OnAuthModeChanged
+=
VM_OnAuthModeChanged
;
_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
(
_FaceDetectEngineId
);
ThirdAddon
.
FastRecognization
.
RegistFeatureExtracted
(
_FaceEngineId
,
FaceFeatureExtracted
);
_secondCardReader
=
Task
.
Factory
.
StartNew
(
_SecondCardRead
);
_CTS
=
new
CancellationTokenSource
();
...
...
@@ -54,6 +60,29 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
_faceWebSocket
.
Error
+=
_faceWebSocket_Error
;
_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
)
{
...
...
@@ -62,6 +91,10 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
try
{
var
result
=
JsonConvert
.
DeserializeObject
<
FaceValidateResult
>(
e
.
Message
);
if
(
result
!=
null
)
{
MainShell
.
ShowPrompt
(
$"score:
{
result
.
score
}
"
);
}
if
(
result
?.
result
!=
null
&&
result
.
score
>=
LocalSetting
.
AddonDefaultConfig
.
FaceMinValue
)
{
...
...
@@ -123,6 +156,16 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{
_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
)
...
...
@@ -139,8 +182,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{
if
(!
_faceValidating
)
{
if
(
fid
==
_fid
&&
result
==
1
)
_faceWebSocket
.
Send
(
_currentFeature
,
0
,
_currentFeature
.
Length
);
if
(
fid
==
_fid
)
if
(
result
==
1
)
_faceWebSocket
.
Send
(
_currentFeature
,
0
,
_currentFeature
.
Length
);
else
MainShell
.
ShowPrompt
(
$"活体检测失败"
);
}
}
/// <summary>
...
...
@@ -167,6 +213,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
ThirdAddon
.
FastRecognization
.
Pause
(
_FaceEngineId
);
ThirdAddon
.
FaceRecognization
.
UnRegistOutPutMatEvent
(
VideoOut
);
_waiter
.
Reset
();
MainShell
.
RemoveWindowKeyUp
(
WindowKeyUp
);
}
private
void
VM_OnNavigateInto
()
...
...
@@ -177,6 +224,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
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
(()
=>
{
VM
.
VideoOutput
=
mat
.
ToBitmapSource
();
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/MenuPageHandler.cs
View file @
e84b3033
...
...
@@ -33,7 +33,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
}
else
if
(
menuItem
==
ViewModels
.
Pages
.
MenuPage
.
MenuItemType
.
NoAppointment
)
{
Handlers
.
GetHandler
<
FeatureCompare
Handler
>()?.
Open
();
Handlers
.
GetHandler
<
NoAppointment
Handler
>()?.
Open
();
}
else
{
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/
FeatureCompare
Handler.cs
→
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/
NoAppointment
Handler.cs
View file @
e84b3033
...
...
@@ -6,10 +6,30 @@ using System.Threading.Tasks;
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
()
{
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
()
{
}
}
}
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/GS.Terminal.VisitorSelfService.Logic.csproj
View file @
e84b3033
...
...
@@ -103,12 +103,12 @@
<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>
</Reference>
<Reference
Include=
"WindowsBase"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Core\AppointmentDetailPageHandler.cs"
/>
<Compile
Include=
"Core\AuthenticationPageHandler.cs"
/>
<Compile
Include=
"Core\Corebase.cs"
/>
<Compile
Include=
"Core\FeatureCompareHandler.cs"
/>
<Compile
Include=
"Core\FootHandler.cs"
/>
<Compile
Include=
"Core\HeadHandler.cs"
/>
<Compile
Include=
"Core\HistoryAppointmentPageHandler.cs"
/>
...
...
@@ -116,6 +116,7 @@
<Compile
Include=
"Core\HistoryVisitPageHandler.cs"
/>
<Compile
Include=
"Core\MenuPageHandler.cs"
/>
<Compile
Include=
"Core\MenuPageHandler.FindAppointment.cs"
/>
<Compile
Include=
"Core\NoAppointmentHandler.cs"
/>
<Compile
Include=
"Core\SubmitVisitInfoResultHandler.cs"
/>
<Compile
Include=
"Handlers.cs"
/>
<Compile
Include=
"LocalSetting.cs"
/>
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/LocalSetting.cs
View file @
e84b3033
...
...
@@ -24,6 +24,7 @@ namespace GS.Terminal.VisitorSelfService.Logic
{
public
float
FaceMinValue
{
get
;
set
;
}
public
int
HeartPort
{
get
;
set
;
}
public
bool
DisableVideoDetect
{
get
;
set
;
}
public
string
DictName
=>
"defaultconfig"
;
}
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/ThirdAddon/FastRecognization.cs
View file @
e84b3033
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -25,11 +26,11 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
public
static
string
CreateFastFaceRecognized
(
Action
<
string
,
float
,
string
>
action
,
Action
<
string
,
int
>
alivnessaction
,
List
<
KeyValuePair
<
string
,
byte
[
]>
>
facelib
,
float
minscore
)
float
minscore
,
bool
usevideo
=
false
)
{
if
(
_Service
!=
null
)
{
return
_Service
.
CreateFastFaceRecognized
(
action
,
alivnessaction
,
facelib
,
minscore
);
return
_Service
.
CreateFastFaceRecognized
(
action
,
alivnessaction
,
facelib
,
minscore
,
usevideo
);
}
return
null
;
}
...
...
@@ -67,5 +68,14 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
_Service
.
RegistFeatureExtracted
(
fid
,
action
);
}
public
static
Rectangle
Detect
(
string
fid
,
Bitmap
img
)
{
if
(
_Service
!=
null
)
{
return
_Service
.
Detect
(
fid
,
img
);
}
return
new
Rectangle
();
}
}
}
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/ThirdAddon/MainShell.cs
View file @
e84b3033
...
...
@@ -4,6 +4,7 @@ using System.Linq;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Controls
;
using
System.Windows.Input
;
namespace
GS.Terminal.VisitorSelfService.Logic.ThirdAddon
{
...
...
@@ -52,9 +53,14 @@ namespace GS.Terminal.VisitorSelfService.Logic.ThirdAddon
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
);
}
}
}
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/Locator.cs
View file @
e84b3033
...
...
@@ -25,8 +25,8 @@ namespace ViewModels
CheckRegistVM
<
Pages
.
HistoryVisitPage
.
ViewModel
>();
CheckRegistVM
<
Pages
.
HistoryAppointmentPage
.
ViewModel
>();
CheckRegistVM
<
Pages
.
HistoryMenuPage
.
ViewModel
>();
CheckRegistVM
<
PopWindows
.
FeatureCompare
.
ViewModel
>();
CheckRegistVM
<
Pages
.
SubmitVisitInfoResult
.
ViewModel
>();
CheckRegistVM
<
PopWindows
.
NoAppointment
.
ViewModel
>();
}
private
void
CheckRegistVM
<
T
>()
where
T
:
class
...
...
@@ -103,14 +103,6 @@ namespace ViewModels
}
}
public
PopWindows
.
FeatureCompare
.
ViewModel
FeatureCompare
{
get
{
return
SimpleIoc
.
Default
.
GetInstance
<
PopWindows
.
FeatureCompare
.
ViewModel
>();
}
}
public
Pages
.
SubmitVisitInfoResult
.
ViewModel
SubmitVisitInfoResult
{
get
...
...
@@ -118,5 +110,7 @@ namespace ViewModels
return
SimpleIoc
.
Default
.
GetInstance
<
Pages
.
SubmitVisitInfoResult
.
ViewModel
>();
}
}
public
PopWindows
.
NoAppointment
.
ViewModel
NoAppointment
=>
SimpleIoc
.
Default
.
GetInstance
<
PopWindows
.
NoAppointment
.
ViewModel
>();
}
}
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/Pages/AuthenticationPage/ViewModel.cs
View file @
e84b3033
...
...
@@ -3,9 +3,11 @@ using GalaSoft.MvvmLight.Command;
using
GS.Terminal.LogicShell.Interface
;
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Input
;
using
System.Windows.Media
;
namespace
ViewModels.Pages.AuthenticationPage
...
...
@@ -36,6 +38,9 @@ namespace ViewModels.Pages.AuthenticationPage
AuthMode
=
(
AuthenticationMode
)
int
.
Parse
(
para
);
});
private
ImageSource
_VideoOutput
;
public
ImageSource
VideoOutput
...
...
@@ -44,7 +49,7 @@ namespace ViewModels.Pages.AuthenticationPage
set
{
_VideoOutput
=
value
;
RaisePropertyChanged
(
"VideoOutput"
);
}
}
private
AuthenticationMode
_AuthMode
=
AuthenticationMode
.
Fac
e
;
private
AuthenticationMode
_AuthMode
=
AuthenticationMode
.
QRCod
e
;
public
AuthenticationMode
AuthMode
{
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/PopWindows/
FeatureCompare
/ViewModel.cs
→
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/PopWindows/
NoAppointment
/ViewModel.cs
View file @
e84b3033
using
GalaSoft.MvvmLight
;
using
GalaSoft.MvvmLight.Command
;
using
GS.Terminal.LogicShell.Interface
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -6,25 +7,33 @@ using System.Linq;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
ViewModels.PopWindows.
FeatureCompare
namespace
ViewModels.PopWindows.
NoAppointment
{
public
class
ViewModel
:
ViewModelBase
,
IViewModel
,
IPopWindowBehavior
{
public
string
ViewID
=>
"
2ee6db65-26f4-4783-8be3-62e7de5b3914
"
;
public
string
ViewID
=>
"
516f3bb0-c892-4ca0-9599-44dc20d3cc71
"
;
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
()
{
OnOpened
?.
Invoke
();
}
public
void
Reset
()
{
}
}
}
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/ViewModels.csproj
View file @
e84b3033
...
...
@@ -62,6 +62,7 @@
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Net.Http"
/>
<Reference
Include=
"System.Xml"
/>
<Reference
Include=
"WindowsBase"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Foot.cs"
/>
...
...
@@ -74,7 +75,7 @@
<Compile
Include=
"Pages\HistoryVisitPage\ViewModel.cs"
/>
<Compile
Include=
"Pages\MenuPage\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"
/>
</ItemGroup>
<ItemGroup>
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/Pages/AuthenticationPage/Index.xaml
View file @
e84b3033
...
...
@@ -4,6 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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"
mc:Ignorable="d"
d:DesignHeight="1695" d:DesignWidth="1080"
...
...
@@ -24,13 +26,12 @@
<RowDefinition Height="140"/>
</Grid.RowDefinitions>
<ContentControl Style="{StaticResource Authentication_CurrentMode}"/>
<!--识别方式-->
<ContentControl Grid.Row="1" Template="{StaticResource Authentication_OtherMode}"/>
<Button Grid.Row="2" Template="{StaticResource CommonButton}"
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>
</Page>
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/Pages/AuthenticationPage/Index.xaml.cs
View file @
e84b3033
...
...
@@ -3,6 +3,7 @@ using GS.Unitive.Framework.Security.Core;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.Composition
;
using
System.Diagnostics
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/Pages/AuthenticationPage/Style.xaml
View file @
e84b3033
...
...
@@ -12,7 +12,15 @@
<Grid Margin="0,100,0,0">
<Border Width="600" Height="600" BorderThickness="10" BorderBrush="#02eea6" CornerRadius="300">
<!--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>
<GeometryGroup FillRule="Nonzero">
<EllipseGeometry RadiusX="290" RadiusY="290" Center="290, 290"></EllipseGeometry>
...
...
@@ -45,6 +53,11 @@
</TextBlock>
<Image Source="/Views;component/Resources/auth_mode_current_qrcode.png"/>
</StackPanel>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding AuthMode}" Value="2">
<!--<Setter Property="FocusManager.IsFocusScope" TargetName="PART_btn" Value="True"/>-->
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="Authentication_CurrentMode" TargetType="ContentControl">
<Setter Property="Template" Value="{StaticResource Authentication_CurrentMode_QRCode}"/>
...
...
@@ -70,11 +83,11 @@
<TextBlock Text="其他识别方式" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Top"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Height="296">
<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>
<ControlTemplate TargetType="Button">
<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"
Image="/Views;component/Resources/auth_mode_idcard.png" />
<TextBlock Text="二代证识别" HorizontalAlignment="Center" FontSize="36"/>
...
...
@@ -84,11 +97,11 @@
</Button>
</Border>
<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>
<ControlTemplate TargetType="Button">
<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"
Image="/Views;component/Resources/auth_mode_qrcode.png" />
<TextBlock Text="预约二维码识别" HorizontalAlignment="Center" FontSize="36"/>
...
...
@@ -98,11 +111,11 @@
</Button>
</Border>
<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>
<ControlTemplate TargetType="Button">
<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"
Image="/Views;component/Resources/auth_mode_face.png" />
<TextBlock Text="刷脸识别" HorizontalAlignment="Center" FontSize="36"/>
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/PopWindows/
FeatureCompare
/Index.xaml
→
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/PopWindows/
NoAppointment
/Index.xaml
View file @
e84b3033
<Page x:Class="Views.PopWindows.
FeatureCompare
.Index"
<Page x:Class="Views.PopWindows.
NoAppointment
.Index"
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:Views.PopWindows.
FeatureCompare
"
xmlns:local="clr-namespace:Views.PopWindows.
NoAppointment
"
mc:Ignorable="d"
xmlns:gs="clr-namespace:Develop.Extension.Wpf;assembly=Develop.Extension.Wpf"
d:DesignHeight="1920" d:DesignWidth="1080"
Title="Index">
<Grid>
<ContentControl Style="{DynamicResource NoAppointmentContent}"/>
</Grid>
</Page>
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/PopWindows/
FeatureCompare
/Index.xaml.cs
→
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/PopWindows/
NoAppointment
/Index.xaml.cs
View file @
e84b3033
...
...
@@ -17,14 +17,14 @@ using System.Windows.Media.Imaging;
using
System.Windows.Navigation
;
using
System.Windows.Shapes
;
namespace
Views.PopWindows.
FeatureCompare
namespace
Views.PopWindows.
NoAppointment
{
/// <summary>
/// Index.xaml 的交互逻辑
/// </summary>
[
Export
(
typeof
(
IView
))]
[
PopWindow
(
1080
,
1920
)]
[
UnitiveView
(
"
验证特征值"
,
""
,
"2ee6db65-26f4-4783-8be3-62e7de5b3914
"
,
null
)]
[
UnitiveView
(
"
无预约单页面"
,
""
,
"516f3bb0-c892-4ca0-9599-44dc20d3cc71
"
,
null
)]
public
partial
class
Index
:
Page
,
IView
{
public
Index
()
...
...
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/PopWindows/
FeatureCompare
/Style.xaml
→
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/PopWindows/
NoAppointment
/Style.xaml
View file @
e84b3033
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Views.PopWindows.
FeatureCompare
">
xmlns:local="clr-namespace:Views.PopWindows.
NoAppointment
">
</ResourceDictionary>
\ No newline at end of file
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/Views.csproj
View file @
e84b3033
...
...
@@ -32,9 +32,21 @@
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<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"
>
<HintPath>
..\..\..\..\Tools\Develop.Extension.Wpf.dll
</HintPath>
</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"
>
<HintPath>
..\..\..\..\Addons\GS.Terminal.LogicShell\GS.Terminal.LogicShell.Attributes.dll
</HintPath>
</Reference>
...
...
@@ -50,6 +62,9 @@
<Reference
Include=
"System"
/>
<Reference
Include=
"System.ComponentModel.Composition"
/>
<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=
"Microsoft.CSharp"
/>
<Reference
Include=
"System.Core"
/>
...
...
@@ -91,7 +106,7 @@
<Compile
Include=
"Pages\SubmitVisitInfoResult\Index.xaml.cs"
>
<DependentUpon>
Index.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"PopWindows\
FeatureCompare
\Index.xaml.cs"
>
<Compile
Include=
"PopWindows\
NoAppointment
\Index.xaml.cs"
>
<DependentUpon>
Index.xaml
</DependentUpon>
</Compile>
<Compile
Include=
"Properties\AssemblyInfo.cs"
>
...
...
@@ -174,11 +189,11 @@
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
</Page>
<Page
Include=
"PopWindows\
FeatureCompare
\Index.xaml"
>
<Page
Include=
"PopWindows\
NoAppointment
\Index.xaml"
>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
</Page>
<Page
Include=
"PopWindows\
FeatureCompare
\Style.xaml"
>
<Page
Include=
"PopWindows\
NoAppointment
\Style.xaml"
>
<SubType>
Designer
</SubType>
<Generator>
MSBuild:Compile
</Generator>
</Page>
...
...
@@ -222,5 +237,6 @@
<ItemGroup>
<Resource
Include=
"Resources\result_correct.png"
/>
</ItemGroup>
<ItemGroup
/>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/packages.config
View file @
e84b3033
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
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
=
"MvvmLightLibs"
version
=
"5.4.1.1"
targetFramework
=
"net452"
/>
<
package
id
=
"Newtonsoft.Json"
version
=
"10.0.2"
targetFramework
=
"net452"
/>
</
packages
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment