app.component.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import { Component, ViewChild } from '@angular/core';
  2. import { Nav, Platform } from 'ionic-angular';
  3. import { StatusBar } from 'ionic-native';
  4. import { LoginPage } from '../pages/login/login';
  5. import { HomePage } from '../pages/home/home';
  6. import { CustomerListPage } from '../pages/customer-list/customer-list';
  7. import { ProductListPage } from '../pages/product-list/product-list';
  8. import { LeadListPage } from '../pages/lead-list/lead-list';
  9. import { OpportunityListPage } from '../pages/opportunity-list/opportunity-list';
  10. import { CallListPage } from '../pages/call-list/call-list';
  11. import { ProjectListPage } from '../pages/project-list/project-list';
  12. import { TaskListPage } from '../pages/task-list/task-list';
  13. import { ToolsPage } from '../pages/tools/tools';
  14. import { SettingsPage } from '../pages/settings/settings';
  15. import { AboutPage } from '../pages/about/about';
  16. @Component({
  17. templateUrl: 'app.html'
  18. })
  19. export class MyApp {
  20. @ViewChild(Nav) nav: Nav;
  21. rootPage: any = LoginPage;
  22. homePage: any = HomePage;
  23. entries: Array<{ visible: boolean, title: string, pages: Array<{ visible: boolean, title: string, icon: string, component: any }> }>;
  24. constructor(public platform: Platform) {
  25. this.initializeApp();
  26. this.entries = [
  27. {
  28. visible: true,
  29. title: "Ventas",
  30. pages: [
  31. {
  32. visible: false,
  33. title: "Clientes",
  34. icon: "people",
  35. component: CustomerListPage
  36. },
  37. {
  38. visible: true,
  39. title: 'Productos',
  40. icon: "cube",
  41. component: ProductListPage
  42. },
  43. {
  44. visible: false,
  45. title: 'Iniciativas',
  46. icon: "bulb",
  47. component: LeadListPage
  48. },
  49. {
  50. visible: false,
  51. title: "Oportunidades",
  52. icon: "ribbon",
  53. component: OpportunityListPage
  54. },
  55. {
  56. visible: false,
  57. title: "Llamadas",
  58. icon: "call",
  59. component: CallListPage
  60. }
  61. ]
  62. },
  63. {
  64. visible: false,
  65. title: "Proyectos",
  66. pages: [
  67. {
  68. visible: true,
  69. title: "Proyectos",
  70. icon: "briefcase",
  71. component: ProjectListPage
  72. },
  73. {
  74. visible: true,
  75. title: "Tareas",
  76. icon: "calendar",
  77. component: TaskListPage
  78. }
  79. ]
  80. },
  81. {
  82. visible: true,
  83. title: "Herramientas",
  84. pages: [
  85. {
  86. visible: true,
  87. title: 'Herramientas',
  88. icon: "build",
  89. component: ToolsPage
  90. },
  91. {
  92. visible: false,
  93. title: "Preferencias",
  94. icon: "settings",
  95. component: SettingsPage
  96. },
  97. {
  98. visible: true,
  99. title: "Acerca",
  100. icon: "information-circle",
  101. component: AboutPage
  102. }
  103. ]
  104. }
  105. ];
  106. }
  107. initializeApp() {
  108. this.platform.ready().then(() => {
  109. // StatusBar.styleDefault();
  110. StatusBar.backgroundColorByHexString("#364499");
  111. });
  112. }
  113. // Open the page
  114. openPage(page): void {
  115. this.nav.setRoot(page.component);
  116. }
  117. }