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

完成登记流程页面交互逻辑

parent e912d2cf
......@@ -14,7 +14,7 @@
<Property Caption="服务地址" Name="ServiceUri"/>
</Declare>
<Datas>
<Data Description="获取人员有效预约单" Key="IncreasePersonFaceByTerminal" ServiceUri="/Services/PersonFace/IncreasePersonFaceByTerminal/json" />
<Data Description="获取人员有效预约单" Key="VisitorAvailableAppointment" ServiceUri="/api/GS.Sub.Vistor/VisitorSelfServiceTerminal/VisitorAvailableAppointment" />
</Datas>
</Structure>
</Structures>
......
using System;
using GS.Terminal.LogicShell.Interface;
using GS.Terminal.VisitorSelfService.Logic.Remote.Models;
using GS.Terminal.VisitorSelfService.Logic.ThirdAddon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ViewModels.Pages.AppointmentDetailPage;
namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public partial class AppointmentDetailPageHandler :
Corebase<ViewModels.Pages.AppointmentDetailPage.ViewModel>
Corebase<ViewModel>
{
private IViewModel _ExitView;
public override void Init()
{
VM.OnExitClick += VM_OnExitClick;
VM.OnSubmitClick += VM_OnSubmitClick;
}
private void VM_OnSubmitClick(AppointmentItem info)
{
}
private void VM_OnExitClick()
{
ThirdAddon.LogicShell.ShowView(_ExitView ?? vmLocator.MenuPage);
VM.Reset();
_ExitView = null;
}
internal void ShowDetail(List<Appointment> datas, IViewModel exitView = null)
{
if (datas?.Count == 0)
{
MainShell.ShowPrompt($"无效信息");
return;
}
_ExitView = exitView;
VM.Datas = datas.Select(ss =>
{
var item = new AppointmentItem();
item.areaName = ss.visitArea;
item.beVisitPerson = ss.visitPerson;
item.endDate = ss.endDate;
item.idCardNum = ss.visitorIdNum;
item.phoneNum = ss.visitorPhone;
item.photoUrl = ss.photo;
item.startDate = ss.startDate;
item.visitorName = ss.visitorName;
item.visitPeople = ss.numberOfPeople;
if (ss.extendInfo?.Count > 0)
{
item.extends = ss.extendInfo.GroupBy(g => g.group)
.Select(g => new AppointmentExtendGroup
{
groupName = g.Key,
items = g.Select(content => new ViewModels.Pages.AppointmentDetailPage.AppointmentExtendInfo
{
title = content.title,
content = content.content,
infotype = content.type
}).ToList()
}).ToList();
}
return item;
}).ToList();
if (VM.Datas.Count > 0)
VM.Appointment = VM.Datas[0];
ShowView();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public class FeatureCompareHandler : Corebase<ViewModels.PopWindows.FeatureCompare.ViewModel>
{
public override void Init()
{
}
}
}
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public class HistoryAppointmentPageHandler : Corebase<ViewModels.Pages.HistoryAppointmentPage.ViewModel>
{
private IViewModel _BackView;
public override void Init()
{
}
public void ShowView(string idnum, IViewModel backview = null)
{
_BackView = backview;
ShowView();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public class HistoryMenuPageHandler : Corebase<ViewModels.Pages.HistoryMenuPage.ViewModel>
{
private string _idNum;
public override void Init()
{
VM.OnVisitInfoClick += VM_OnVisitInfoClick;
VM.OnExitClick += VM_OnExitClick;
VM.OnAppointmentClick += VM_OnAppointmentClick;
}
private void VM_OnAppointmentClick()
{
Handlers.GetHandler<HistoryAppointmentPageHandler>()?.ShowView(_idNum, VM);
}
private void VM_OnExitClick()
{
ThirdAddon.LogicShell.ShowView(vmLocator.MenuPage);
}
private void VM_OnVisitInfoClick()
{
}
public void ShowView(string idNum)
{
_idNum = idNum;
ShowView();
}
}
}
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public class HistoryVisitPageHandler : Corebase<ViewModels.Pages.HistoryVisitPage.ViewModel>
{
public string _IDNum;
public override void Init()
{
}
public void ShowView(string idnum, IViewModel backview = null)
{
_IDNum = idnum;
ShowView();
}
}
}
using GS.Terminal.VisitorSelfService.Logic.Remote;
using GS.Terminal.VisitorSelfService.Logic.Remote.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ViewModels.Pages.AuthenticationPage;
namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public partial class MenuPageHandler
{
private async Task<List<Appointment>> Find(string key, AuthenticationMode mode)
{
var type = "idnum";
if (mode == AuthenticationMode.QRCode)
type = "qrcode";
var serviceUrl = LocalSetting.ServiceList.GetSerivceUri("VisitorAvailableAppointment");
var result = await WebApi.GetTAsync<List<Appointment>>($"{serviceUrl}{(serviceUrl.Contains("?") ? "&" : "?")}searchkey={key}&searchvalue={type}");
return result;
}
}
}
......@@ -8,7 +8,7 @@ using ViewModels.Pages.AuthenticationPage;
namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public class MenuPageHandler : Corebase<ViewModels.Pages.MenuPage.ViewModel>
public partial class MenuPageHandler : Corebase<ViewModels.Pages.MenuPage.ViewModel>
{
public override void Init()
{
......@@ -24,7 +24,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
}
else if (menuItem == ViewModels.Pages.MenuPage.MenuItemType.NoAppointment)
{
Handlers.GetHandler<FeatureCompareHandler>()?.Open();
}
else
{
......@@ -36,21 +36,28 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
private async Task<bool> AuthSuccess(AuthenticationMode mode, object data)
{
MainShell.ShowLoading("正在查找");
await Task.Delay(2000);
var findResult = await Find(data.ToString(), mode);
MainShell.ShowPrompt($"查找完成");
MainShell.HideLoading();
//ThirdAddon.LogicShell.ShowView(vmLocator.AppointmentDetailPage);
return false;
if (findResult?.Count > 0)
{
Handlers.GetHandler<AppointmentDetailPageHandler>()?.ShowDetail(findResult);
}
return findResult?.Count > 0;
}
private async Task<bool> HistoryAuthSuccess(AuthenticationMode mode, object data)
{
MainShell.ShowLoading("正在查找");
await Task.Delay(2000);
MainShell.ShowPrompt($"查找完成");
MainShell.HideLoading();
//ThirdAddon.LogicShell.ShowView(vmLocator.AppointmentDetailPage);
return false;
if (data == null) { MainShell.ShowPrompt($"读取数据异常,正在重试"); return false; }
if (mode == AuthenticationMode.Face)
{
Handlers.GetHandler<HistoryMenuPageHandler>()?.ShowView(data.ToString());
}
else if (mode == AuthenticationMode.IdCard)
{
Handlers.GetHandler<HistoryMenuPageHandler>()?.ShowView(((dynamic)data).idnum);
}
return true;
}
}
}
......@@ -108,11 +108,17 @@
<Compile Include="Core\AppointmentDetailPageHandler.cs" />
<Compile Include="Core\AuthenticationPageHandler.cs" />
<Compile Include="Core\Corebase.cs" />
<Compile Include="Core\FeatureCompareHandler.cs" />
<Compile Include="Core\HistoryAppointmentPageHandler.cs" />
<Compile Include="Core\HistoryMenuPageHandler.cs" />
<Compile Include="Core\HistoryVisitPageHandler.cs" />
<Compile Include="Core\MenuPageHandler.cs" />
<Compile Include="Core\MenuPageHandler.FindAppointment.cs" />
<Compile Include="Handlers.cs" />
<Compile Include="LocalSetting.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Remote\Models\Appointment.cs" />
<Compile Include="Remote\WebApi.cs" />
<Compile Include="ThirdAddon\DeviceManager.cs" />
<Compile Include="ThirdAddon\FaceRecognization.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GS.Terminal.VisitorSelfService.Logic.Remote.Models
{
public class Appointment
{
public Guid id { get; set; }
public string photo { get; set; }
public string visitorName { get; set; }
public string visitorIdNum { get; set; }
public string visitorPhone { get; set; }
public DateTime startDate { get; set; }
public DateTime endDate { get; set; }
public string visitArea { get; set; }
public int numberOfPeople { get; set; }
public string visitPerson { get; set; }
public List<AppointmentExtendInfo> extendInfo { get; set; }
}
public class AppointmentExtendInfo
{
public string title { get; set; }
public string content { get; set; }
public string type { get; set; }
public string group { get; set; }
}
}
......@@ -24,6 +24,7 @@ namespace ViewModels
CheckRegistVM<Pages.HistoryVisitPage.ViewModel>();
CheckRegistVM<Pages.HistoryAppointmentPage.ViewModel>();
CheckRegistVM<Pages.HistoryMenuPage.ViewModel>();
CheckRegistVM<PopWindows.FeatureCompare.ViewModel>();
}
private void CheckRegistVM<T>() where T : class
......@@ -92,5 +93,13 @@ namespace ViewModels
return SimpleIoc.Default.GetInstance<Pages.HistoryMenuPage.ViewModel>();
}
}
public PopWindows.FeatureCompare.ViewModel FeatureCompare
{
get
{
return SimpleIoc.Default.GetInstance<PopWindows.FeatureCompare.ViewModel>();
}
}
}
}
......@@ -14,12 +14,55 @@ namespace ViewModels.Pages.AppointmentDetailPage
{
public string ViewID => "06d0ebdb-2518-4dc7-bc17-5b3fc5012af4";
public List<AppointmentItem> Datas { get; set; }
private AppointmentItem _Appointment;
public AppointmentItem Appointment
{
get { return _Appointment; }
set { _Appointment = value; RaisePropertyChanged("Appointment"); }
set
{
_Appointment = value;
RaisePropertyChanged("Appointment");
RaisePropertyChanged(nameof(ShowLeftBtn));
RaisePropertyChanged(nameof(ShowRightBtn));
ShowExtendInfo = Visibility.Collapsed;
}
}
private Visibility ShowLeftBtn
{
get
{
if (Appointment != null)
{
if (Datas.Count > 0)
{
var i = Datas.IndexOf(Appointment);
if (i > 0)
return Visibility.Visible;
}
}
return Visibility.Collapsed;
}
}
private Visibility ShowRightBtn
{
get
{
if (Appointment != null)
{
if (Datas.Count > 0)
{
var i = Datas.IndexOf(Appointment);
if (i < Datas.Count - 1)
return Visibility.Visible;
}
}
return Visibility.Collapsed;
}
}
private Visibility _ShowExtendInfo = Visibility.Collapsed;
......@@ -31,7 +74,6 @@ namespace ViewModels.Pages.AppointmentDetailPage
}
public RelayCommand ShowExtendInfoCommand => new RelayCommand(() =>
{
ShowExtendInfo = Visibility.Visible;
......@@ -42,9 +84,34 @@ namespace ViewModels.Pages.AppointmentDetailPage
ShowExtendInfo = Visibility.Collapsed;
});
public void Reset()
public RelayCommand<string> ChangeShowAppointmentCommand => new RelayCommand<string>(tag =>
{
if (tag == "left")
{
Appointment = Datas[Datas.IndexOf(Appointment) - 1];
}
else if (tag == "right")
{
Appointment = Datas[Datas.IndexOf(Appointment) + 1];
}
});
public event Action OnExitClick;
public RelayCommand ExitCommand => new RelayCommand(() =>
{
OnExitClick?.Invoke();
});
public event Action<AppointmentItem> OnSubmitClick;
public RelayCommand<AppointmentItem> SubmitCommand => new RelayCommand<AppointmentItem>(info =>
{
OnSubmitClick?.Invoke(info);
});
public void Reset()
{
Datas = new List<AppointmentItem>();
Appointment = null;
}
}
......@@ -73,6 +140,6 @@ namespace ViewModels.Pages.AppointmentDetailPage
{
public string title { get; set; }
public string content { get; set; }
public int infotype { get; set; }
public string infotype { get; set; }
}
}
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
......@@ -11,10 +12,24 @@ namespace ViewModels.Pages.HistoryMenuPage
public class ViewModel : ViewModelBase, IViewModel
{
public string ViewID => "55495e4c-1f57-4f9d-a4e9-cc19fdbd1e1a";
public event Action OnExitClick;
public RelayCommand ExitCommand => new RelayCommand(() =>
{
OnExitClick?.Invoke();
});
public event Action OnAppointmentClick;
public RelayCommand AppointmentCommand => new RelayCommand(() =>
{
OnAppointmentClick?.Invoke();
});
public event Action OnVisitInfoClick;
public RelayCommand VisitInfoCommand => new RelayCommand(() =>
{
OnVisitInfoClick?.Invoke();
});
public void Reset()
{
}
}
}
using GalaSoft.MvvmLight;
using GS.Terminal.LogicShell.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewModels.PopWindows.FeatureCompare
{
public class ViewModel : ViewModelBase, IViewModel, IPopWindowBehavior
{
public string ViewID => "2ee6db65-26f4-4783-8be3-62e7de5b3914";
public void Closed()
{
}
public void Opened()
{
}
public void Reset()
{
}
}
}
......@@ -72,13 +72,12 @@
<Compile Include="Pages\HistoryMenuPage\ViewModel.cs" />
<Compile Include="Pages\HistoryVisitPage\ViewModel.cs" />
<Compile Include="Pages\MenuPage\ViewModel.cs" />
<Compile Include="PopWindows\FeatureCompare\ViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="PopWindows\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
......@@ -29,6 +29,8 @@
<ColumnDefinition Width="330"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<gs:ImageButtonFix Command="{Binding ChangeShowAppointmentCommand}" CommandParameter="left" Visibility="{Binding ShowLeftBtn}" Width="60" Height="150" Image="/Views;component/Resources/detail_left.png" />
<gs:ImageButtonFix Command="{Binding ChangeShowAppointmentCommand}" CommandParameter="right" Visibility="{Binding ShowRightBtn}" Grid.Column="2" Width="60" Height="150" Image="/Views;component/Resources/detail_right.png" />
<Border Grid.Column="1" CornerRadius="5"
Padding="31,31,31,0" BorderThickness="4" BorderBrush="#e5e4e6">
<StackPanel>
......@@ -108,8 +110,16 @@
<!--按钮-->
<StackPanel Grid.Row="2">
<gs:ImageButtonFix Width="1010" Height="230" Image="/Views;component/Resources/detail_submit.png"/>
<gs:ImageButtonFix Width="1010" Height="190" Image="/Views;component/Resources/detail_cancel.png"/>
<gs:ImageButtonFix Command="{Binding ExitCommand}" Width="1010" Height="190" Image="/Views;component/Resources/detail_cancel.png"/>
</StackPanel>
</Grid>
<!--附加信息-->
<Grid Background="Transparent" Grid.RowSpan="3">
<Border Width="920" Height="1630" BorderThickness="6"
CornerRadius="10"
Background="#ffffff" BorderBrush="#f1f1f1">
</Border>
</Grid>
</Grid>
</Page>
......@@ -25,7 +25,7 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button>
<Button Command="{Binding VisitInfoCommand}">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid>
......@@ -39,7 +39,7 @@
</ControlTemplate>
</Button.Template>
</Button>
<Button Grid.Column="1">
<Button Grid.Column="1" Command="{Binding AppointmentCommand}">
<Button.Template>
<ControlTemplate TargetType="Button">
<Grid>
......@@ -62,7 +62,9 @@
<Run FontSize="36" FontWeight="Black" Text="历史到访记录"/>
<Run FontSize="30" Text=" 包含所有自助或非自助登记的到访记 录,您也可以在这里重新采集您的照片"/>
</TextBlock>
<Button Template="{StaticResource CommonButton}" Margin="0,300,0,0" FontSize="24" Content="退出" Width="250" Height="60"/>
<Button Template="{StaticResource CommonButton}"
Command="{Binding ExitCommand}"
Margin="0,300,0,0" FontSize="24" Content="退出" Width="250" Height="60"/>
</StackPanel>
</Border>
</Grid>
......
<Page x:Class="Views.PopWindows.FeatureCompare.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"
mc:Ignorable="d"
d:DesignHeight="1920" d:DesignWidth="1080"
Title="Index">
<Grid>
</Grid>
</Page>
using GS.Terminal.LogicShell.Attributes;
using GS.Terminal.LogicShell.Interface;
using GS.Unitive.Framework.Security.Core;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Views.PopWindows.FeatureCompare
{
/// <summary>
/// Index.xaml 的交互逻辑
/// </summary>
[Export(typeof(IView))]
[PopWindow(1080, 1920)]
[UnitiveView("验证特征值", "", "2ee6db65-26f4-4783-8be3-62e7de5b3914", null)]
public partial class Index : Page, IView
{
public Index()
{
InitializeComponent();
}
public void BindDataContext(IViewModel vm)
{
DataContext = vm;
}
public object Clone()
{
throw new NotImplementedException();
}
public void GoBack()
{
throw new NotImplementedException();
}
public void GoForward()
{
throw new NotImplementedException();
}
public void NavigateToContent(object content)
{
throw new NotImplementedException();
}
public void Reset()
{
throw new NotImplementedException();
}
}
}
<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">
</ResourceDictionary>
\ No newline at end of file
......@@ -85,6 +85,9 @@
<Compile Include="Pages\MenuPage\Index.xaml.cs">
<DependentUpon>Index.xaml</DependentUpon>
</Compile>
<Compile Include="PopWindows\FeatureCompare\Index.xaml.cs">
<DependentUpon>Index.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
......@@ -149,14 +152,20 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PopWindows\FeatureCompare\Index.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="PopWindows\FeatureCompare\Style.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resources\CommonDictionary.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="PopWindows\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="Resources\menu_btn_has.png" />
<Resource Include="Resources\menu_btn_no.png" />
......@@ -181,5 +190,9 @@
<Resource Include="Resources\auth_mode_current_idcard.png" />
<Resource Include="Resources\auth_mode_current_qrcode.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\detail_left.png" />
<Resource Include="Resources\detail_right.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ 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