Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import {Component, Renderer, ElementRef, ViewChild} from '@angular/core';
import {NavParams, NavController, AlertController, Events, Tabs, Platform} from 'ionic-angular';
import {ContactPage} from './contact/contact';
import {HomePage} from './home/home';
import {MinePage} from './mine/mine';
import {Storage} from '@ionic/storage';
import {AppService, AppGlobal} from '../../service/http.service';
import {NoticePage} from "./notice/notice";
import {BackButtonService} from "../../provide/backButton.service";
import {ServePage} from "./serve/serve";
import {DiscoverPage} from "./discover/discover";
@Component({
templateUrl: 'tabs.html'
})
export class TabsPage {
@ViewChild('myTabs') myTabs: Tabs;
tabRoots: Object[];
userInfo: any;
userid: string;
roleflag: any;
tabsIndex;
role: any;
constructor(
public navCtrl: NavController,
public navParams: NavParams,
public alertCtrl: AlertController,
public storage: Storage,
public event: Events,
public render: Renderer,
public elementRef: ElementRef,
public appService: AppService,
private backButtonService: BackButtonService,
public platform: Platform,
) {
this.tabRoots = [{
root: HomePage,
tabTitle: '首页',
tabIconOn: 'custom-home-on',
tabIconOff: 'custom-home-off',
index: 0
}, {
root: DiscoverPage,
tabTitle: '发现',
tabIconOn: 'custom-discover-on',
tabIconOff: 'custom-discover-off',
index: 1
}, {
root: ServePage,
tabTitle: '服务',
tabIconOn: 'custom-serve-on',
tabIconOff: 'custom-serve-off',
index: 2
}, {
root: MinePage,
tabTitle: '我的',
tabIconOn: 'custom-mine-on',
tabIconOff: 'custom-mine-off',
index: 3
}];
this.platform.ready().then(() => {
this.backButtonService.registerBackButtonAction(this.myTabs);
});
}
onChange(e) {
this.tabsIndex = e;
this.myTabs.select(e);
}
}