Compare commits

..

No commits in common. "3c2976437d7e2e0016409c8f256a040878fa19b2" and "277ad1d88a57265dedae48a611a1ea844364e03e" have entirely different histories.

11 changed files with 51 additions and 182 deletions

View File

@ -33,15 +33,10 @@ const routes: Routes = [
{ {
path: 'tabs-user', path: 'tabs-user',
loadChildren: () => import('./tabs-user/tabs-user.module').then( m => m.TabsUserPageModule) loadChildren: () => import('./tabs-user/tabs-user.module').then( m => m.TabsUserPageModule)
}, }, {
{
path: 'feed', path: 'feed',
loadChildren: () => import('./feed/feed.module').then( m => m.FeedPageModule) loadChildren: () => import('./feed/feed.module').then( m => m.FeedPageModule)
}, },
{
path: 'view-evento-cliente',
loadChildren: () => import('./view-evento-cliente/view-evento-cliente.module').then( m => m.ViewEventoClientePageModule)
},

View File

@ -18,6 +18,7 @@
{{evento.fecha}} · {{evento.fecha}} ·
<ion-icon name="cash-outline"></ion-icon> <ion-icon name="cash-outline"></ion-icon>
{{evento.precio1}},{{evento.precio2}} {{evento.precio1}},{{evento.precio2}}
<ion-button (click)="editarEvento(evento);$event.stopPropagation();"><ion-icon name="pencil-outline"></ion-icon></ion-button>
</div> </div>
<div class="eventoDesc"> <div class="eventoDesc">
{{evento.descripcion}} {{evento.descripcion}}

View File

@ -1,8 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Eventoi } from '../interfaces/eventoi'; import { Eventoi } from '../interfaces/eventoi';
import { FeedService } from '../services/feed.service'; import { FeedService } from '../services/feed.service';
import { Tab1Service } from '../tab1/tab1.service';
@Component({ @Component({
selector: 'app-feed', selector: 'app-feed',
@ -13,15 +11,10 @@ export class FeedPage implements OnInit {
eventos: Eventoi[]; eventos: Eventoi[];
constructor(private feedService:FeedService, private tab1Service: Tab1Service, private router:Router ) { } constructor(private feedService:FeedService) { }
ngOnInit() { ngOnInit() {
this.eventos = this.feedService.eventos; this.eventos = this.feedService.eventos;
} }
mostrarEvento(evento: Eventoi){
this.feedService.eventoIndex = this.eventos.indexOf(evento);
this.router.navigate(['/tabsUser/tab2/view-evento-cliente']);
}
} }

View File

@ -9,7 +9,6 @@ import { ApiService } from './api.service';
export class FeedService { export class FeedService {
eventos: Eventoi[]; eventos: Eventoi[];
eventoIndex: number;
constructor(private apiService: ApiService, private router: Router) { } constructor(private apiService: ApiService, private router: Router) { }
@ -20,10 +19,4 @@ export class FeedService {
this.router.navigate(['/tabsUser']) this.router.navigate(['/tabsUser'])
}) })
} }
getEventoByIndex(eventoIndex: number):Eventoi{
return this.eventos[eventoIndex];
}
} }

View File

@ -2,18 +2,11 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router'; import { RouterModule, Routes } from '@angular/router';
import { FeedPage } from '../feed/feed.page'; import { FeedPage } from '../feed/feed.page';
import { Tab2Page } from './tab2.page'; import { Tab2Page } from './tab2.page';
import { ViewEventoClientePage } from '../view-evento-cliente/view-evento-cliente.page';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
component: FeedPage, component: FeedPage,
},
{
path: 'view-evento-cliente',
component: ViewEventoClientePage
} }
]; ];

View File

@ -1,17 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ViewEventoClientePage } from './view-evento-cliente.page';
const routes: Routes = [
{
path: '',
component: ViewEventoClientePage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ViewEventoClientePageRoutingModule {}

View File

@ -1,20 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ViewEventoClientePageRoutingModule } from './view-evento-cliente-routing.module';
import { ViewEventoClientePage } from './view-evento-cliente.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ViewEventoClientePageRoutingModule
],
declarations: [ViewEventoClientePage]
})
export class ViewEventoClientePageModule {}

View File

@ -1,26 +0,0 @@
<ion-header>
<ion-toolbar>
<ion-title>ViewEvento</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-grid>
<div class="evento">
<ion-row>
<div class="eventoHeader">
{{evento.nombre}} ·
<ion-icon name="calendar-outline"></ion-icon>
{{evento.fecha}} ·
<ion-icon name="cash-outline"></ion-icon>
{{evento.precio1}},{{evento.precio2}}
</div>
</ion-row>
<ion-row>
<div class="eventoDesc">
{{evento.descripcion}}
</div>
</ion-row>
</div>
</ion-grid>
</ion-content>

View File

@ -1,24 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ViewEventoClientePage } from './view-evento-cliente.page';
describe('ViewEventoClientePage', () => {
let component: ViewEventoClientePage;
let fixture: ComponentFixture<ViewEventoClientePage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewEventoClientePage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ViewEventoClientePage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,19 +0,0 @@
import { Component, OnInit } from '@angular/core';
import { Eventoi } from '../interfaces/eventoi';
import { FeedService } from '../services/feed.service';
@Component({
selector: 'app-view-evento-cliente',
templateUrl: './view-evento-cliente.page.html',
styleUrls: ['./view-evento-cliente.page.scss'],
})
export class ViewEventoClientePage implements OnInit {
evento: Eventoi;
constructor(private feedService: FeedService) { }
ngOnInit() {
this.evento = this.feedService.getEventoByIndex(this.feedService.eventoIndex);
}
}