creado objeto interfaz Reserva e interfaz de usuario para reservar

This commit is contained in:
onsaliyo 2021-05-20 19:02:00 +02:00
parent 287f457a11
commit 024f768da9
11 changed files with 115 additions and 3 deletions

View File

@ -45,6 +45,10 @@ const routes: Routes = [
path: 'view-discoteca-cliente', path: 'view-discoteca-cliente',
loadChildren: () => import('./view-discoteca-cliente/view-discoteca-cliente.module').then( m => m.ViewDiscotecaClientePageModule) loadChildren: () => import('./view-discoteca-cliente/view-discoteca-cliente.module').then( m => m.ViewDiscotecaClientePageModule)
}, },
{
path: 'reservamodal',
loadChildren: () => import('./reservamodal/reservamodal.module').then( m => m.ReservamodalPageModule)
},

View File

@ -0,0 +1,7 @@
export interface Reservai {
UserID: number,
EventoID: number,
codigoDescuento: string,
codigoUnicoID: number,
descuentoPorciento: number
}

View File

@ -3,8 +3,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Tab1Service } from '../tab1/tab1.service'; import { Tab1Service } from '../tab1/tab1.service';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Eventoi } from '../interfaces/eventoi'; import { Eventoi } from '../interfaces/eventoi';
import { DatePipe } from '@angular/common'
import { ViewEventoPageRoutingModule } from '../view-evento/view-evento-routing.module';
@Component({ @Component({
selector: 'app-prompt-evento', selector: 'app-prompt-evento',

View File

@ -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 {}

View File

@ -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 {}

View File

@ -0,0 +1,9 @@
<ion-header>
<ion-toolbar>
<ion-title>reservamodal</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
</ion-content>

View File

@ -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<ReservamodalPage>;
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();
});
});

View File

@ -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() {
}
}

View File

@ -26,6 +26,11 @@
<a [routerLink]="['/tabsUser/tab2/view-discoteca-cliente']">{{discoteca?.nombre}}</a> <a [routerLink]="['/tabsUser/tab2/view-discoteca-cliente']">{{discoteca?.nombre}}</a>
</div> </div>
</ion-row> </ion-row>
<ion-row>
<ion-button (click)="openReserva()">
Reserva
</ion-button>
</ion-row>
</div> </div>
</ion-grid> </ion-grid>
</ion-content> </ion-content>

View File

@ -1,6 +1,9 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { DiscotecaI } from '../interfaces/discoteca-i'; import { DiscotecaI } from '../interfaces/discoteca-i';
import { Eventoi } from '../interfaces/eventoi'; import { Eventoi } from '../interfaces/eventoi';
import { Reservai } from '../interfaces/reservai';
import { ReservamodalPage } from '../reservamodal/reservamodal.page';
import { FeedService } from '../services/feed.service'; import { FeedService } from '../services/feed.service';
@Component({ @Component({
@ -12,11 +15,20 @@ export class ViewEventoClientePage implements OnInit {
evento: Eventoi; evento: Eventoi;
discoteca: DiscotecaI; discoteca: DiscotecaI;
constructor(private feedService: FeedService) { } reserva: Reservai;
constructor(private feedService: FeedService, private modalController: ModalController) { }
ngOnInit() { ngOnInit() {
this.evento = this.feedService.getEventoByIndex(this.feedService.eventoIndex); this.evento = this.feedService.getEventoByIndex(this.feedService.eventoIndex);
this.discoteca = this.feedService.discotecaEvento; this.discoteca = this.feedService.discotecaEvento;
} }
openReserva(){
this.modalController.create({
component: ReservamodalPage,
}).then(modal => modal.present());
}
} }