Newer
Older
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;
key = {
root: KeyPage,
tabTitle: '一键通',
tabIconOn: '',
tabIconOff: '',
index: 2
};
serve = {
root: ServePage,
tabTitle: '服务',
tabIconOn: 'custom-serve-on',
tabIconOff: 'custom-serve-off',
root: MinePage,
tabTitle: '我的',
tabIconOn: 'custom-mine-on',
tabIconOff: 'custom-mine-off',
constructor(
public navCtrl: NavController,
public navParams: NavParams,
public alertCtrl: AlertController,
public storage: Storage,
public event: Events,
public render: Renderer,
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
},];
this.tabSer.getUserIntegral().subscribe(
(res) => {
const mineInfo = res.data;
if (mineInfo.orgName != "退休人员") {
this.tabRoots.push(this.key,this.serve, this.mine);
} else {