From 024f768da9e8f033f2eecedf36148669aaa0f93d Mon Sep 17 00:00:00 2001 From: onsaliyo Date: Thu, 20 May 2021 19:02:00 +0200 Subject: [PATCH] creado objeto interfaz Reserva e interfaz de usuario para reservar --- src/app/app-routing.module.ts | 4 ++++ src/app/interfaces/reservai.ts | 7 ++++++ src/app/prompt-evento/prompt-evento.page.ts | 3 +-- .../reservamodal-routing.module.ts | 17 +++++++++++++ src/app/reservamodal/reservamodal.module.ts | 20 ++++++++++++++++ src/app/reservamodal/reservamodal.page.html | 9 +++++++ src/app/reservamodal/reservamodal.page.scss | 0 .../reservamodal/reservamodal.page.spec.ts | 24 +++++++++++++++++++ src/app/reservamodal/reservamodal.page.ts | 15 ++++++++++++ .../view-evento-cliente.page.html | 5 ++++ .../view-evento-cliente.page.ts | 14 ++++++++++- 11 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 src/app/interfaces/reservai.ts create mode 100644 src/app/reservamodal/reservamodal-routing.module.ts create mode 100644 src/app/reservamodal/reservamodal.module.ts create mode 100644 src/app/reservamodal/reservamodal.page.html create mode 100644 src/app/reservamodal/reservamodal.page.scss create mode 100644 src/app/reservamodal/reservamodal.page.spec.ts create mode 100644 src/app/reservamodal/reservamodal.page.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 99893c7..12c8013 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -45,6 +45,10 @@ const routes: Routes = [ path: 'view-discoteca-cliente', loadChildren: () => import('./view-discoteca-cliente/view-discoteca-cliente.module').then( m => m.ViewDiscotecaClientePageModule) }, + { + path: 'reservamodal', + loadChildren: () => import('./reservamodal/reservamodal.module').then( m => m.ReservamodalPageModule) + }, diff --git a/src/app/interfaces/reservai.ts b/src/app/interfaces/reservai.ts new file mode 100644 index 0000000..91b40f4 --- /dev/null +++ b/src/app/interfaces/reservai.ts @@ -0,0 +1,7 @@ +export interface Reservai { + UserID: number, + EventoID: number, + codigoDescuento: string, + codigoUnicoID: number, + descuentoPorciento: number +} diff --git a/src/app/prompt-evento/prompt-evento.page.ts b/src/app/prompt-evento/prompt-evento.page.ts index c1e13d9..c60bf3a 100644 --- a/src/app/prompt-evento/prompt-evento.page.ts +++ b/src/app/prompt-evento/prompt-evento.page.ts @@ -3,8 +3,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms'; import { Tab1Service } from '../tab1/tab1.service'; import { Router } from '@angular/router'; import { Eventoi } from '../interfaces/eventoi'; -import { DatePipe } from '@angular/common' -import { ViewEventoPageRoutingModule } from '../view-evento/view-evento-routing.module'; + @Component({ selector: 'app-prompt-evento', diff --git a/src/app/reservamodal/reservamodal-routing.module.ts b/src/app/reservamodal/reservamodal-routing.module.ts new file mode 100644 index 0000000..8c469e9 --- /dev/null +++ b/src/app/reservamodal/reservamodal-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { ReservamodalPage } from './reservamodal.page'; + +const routes: Routes = [ + { + path: '', + component: ReservamodalPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class ReservamodalPageRoutingModule {} diff --git a/src/app/reservamodal/reservamodal.module.ts b/src/app/reservamodal/reservamodal.module.ts new file mode 100644 index 0000000..56b2a62 --- /dev/null +++ b/src/app/reservamodal/reservamodal.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 { ReservamodalPageRoutingModule } from './reservamodal-routing.module'; + +import { ReservamodalPage } from './reservamodal.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + ReservamodalPageRoutingModule + ], + declarations: [ReservamodalPage] +}) +export class ReservamodalPageModule {} diff --git a/src/app/reservamodal/reservamodal.page.html b/src/app/reservamodal/reservamodal.page.html new file mode 100644 index 0000000..c4540c6 --- /dev/null +++ b/src/app/reservamodal/reservamodal.page.html @@ -0,0 +1,9 @@ + + + reservamodal + + + + + + diff --git a/src/app/reservamodal/reservamodal.page.scss b/src/app/reservamodal/reservamodal.page.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/reservamodal/reservamodal.page.spec.ts b/src/app/reservamodal/reservamodal.page.spec.ts new file mode 100644 index 0000000..bb01b0d --- /dev/null +++ b/src/app/reservamodal/reservamodal.page.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { ReservamodalPage } from './reservamodal.page'; + +describe('ReservamodalPage', () => { + let component: ReservamodalPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ReservamodalPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(ReservamodalPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/reservamodal/reservamodal.page.ts b/src/app/reservamodal/reservamodal.page.ts new file mode 100644 index 0000000..402e260 --- /dev/null +++ b/src/app/reservamodal/reservamodal.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-reservamodal', + templateUrl: './reservamodal.page.html', + styleUrls: ['./reservamodal.page.scss'], +}) +export class ReservamodalPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/view-evento-cliente/view-evento-cliente.page.html b/src/app/view-evento-cliente/view-evento-cliente.page.html index 39aad18..20f320f 100644 --- a/src/app/view-evento-cliente/view-evento-cliente.page.html +++ b/src/app/view-evento-cliente/view-evento-cliente.page.html @@ -26,6 +26,11 @@ {{discoteca?.nombre}} + + + Reserva + + diff --git a/src/app/view-evento-cliente/view-evento-cliente.page.ts b/src/app/view-evento-cliente/view-evento-cliente.page.ts index d9edc72..d38fbb6 100644 --- a/src/app/view-evento-cliente/view-evento-cliente.page.ts +++ b/src/app/view-evento-cliente/view-evento-cliente.page.ts @@ -1,6 +1,9 @@ import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; import { DiscotecaI } from '../interfaces/discoteca-i'; import { Eventoi } from '../interfaces/eventoi'; +import { Reservai } from '../interfaces/reservai'; +import { ReservamodalPage } from '../reservamodal/reservamodal.page'; import { FeedService } from '../services/feed.service'; @Component({ @@ -12,11 +15,20 @@ export class ViewEventoClientePage implements OnInit { evento: Eventoi; discoteca: DiscotecaI; - constructor(private feedService: FeedService) { } + reserva: Reservai; + constructor(private feedService: FeedService, private modalController: ModalController) { } ngOnInit() { this.evento = this.feedService.getEventoByIndex(this.feedService.eventoIndex); this.discoteca = this.feedService.discotecaEvento; } + openReserva(){ + this.modalController.create({ + component: ReservamodalPage, + + }).then(modal => modal.present()); + + } + }