Commit 02f2e21f authored by van.chen's avatar van.chen

Merge branch 'push-dev' into 'master'

Push dev

See merge request !3
parents 5e491365 f8f7580d
...@@ -31,8 +31,8 @@ export class AppComponent { ...@@ -31,8 +31,8 @@ export class AppComponent {
initializeApp() { initializeApp() {
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.statusBar.styleDefault(); this.statusBar.styleLightContent();
this.statusBar.backgroundColorByHexString('#6B7072'); this.statusBar.backgroundColorByHexString('#000000');
this.statusBar.show(); this.statusBar.show();
this.statusBar.overlaysWebView(false); this.statusBar.overlaysWebView(false);
this.splashScreen.hide(); this.splashScreen.hide();
...@@ -69,7 +69,6 @@ export class AppComponent { ...@@ -69,7 +69,6 @@ export class AppComponent {
this.appMinimize.minimize(); this.appMinimize.minimize();
this.backBtnPressed = false; this.backBtnPressed = false;
window.history.pushState('forward', null, this.url); window.history.pushState('forward', null, this.url);
// window.history.forward();
return; return;
} else { } else {
this.backBtnPressed = true; this.backBtnPressed = true;
......
...@@ -4,7 +4,7 @@ import 'web-animations-js/web-animations.min'; ...@@ -4,7 +4,7 @@ import 'web-animations-js/web-animations.min';
import { toLeft } from '../animations/toLeftAndBack'; import { toLeft } from '../animations/toLeftAndBack';
import { toRight } from '../animations/toRightAndBack'; import { toRight } from '../animations/toRightAndBack';
import { fadeIn } from '../animations/fade-in'; import { fadeIn } from '../animations/fade-in';
import { Router, ActivatedRoute } from '@angular/router'; import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
...@@ -14,6 +14,10 @@ import { Router, ActivatedRoute } from '@angular/router'; ...@@ -14,6 +14,10 @@ import { Router, ActivatedRoute } from '@angular/router';
}) })
export class HomePage implements OnInit { export class HomePage implements OnInit {
@ViewChild(IonSlides) slides; @ViewChild(IonSlides) slides;
@ViewChild('page_one') page_one;
@ViewChild('page_two') page_two;
@ViewChild('page_three') page_three;
@ViewChild('page_four') page_four;
options = { options = {
speed: 1000, speed: 1000,
allowTouchMove: false allowTouchMove: false
...@@ -45,6 +49,13 @@ export class HomePage implements OnInit { ...@@ -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() { slideOnChange() {
this.slides.getActiveIndex().then((index) => { this.slides.getActiveIndex().then((index) => {
this.changeIndex(index); this.changeIndex(index);
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ApiService } from '../../service/api.service'; import {ApiService} from '../../service/api.service';
import { TransferService } from '../../service/transfer.service'; import {TransferService} from '../../service/transfer.service';
@Component({ @Component({
selector: 'app-page-four', selector: 'app-page-four',
templateUrl: './page-four.component.html', templateUrl: './page-four.component.html',
styleUrls: ['./page-four.component.scss'], styleUrls: ['./page-four.component.scss'],
}) })
export class PageFourComponent implements OnInit { export class PageFourComponent implements OnInit {
user: any = {}; user: any = {};
constructor(private api: ApiService, private tf: TransferService) { }
ngOnInit() { constructor(private api: ApiService, private tf: TransferService) {
this.getSelfInfo(); }
}
getSelfInfo() { ngOnInit() {
this.api.user.getSelfInfo(['', (data) => { this.getSelfInfo();
if (data) { }
this.user = data;
} else {
this.api.presentMsgToast(data && data.message ? data.message : '登录失败');
}
}]);
}
loginOut() { getSelfInfo() {
this.api.login.logout(['', (data) => { this.api.user.getSelfInfo(['', (data) => {
if (data) { if (data) {
window.localStorage.removeItem('token'); this.user = data;
this.tf.transfer({ } else {
to: 'app-extra', this.api.presentMsgToast(data && data.message ? data.message : '登录失败');
from: 'app-home', }
url: '/extra', }]);
hash: '', }
query: ''
}); loginOut() {
} else { this.api.login.logout(['', (data) => {
this.api.presentMsgToast(data && data.message ? data.message : '登录失败'); 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 : '登录失败');
}
}]);
}
} }
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