From 594332fd87bf7a766219dd05e9ee30210cc6c74d Mon Sep 17 00:00:00 2001 From: onsaliyo Date: Tue, 2 Feb 2021 16:42:38 +0100 Subject: [PATCH] =?UTF-8?q?Permite=20a=C3=B1adir=20eventos=20a=20la=20disc?= =?UTF-8?q?oteca=20y=20navegar=20a=20una=20p=C3=A1gina=20de=20cada=20event?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app-routing.module.ts | 4 ++++ .../perfil-discoteca.page.html | 2 +- .../perfil-discoteca.page.scss | 7 +++---- .../perfil-discoteca/perfil-discoteca.page.ts | 5 +++++ src/app/prompt-evento/prompt-evento.page.ts | 3 --- src/app/tab1/tab1-routing.module.ts | 6 ++++++ src/app/tab1/tab1.service.ts | 6 ++++++ .../view-evento/view-evento-routing.module.ts | 17 ++++++++++++++++ .../view-evento/view-evento.component.html | 3 --- src/app/view-evento/view-evento.component.ts | 14 ------------- src/app/view-evento/view-evento.module.ts | 20 +++++++++++++++++++ src/app/view-evento/view-evento.page.html | 9 +++++++++ ...o.component.scss => view-evento.page.scss} | 0 ...onent.spec.ts => view-evento.page.spec.ts} | 12 +++++------ src/app/view-evento/view-evento.page.ts | 20 +++++++++++++++++++ 15 files changed, 97 insertions(+), 31 deletions(-) create mode 100644 src/app/view-evento/view-evento-routing.module.ts delete mode 100644 src/app/view-evento/view-evento.component.html delete mode 100644 src/app/view-evento/view-evento.component.ts create mode 100644 src/app/view-evento/view-evento.module.ts create mode 100644 src/app/view-evento/view-evento.page.html rename src/app/view-evento/{view-evento.component.scss => view-evento.page.scss} (100%) rename src/app/view-evento/{view-evento.component.spec.ts => view-evento.page.spec.ts} (57%) create mode 100644 src/app/view-evento/view-evento.page.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4f354c8..45fa8a3 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,6 +7,10 @@ const routes: Routes = [ path: '', loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) }, + { + path: 'view-evento', + loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule) + }, ]; diff --git a/src/app/perfil-discoteca/perfil-discoteca.page.html b/src/app/perfil-discoteca/perfil-discoteca.page.html index cd694f9..2840b2a 100644 --- a/src/app/perfil-discoteca/perfil-discoteca.page.html +++ b/src/app/perfil-discoteca/perfil-discoteca.page.html @@ -84,7 +84,7 @@
- +
{{evento.nombre}} ยท diff --git a/src/app/perfil-discoteca/perfil-discoteca.page.scss b/src/app/perfil-discoteca/perfil-discoteca.page.scss index 02d61ab..a0df72b 100644 --- a/src/app/perfil-discoteca/perfil-discoteca.page.scss +++ b/src/app/perfil-discoteca/perfil-discoteca.page.scss @@ -61,12 +61,11 @@ } .eventos{ - margin: 20px; - justify-content: space-between; + display:block; } - .evento{ - margin-top: 20px; + .evento:hover{ + background-color: rgb(97, 97, 97); } .eventoHeader{ font-weight: bold; diff --git a/src/app/perfil-discoteca/perfil-discoteca.page.ts b/src/app/perfil-discoteca/perfil-discoteca.page.ts index 9ea5148..74e2432 100644 --- a/src/app/perfil-discoteca/perfil-discoteca.page.ts +++ b/src/app/perfil-discoteca/perfil-discoteca.page.ts @@ -161,6 +161,11 @@ export class PerfilDiscotecaPage implements OnInit { addEvento() { this.router.navigate(['/tabs/tab1/prompt-evento']); } + +mostrarEvento(evento: Evento){ + this.tab1Service.eventoIndex = this.eventos.indexOf(evento); + this.router.navigate(['/tabs/tab1/view-evento']); +} } diff --git a/src/app/prompt-evento/prompt-evento.page.ts b/src/app/prompt-evento/prompt-evento.page.ts index cef30c8..80243b0 100644 --- a/src/app/prompt-evento/prompt-evento.page.ts +++ b/src/app/prompt-evento/prompt-evento.page.ts @@ -42,9 +42,6 @@ export class PromptEventoPage{ if (!this.tab1Service.eventos){ this.tab1Service.initEventos();} this.tab1Service.eventos.push(evento); - for (var i=0; i - view-evento works! -

diff --git a/src/app/view-evento/view-evento.component.ts b/src/app/view-evento/view-evento.component.ts deleted file mode 100644 index c71e99a..0000000 --- a/src/app/view-evento/view-evento.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-view-evento', - templateUrl: './view-evento.component.html', - styleUrls: ['./view-evento.component.scss'], -}) -export class ViewEventoComponent implements OnInit { - - constructor() { } - - ngOnInit() {} - -} diff --git a/src/app/view-evento/view-evento.module.ts b/src/app/view-evento/view-evento.module.ts new file mode 100644 index 0000000..34afdb0 --- /dev/null +++ b/src/app/view-evento/view-evento.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { ViewEventoPageRoutingModule } from './view-evento-routing.module'; + +import { ViewEventoPage } from './view-evento.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + ViewEventoPageRoutingModule + ], + declarations: [ViewEventoPage] +}) +export class ViewEventoPageModule {} diff --git a/src/app/view-evento/view-evento.page.html b/src/app/view-evento/view-evento.page.html new file mode 100644 index 0000000..fbd24ed --- /dev/null +++ b/src/app/view-evento/view-evento.page.html @@ -0,0 +1,9 @@ + + + ViewEvento + + + + + + diff --git a/src/app/view-evento/view-evento.component.scss b/src/app/view-evento/view-evento.page.scss similarity index 100% rename from src/app/view-evento/view-evento.component.scss rename to src/app/view-evento/view-evento.page.scss diff --git a/src/app/view-evento/view-evento.component.spec.ts b/src/app/view-evento/view-evento.page.spec.ts similarity index 57% rename from src/app/view-evento/view-evento.component.spec.ts rename to src/app/view-evento/view-evento.page.spec.ts index 0df046e..b66d23f 100644 --- a/src/app/view-evento/view-evento.component.spec.ts +++ b/src/app/view-evento/view-evento.page.spec.ts @@ -1,19 +1,19 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { IonicModule } from '@ionic/angular'; -import { ViewEventoComponent } from './view-evento.component'; +import { ViewEventoPage } from './view-evento.page'; -describe('ViewEventoComponent', () => { - let component: ViewEventoComponent; - let fixture: ComponentFixture; +describe('ViewEventoPage', () => { + let component: ViewEventoPage; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewEventoComponent ], + declarations: [ ViewEventoPage ], imports: [IonicModule.forRoot()] }).compileComponents(); - fixture = TestBed.createComponent(ViewEventoComponent); + fixture = TestBed.createComponent(ViewEventoPage); component = fixture.componentInstance; fixture.detectChanges(); })); diff --git a/src/app/view-evento/view-evento.page.ts b/src/app/view-evento/view-evento.page.ts new file mode 100644 index 0000000..1fb6d97 --- /dev/null +++ b/src/app/view-evento/view-evento.page.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; +import { Evento } from '../evento'; +import { Tab1Service } from '../tab1/tab1.service'; + +@Component({ + selector: 'app-view-evento', + templateUrl: './view-evento.page.html', + styleUrls: ['./view-evento.page.scss'], +}) +export class ViewEventoPage implements OnInit { + + evento: Evento; + + constructor(private tab1Service: Tab1Service) { } + + ngOnInit() { + this.evento = this.tab1Service.getEventobyIndex(this.tab1Service.eventoIndex); + } + +}