Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
appPasture
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WitCloud
appPasture
Commits
02f2e21f
Commit
02f2e21f
authored
Apr 04, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'push-dev' into 'master'
Push dev See merge request
!3
parents
5e491365
f8f7580d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
39 deletions
+51
-39
app.component.ts
src/app/app.component.ts
+2
-3
home.page.ts
src/app/home/home.page.ts
+12
-1
page-four.component.ts
src/app/main/page-four/page-four.component.ts
+37
-35
No files found.
src/app/app.component.ts
View file @
02f2e21f
...
...
@@ -31,8 +31,8 @@ export class AppComponent {
initializeApp
()
{
this
.
platform
.
ready
().
then
(()
=>
{
this
.
statusBar
.
style
Defaul
t
();
this
.
statusBar
.
backgroundColorByHexString
(
'#
6B7072
'
);
this
.
statusBar
.
style
LightConten
t
();
this
.
statusBar
.
backgroundColorByHexString
(
'#
000000
'
);
this
.
statusBar
.
show
();
this
.
statusBar
.
overlaysWebView
(
false
);
this
.
splashScreen
.
hide
();
...
...
@@ -69,7 +69,6 @@ export class AppComponent {
this
.
appMinimize
.
minimize
();
this
.
backBtnPressed
=
false
;
window
.
history
.
pushState
(
'forward'
,
null
,
this
.
url
);
// window.history.forward();
return
;
}
else
{
this
.
backBtnPressed
=
true
;
...
...
src/app/home/home.page.ts
View file @
02f2e21f
...
...
@@ -4,7 +4,7 @@ import 'web-animations-js/web-animations.min';
import
{
toLeft
}
from
'../animations/toLeftAndBack'
;
import
{
toRight
}
from
'../animations/toRightAndBack'
;
import
{
fadeIn
}
from
'../animations/fade-in'
;
import
{
Router
,
ActivatedRoute
}
from
'@angular/router'
;
import
{
Router
}
from
'@angular/router'
;
@
Component
({
selector
:
'app-home'
,
...
...
@@ -14,6 +14,10 @@ import { Router, ActivatedRoute } from '@angular/router';
})
export
class
HomePage
implements
OnInit
{
@
ViewChild
(
IonSlides
)
slides
;
@
ViewChild
(
'page_one'
)
page_one
;
@
ViewChild
(
'page_two'
)
page_two
;
@
ViewChild
(
'page_three'
)
page_three
;
@
ViewChild
(
'page_four'
)
page_four
;
options
=
{
speed
:
1000
,
allowTouchMove
:
false
...
...
@@ -45,6 +49,13 @@ export class HomePage implements OnInit {
});
}
ionViewWillEnter
()
{
this
.
page_one
.
ngOnInit
();
this
.
page_two
.
ngOnInit
();
this
.
page_three
.
ngOnInit
();
this
.
page_four
.
ngOnInit
();
}
slideOnChange
()
{
this
.
slides
.
getActiveIndex
().
then
((
index
)
=>
{
this
.
changeIndex
(
index
);
...
...
src/app/main/page-four/page-four.component.ts
View file @
02f2e21f
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ApiService
}
from
'../../service/api.service'
;
import
{
TransferService
}
from
'../../service/transfer.service'
;
import
{
ApiService
}
from
'../../service/api.service'
;
import
{
TransferService
}
from
'../../service/transfer.service'
;
@
Component
({
selector
:
'app-page-four'
,
templateUrl
:
'./page-four.component.html'
,
styleUrls
:
[
'./page-four.component.scss'
],
selector
:
'app-page-four'
,
templateUrl
:
'./page-four.component.html'
,
styleUrls
:
[
'./page-four.component.scss'
],
})
export
class
PageFourComponent
implements
OnInit
{
user
:
any
=
{};
constructor
(
private
api
:
ApiService
,
private
tf
:
TransferService
)
{
}
user
:
any
=
{};
ngOnInit
()
{
this
.
getSelfInfo
();
}
constructor
(
private
api
:
ApiService
,
private
tf
:
TransferService
)
{
}
getSelfInfo
()
{
this
.
api
.
user
.
getSelfInfo
([
''
,
(
data
)
=>
{
if
(
data
)
{
this
.
user
=
data
;
}
else
{
this
.
api
.
presentMsgToast
(
data
&&
data
.
message
?
data
.
message
:
'登录失败'
);
}
}]);
}
ngOnInit
()
{
this
.
getSelfInfo
();
}
loginOut
()
{
this
.
api
.
login
.
logout
([
''
,
(
data
)
=>
{
if
(
data
)
{
window
.
localStorage
.
removeItem
(
'token'
);
this
.
tf
.
transfer
({
to
:
'app-extra'
,
from
:
'app-home'
,
url
:
'/extra'
,
hash
:
''
,
query
:
''
});
}
else
{
this
.
api
.
presentMsgToast
(
data
&&
data
.
message
?
data
.
message
:
'登录失败'
);
}
}]);
}
getSelfInfo
()
{
this
.
api
.
user
.
getSelfInfo
([
''
,
(
data
)
=>
{
if
(
data
)
{
this
.
user
=
data
;
}
else
{
this
.
api
.
presentMsgToast
(
data
&&
data
.
message
?
data
.
message
:
'登录失败'
);
}
}]);
}
loginOut
()
{
this
.
api
.
login
.
logout
([
''
,
(
data
)
=>
{
if
(
data
)
{
window
.
localStorage
.
removeItem
(
'token'
);
this
.
tf
.
transfer
({
to
:
'app-extra'
,
from
:
'app-home'
,
url
:
'/extra'
,
hash
:
''
,
query
:
''
});
}
else
{
this
.
api
.
presentMsgToast
(
data
&&
data
.
message
?
data
.
message
:
'登录失败'
);
}
}]);
}
}
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