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
cccd6a16
Commit
cccd6a16
authored
Aug 04, 2020
by
姜春辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成历史预约单页面
parent
47b76129
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
288 additions
and
39 deletions
+288
-39
Config.xml
...ice/Logic/GS.Terminal.VisitorSelfService.Logic/Config.xml
+1
-0
HistoryAppointmentPageHandler.cs
...orSelfService.Logic/Core/HistoryAppointmentPageHandler.cs
+92
-1
HistoryVisitPageHandler.cs
....VisitorSelfService.Logic/Core/HistoryVisitPageHandler.cs
+1
-1
GS.Terminal.VisitorSelfService.Logic.csproj
...Service.Logic/GS.Terminal.VisitorSelfService.Logic.csproj
+1
-0
HistoryAppointment.cs
...itorSelfService.Logic/Remote/Models/HistoryAppointment.cs
+22
-0
ViewModel.cs
...View/ViewModels/Pages/HistoryAppointmentPage/ViewModel.cs
+57
-2
Index.xaml
...ewModelView/Views/Pages/HistoryAppointmentPage/Index.xaml
+114
-35
No files found.
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Config.xml
View file @
cccd6a16
...
...
@@ -17,6 +17,7 @@
<Data
Description=
"获取人员有效预约单"
Key=
"VisitorAvailableAppointment"
ServiceUri=
"/api/GS.Sub.Vistor/VisitorSelfServiceTerminal/VisitorAvailableAppointment"
/>
<Data
Description=
"提交预约单到访"
Key=
"SubmitVisitInfo"
ServiceUri=
"/api/GS.Sub.Vistor/VisitorSelfServiceTerminal/SubmitVisitInfo"
/>
<Data
Description=
"获取历史来访记录"
Key=
"GetHistoryVisitInfo"
ServiceUri=
"/api/GS.Sub.Vistor/VisitorSelfServiceTerminal/GetHistoryVisitInfo/{idnum}"
/>
<Data
Description=
"获取历史预约单"
Key=
"GetHistoryAppointment"
ServiceUri=
"/api/GS.Sub.Vistor/VisitorSelfServiceTerminal/GetHistoryAppointment/{idnum}"
/>
</Datas>
</Structure>
</Structures>
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/HistoryAppointmentPageHandler.cs
View file @
cccd6a16
using
GS.Terminal.LogicShell.Interface
;
using
GalaSoft.MvvmLight.Threading
;
using
GS.Terminal.LogicShell.Interface
;
using
GS.Terminal.VisitorSelfService.Logic.Remote
;
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
;
namespace
GS.Terminal.VisitorSelfService.Logic.Core
{
...
...
@@ -11,9 +16,95 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{
private
IViewModel
_BackView
;
private
string
_idnum
;
private
int
_currentpage
=
0
;
private
const
int
PAGESIZE
=
5
;
public
override
void
Init
()
{
VM
.
OnBackClick
+=
VM_OnBackClick
;
VM
.
OnNavigateInto
+=
VM_OnNavigateInto
;
VM
.
OnNavigateOut
+=
VM_OnNavigateOut
;
VM
.
OnMoreClick
+=
VM_OnMoreClick
;
}
private
void
VM_OnMoreClick
()
{
_currentpage
++;
MainShell
.
ShowLoading
(
"加载中..."
);
search
().
ContinueWith
(
task
=>
{
MainShell
.
HideLoading
();
if
(!
task
.
Result
)
_currentpage
--;
});
}
private
void
VM_OnNavigateOut
(
IViewModel
obj
)
{
VM
.
Datas
=
new
System
.
Collections
.
ObjectModel
.
ObservableCollection
<
ViewModels
.
Pages
.
HistoryAppointmentPage
.
HistoryAppointmentItem
>();
_idnum
=
""
;
_BackView
=
null
;
}
private
void
VM_OnNavigateInto
(
IViewModel
obj
)
{
Handlers
.
GetHandler
<
HeadHandler
>().
Start
();
_currentpage
=
0
;
VM_OnMoreClick
();
}
private
void
VM_OnBackClick
()
{
ThirdAddon
.
LogicShell
.
ShowView
(
_BackView
??
vmLocator
.
HistoryMenuPage
);
}
private
async
Task
<
bool
>
search
()
{
var
serviceUri
=
LocalSetting
.
ServiceList
.
GetSerivceUri
(
"GetHistoryAppointment"
);
serviceUri
=
serviceUri
.
Replace
(
"{idnum}"
,
_idnum
);
var
response
=
await
WebApi
.
PostAsync
<
WebApiPagingResponseBody
<
HistoryAppointment
>>(
serviceUri
,
new
{
paging
=
new
{
currentIndex
=
_currentpage
,
pageSize
=
PAGESIZE
}
});
if
(
response
!=
null
)
{
if
(
response
.
Status
)
{
if
(
response
.
paging
!=
null
)
//如果服务端没有返回分页信息,那就通过返回的记录数判断是否是最后一页
{
VM
.
IsLastPage
=
response
.
paging
.
currentIndex
==
response
.
paging
.
totalPage
;
}
else
{
VM
.
IsLastPage
=
!(
response
.
records
!=
null
&&
response
.
records
.
Count
==
0
);
}
foreach
(
var
item
in
response
.
records
??
new
List
<
HistoryAppointment
>())
{
DispatcherHelper
.
CheckBeginInvokeOnUI
(()
=>
{
VM
.
Datas
.
Add
(
new
ViewModels
.
Pages
.
HistoryAppointmentPage
.
HistoryAppointmentItem
{
Id
=
item
.
id
,
VisitorIdNum
=
item
.
visitorIdNum
,
VisitorName
=
item
.
visitorName
,
VisitPerson
=
item
.
visitPerson
,
Phone
=
item
.
visitorPhone
,
Status
=
item
.
status
,
StartDate
=
item
.
startDate
,
EndDate
=
item
.
endDate
,
Photo
=
Tools
.
ProductPhotoUrl
(
item
.
photo
)
});
});
}
return
true
;
}
}
ThirdAddon
.
MainShell
.
ShowPrompt
(
"通讯异常."
);
return
false
;
}
public
void
ShowView
(
string
idnum
,
IViewModel
backview
=
null
)
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Core/HistoryVisitPageHandler.cs
View file @
cccd6a16
...
...
@@ -15,7 +15,7 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
{
public
string
_IDNum
;
private
IViewModel
_backview
;
private
int
_currentpage
=
1
;
private
int
_currentpage
=
0
;
private
const
int
PAGESIZE
=
5
;
public
override
void
Init
()
{
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/GS.Terminal.VisitorSelfService.Logic.csproj
View file @
cccd6a16
...
...
@@ -122,6 +122,7 @@
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Remote\Models\Appointment.cs"
/>
<Compile
Include=
"Remote\Models\HistoryAppointment.cs"
/>
<Compile
Include=
"Remote\Models\HistoryVisitInfo.cs"
/>
<Compile
Include=
"Remote\Models\WebApiCollectionResponseBody.cs"
/>
<Compile
Include=
"Remote\Models\WebApiPagingResponseBody.cs"
/>
...
...
Src/GS.Terminal.VisitorSelfService/Logic/GS.Terminal.VisitorSelfService.Logic/Remote/Models/HistoryAppointment.cs
0 → 100644
View file @
cccd6a16
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
HistoryAppointment
{
public
int
id
{
get
;
set
;
}
public
string
photo
{
get
;
set
;
}
public
string
visitorName
{
get
;
set
;
}
public
string
visitorIdNum
{
get
;
set
;
}
public
string
visitorPhone
{
get
;
set
;
}
public
string
visitPerson
{
get
;
set
;
}
public
DateTime
visitTime
{
get
;
set
;
}
public
DateTime
startDate
{
get
;
set
;
}
public
DateTime
endDate
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
}
}
Src/GS.Terminal.VisitorSelfService/ViewModelView/ViewModels/Pages/HistoryAppointmentPage/ViewModel.cs
View file @
cccd6a16
using
GalaSoft.MvvmLight
;
using
GalaSoft.MvvmLight.Command
;
using
GS.Terminal.LogicShell.Interface
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
...
...
@@ -9,13 +11,66 @@ using System.Threading.Tasks;
namespace
ViewModels.Pages.HistoryAppointmentPage
{
public
partial
class
ViewModel
:
ViewModelBase
,
IViewModel
public
partial
class
ViewModel
:
ViewModelBase
,
IViewModel
,
IViewModelBehavior
{
public
string
ViewID
=>
"d686b0af-2936-4f96-b965-0e0fd54d5b43"
;
public
event
Action
<
IViewModel
>
OnNavigateInto
;
public
void
NavigateInto
(
IViewModel
from
)
{
OnNavigateInto
?.
Invoke
(
from
);
}
public
event
Action
<
IViewModel
>
OnNavigateOut
;
public
void
NavigateOut
(
IViewModel
to
)
{
OnNavigateOut
?.
Invoke
(
to
);
}
public
event
Action
OnBackClick
;
public
RelayCommand
BackCommand
=>
new
RelayCommand
(()
=>
{
OnBackClick
?.
Invoke
();
});
public
event
Action
OnMoreClick
;
public
RelayCommand
MoreCommand
=>
new
RelayCommand
(()
=>
{
OnMoreClick
?.
Invoke
();
});
private
ObservableCollection
<
HistoryAppointmentItem
>
_Datas
;
public
ObservableCollection
<
HistoryAppointmentItem
>
Datas
{
get
{
return
_Datas
??
(
_Datas
=
new
ObservableCollection
<
HistoryAppointmentItem
>());
}
set
{
_Datas
=
value
;
RaisePropertyChanged
(
"Datas"
);
}
}
private
bool
_IsLastPage
;
public
bool
IsLastPage
{
get
{
return
_IsLastPage
;
}
set
{
_IsLastPage
=
value
;
RaisePropertyChanged
(
"IsLastPage"
);
}
}
public
void
Reset
()
{
}
}
public
class
HistoryAppointmentItem
{
public
int
Id
{
get
;
set
;
}
public
string
VisitorName
{
get
;
set
;
}
public
string
VisitorIdNum
{
get
;
set
;
}
public
string
Phone
{
get
;
set
;
}
public
string
Photo
{
get
;
set
;
}
public
string
VisitPerson
{
get
;
set
;
}
public
DateTime
StartDate
{
get
;
set
;
}
public
DateTime
EndDate
{
get
;
set
;
}
public
int
Status
{
get
;
set
;
}
}
}
Src/GS.Terminal.VisitorSelfService/ViewModelView/Views/Pages/HistoryAppointmentPage/Index.xaml
View file @
cccd6a16
This diff is collapsed.
Click to expand it.
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