app.component.ts 4.4 KB

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