Compare commits
No commits in common. "master" and "coolneng" have entirely different histories.
47
config.xml
47
config.xml
@ -91,53 +91,6 @@
|
||||
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
|
||||
<splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
|
||||
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
|
||||
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
|
||||
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
|
||||
<icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
|
||||
<icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
|
||||
<icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
|
||||
<icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
|
||||
<icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
|
||||
<icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
|
||||
<icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
|
||||
<icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
|
||||
<icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
|
||||
<icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
|
||||
<icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
|
||||
<icon height="216" src="resources/ios/icon/icon-108@2x.png" width="216" />
|
||||
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
|
||||
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
|
||||
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
|
||||
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
|
||||
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
|
||||
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
|
||||
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
|
||||
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
|
||||
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
|
||||
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
|
||||
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
|
||||
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
|
||||
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
|
||||
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
|
||||
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
|
||||
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
|
||||
<splash height="2688" src="resources/ios/splash/Default-2688h~iphone.png" width="1242" />
|
||||
<splash height="1242" src="resources/ios/splash/Default-Landscape-2688h~iphone.png" width="2688" />
|
||||
<splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
|
||||
<splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
|
||||
<splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
|
||||
<splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
|
||||
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
|
||||
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
|
||||
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
|
||||
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
|
||||
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
|
||||
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
|
||||
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
|
||||
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
|
||||
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
|
||||
</platform>
|
||||
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
|
||||
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
|
||||
|
1561
package-lock.json
generated
1561
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
28
package.json
28
package.json
@ -13,26 +13,23 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^11.2.1",
|
||||
"@angular/cdk": "^11.2.1",
|
||||
"@angular/common": "~10.0.0",
|
||||
"@angular/core": "~10.0.0",
|
||||
"@angular/forms": "~10.0.0",
|
||||
"@angular/material": "^11.2.1",
|
||||
"@angular/platform-browser": "~10.0.0",
|
||||
"@angular/platform-browser-dynamic": "~10.0.0",
|
||||
"@angular/router": "~10.0.0",
|
||||
"@capacitor/core": "2.4.3",
|
||||
"@ionic-native/core": "^5.31.1",
|
||||
"@ionic-native/splash-screen": "^5.31.1",
|
||||
"@ionic-native/status-bar": "^5.31.1",
|
||||
"@ionic/angular": "^5.5.4",
|
||||
"@ionic-native/core": "^5.0.0",
|
||||
"@ionic-native/splash-screen": "^5.0.0",
|
||||
"@ionic-native/status-bar": "^5.0.0",
|
||||
"@ionic/angular": "^5.0.0",
|
||||
"rxjs": "~6.5.5",
|
||||
"tslib": "^2.1.0",
|
||||
"tslib": "^2.0.0",
|
||||
"zone.js": "~0.10.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^0.1000.8",
|
||||
"@angular-devkit/build-angular": "~0.1000.0",
|
||||
"@angular/cli": "10.0.8",
|
||||
"@angular/compiler": "~10.0.0",
|
||||
"@angular/compiler-cli": "~10.0.0",
|
||||
@ -41,15 +38,14 @@
|
||||
"@ionic/angular-toolkit": "^2.3.0",
|
||||
"@types/jasmine": "~3.5.0",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/node": "^12.20.4",
|
||||
"@types/node": "^12.11.1",
|
||||
"codelyzer": "^6.0.0",
|
||||
"cordova-android": "^9.0.0",
|
||||
"cordova-plugin-device": "^2.0.3",
|
||||
"cordova-plugin-device": "^2.0.2",
|
||||
"cordova-plugin-ionic-keyboard": "^2.2.0",
|
||||
"cordova-plugin-ionic-webview": "^4.2.1",
|
||||
"cordova-plugin-splashscreen": "^5.0.4",
|
||||
"cordova-plugin-statusbar": "^2.4.3",
|
||||
"cordova-plugin-whitelist": "^1.3.4",
|
||||
"cordova-plugin-splashscreen": "^5.0.2",
|
||||
"cordova-plugin-statusbar": "^2.4.2",
|
||||
"cordova-plugin-whitelist": "^1.3.3",
|
||||
"jasmine-core": "~3.5.0",
|
||||
"jasmine-spec-reporter": "~5.0.0",
|
||||
"karma": "~5.0.0",
|
||||
@ -60,7 +56,7 @@
|
||||
"protractor": "~7.0.0",
|
||||
"ts-node": "~8.3.0",
|
||||
"tslint": "~6.1.0",
|
||||
"typescript": "^3.9.9"
|
||||
"typescript": "~3.9.5"
|
||||
},
|
||||
"description": "An Ionic project",
|
||||
"cordova": {
|
||||
|
@ -1,64 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
||||
import { LoginPage } from './login/login.page';
|
||||
|
||||
|
||||
const routes: Routes = [
|
||||
|
||||
{
|
||||
path: 'login',
|
||||
component: LoginPage
|
||||
},
|
||||
{
|
||||
path: 'tabs',
|
||||
path: '',
|
||||
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'tabsUser',
|
||||
loadChildren: () => import('./tabs-user/tabs-user.module').then(m => m.TabsUserPageModule)
|
||||
},
|
||||
{
|
||||
path: 'view-evento',
|
||||
loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule)
|
||||
},
|
||||
{
|
||||
path: 'galeriamodal',
|
||||
loadChildren: () => import('./galeriamodal/galeriamodal.module').then( m => m.GaleriamodalPageModule)
|
||||
},
|
||||
{
|
||||
path:'',
|
||||
redirectTo: 'login',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: 'tabs-user',
|
||||
loadChildren: () => import('./tabs-user/tabs-user.module').then( m => m.TabsUserPageModule)
|
||||
},
|
||||
{
|
||||
path: 'feed',
|
||||
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)
|
||||
},
|
||||
{
|
||||
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)
|
||||
},
|
||||
{
|
||||
path: 'perfil-usuario',
|
||||
loadChildren: () => import('./perfil-usuario/perfil-usuario.module').then( m => m.PerfilUsuarioPageModule)
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
@ -1,27 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { RouteReuseStrategy } from '@angular/router';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
||||
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
||||
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { PerfilDiscotecaPage } from './perfil-discoteca/perfil-discoteca.page';
|
||||
import { PromptEventoPage} from './prompt-evento/prompt-evento.page'
|
||||
import { GaleriamodalPageModule } from './galeriamodal/galeriamodal.module';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { LoginPage } from './login/login.page';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent, PerfilDiscotecaPage, PromptEventoPage, LoginPage],
|
||||
declarations: [AppComponent, PerfilDiscotecaPage, PromptEventoPage],
|
||||
entryComponents: [],
|
||||
imports: [BrowserModule, HttpClientModule, IonicModule.forRoot(), AppRoutingModule, ReactiveFormsModule, GaleriamodalPageModule, MatMenuModule, BrowserAnimationsModule, MatIconModule, MatCardModule],
|
||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, ReactiveFormsModule],
|
||||
providers: [
|
||||
StatusBar,
|
||||
SplashScreen,
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import {Eventoi} from './interfaces/eventoi';
|
||||
import {Evento} from './evento';
|
||||
|
||||
export class Discoteca {
|
||||
|
||||
@ -7,16 +7,8 @@ export class Discoteca {
|
||||
private nombre: string;
|
||||
private telefono: number;
|
||||
private localizacion: string;
|
||||
private eventos: Eventoi[];
|
||||
private descripcion: string;
|
||||
private eventos: Evento[];
|
||||
|
||||
setId(id: number): void{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
getId(): number{
|
||||
return this.id;
|
||||
}
|
||||
|
||||
setNombre(nombre: string): void{
|
||||
this.nombre = nombre;
|
||||
@ -42,15 +34,7 @@ export class Discoteca {
|
||||
return this.localizacion
|
||||
}
|
||||
|
||||
getEventos(): Eventoi[]{
|
||||
getEventos(): Evento[]{
|
||||
return this.eventos;
|
||||
}
|
||||
|
||||
setDescripcion(desc: string): void{
|
||||
this.descripcion = desc;
|
||||
}
|
||||
|
||||
getDescripcion(): string{
|
||||
return this.descripcion;
|
||||
}
|
||||
}
|
||||
|
7
src/app/evento.spec.ts
Normal file
7
src/app/evento.spec.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { Evento } from './evento';
|
||||
|
||||
describe('Evento', () => {
|
||||
it('should create an instance', () => {
|
||||
expect(new Evento()).toBeTruthy();
|
||||
});
|
||||
});
|
75
src/app/evento.ts
Normal file
75
src/app/evento.ts
Normal file
@ -0,0 +1,75 @@
|
||||
export class Evento {
|
||||
private id: number;
|
||||
nombre: string;
|
||||
localizacion: string;
|
||||
fecha: Date;
|
||||
dia: string;
|
||||
hora: string;
|
||||
descripcion: string;
|
||||
precio1: number;
|
||||
precio2: number;
|
||||
|
||||
setNombre(nombre: string): void{
|
||||
this.nombre = nombre;
|
||||
}
|
||||
|
||||
getNombre(): string{
|
||||
return this.nombre;
|
||||
}
|
||||
|
||||
setLocalizacion(localizacion: string): void{
|
||||
this.localizacion = localizacion;
|
||||
}
|
||||
|
||||
getLocalizacion(): string{
|
||||
return this.localizacion
|
||||
}
|
||||
|
||||
setFecha(fecha: Date): void{
|
||||
this.fecha = fecha;
|
||||
}
|
||||
|
||||
getFecha(): Date{
|
||||
return this.fecha;
|
||||
}
|
||||
|
||||
setDesc(desc: string): void{
|
||||
this.descripcion = desc;
|
||||
}
|
||||
|
||||
getDesc(): string{
|
||||
return this.descripcion;
|
||||
}
|
||||
|
||||
setDia(fecha: Date): void{
|
||||
this.dia = fecha.getDate()+"/"+fecha.getMonth();
|
||||
}
|
||||
|
||||
getDia(): string{
|
||||
return this.dia;
|
||||
}
|
||||
|
||||
setHora(fecha: Date): void{
|
||||
this.hora = fecha.getHours()+":"+fecha.getMinutes();
|
||||
}
|
||||
|
||||
getHora(): string{
|
||||
return this.hora;
|
||||
}
|
||||
|
||||
setPrecio1(precio: number): void{
|
||||
this.precio1 = precio;
|
||||
}
|
||||
|
||||
getPrecio1(): number{
|
||||
return this.precio1;
|
||||
}
|
||||
|
||||
setPrecio2(precio: number): void{
|
||||
this.precio2 = precio;
|
||||
}
|
||||
|
||||
getPrecio2(): number{
|
||||
return this.precio2;
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { FeedPage } from './feed.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: FeedPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class FeedPageRoutingModule {}
|
@ -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 { FeedPageRoutingModule } from './feed-routing.module';
|
||||
|
||||
import { FeedPage } from './feed.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
FeedPageRoutingModule
|
||||
],
|
||||
declarations: [FeedPage]
|
||||
})
|
||||
export class FeedPageModule {}
|
@ -1,39 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Eventos Próximos</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-grid>
|
||||
<ion-row class="searchbar">
|
||||
<ion-input class="text" id="filtro" aria-placeholder="evento o discoteca"></ion-input>
|
||||
<ion-button (click)="filtrarEventos()"><ion-icon name="search-outline"></ion-icon></ion-button>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col size="12">
|
||||
<div *ngIf="eventos.length>0" class="eventos">
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let evento of eventos" button (click)="mostrarEvento(evento)">
|
||||
<div class="evento">
|
||||
<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>
|
||||
<div class="eventoDesc">
|
||||
{{evento.descripcion}}
|
||||
</div>
|
||||
<div class="discotecaEvento">
|
||||
{{discotecas[idsDiscoteca.indexOf(evento.discotecaID)]?.nombre}}
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
@ -1,3 +0,0 @@
|
||||
.searchbar{
|
||||
float: right;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { FeedPage } from './feed.page';
|
||||
|
||||
describe('FeedPage', () => {
|
||||
let component: FeedPage;
|
||||
let fixture: ComponentFixture<FeedPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FeedPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FeedPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,88 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { DiscotecaI } from '../interfaces/discoteca-i';
|
||||
import { ApiService } from '../services/api.service';
|
||||
import { FeedService } from '../services/feed.service';
|
||||
import { Tab1Service } from '../tab1/tab1.service';
|
||||
import { EventListenerFocusTrapInertStrategy } from '@angular/cdk/a11y';
|
||||
|
||||
@Component({
|
||||
selector: 'app-feed',
|
||||
templateUrl: './feed.page.html',
|
||||
styleUrls: ['./feed.page.scss'],
|
||||
})
|
||||
export class FeedPage implements OnInit {
|
||||
|
||||
eventos: Eventoi[];
|
||||
discotecas: DiscotecaI[];
|
||||
idsDiscoteca: number[];
|
||||
mostrarTodos: boolean;
|
||||
|
||||
constructor(private feedService:FeedService, private tab1Service: Tab1Service, private router:Router, private apiService: ApiService ) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.mostrarTodos = true;
|
||||
this.eventos = this.feedService.eventos;
|
||||
this.idsDiscoteca = [];
|
||||
this.discotecas=[];
|
||||
this.getDiscotecasDistintas();
|
||||
}
|
||||
|
||||
mostrarEvento(evento: Eventoi){
|
||||
|
||||
this.feedService.eventoIndex = this.eventos.indexOf(evento);
|
||||
let discotecaDelEvento: DiscotecaI = this.discotecas[this.idsDiscoteca.indexOf(evento.discotecaID)];
|
||||
this.feedService.discotecaEvento = discotecaDelEvento;
|
||||
this.router.navigate(['/tabsUser/tab2/view-evento-cliente']);
|
||||
|
||||
}
|
||||
|
||||
getDiscotecasDistintas(){
|
||||
this.eventos.forEach(
|
||||
evento => {
|
||||
if(!(this.idsDiscoteca.find(id => evento.discotecaID==id))){
|
||||
this.idsDiscoteca.push(evento.discotecaID);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
this.idsDiscoteca.forEach(
|
||||
idDiscoteca => {
|
||||
this.apiService.getUserDiscoteca(idDiscoteca)
|
||||
.subscribe(discoteca => {
|
||||
console.log(discoteca[0]);
|
||||
this.discotecas.push(discoteca[0]);
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
filtrarEventos(){
|
||||
var filtro = (<HTMLInputElement>document.getElementById("filtro")).value;
|
||||
let eventoSinFiltrar = this.feedService.eventos;
|
||||
this.eventos = [];
|
||||
eventoSinFiltrar.forEach(evento => {
|
||||
if (this.cumpleFiltro(evento, filtro)){
|
||||
this.eventos.push(evento);
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
cumpleFiltro(evento: Eventoi, filtro: string){
|
||||
|
||||
if(evento.nombre.toLowerCase().includes(filtro.toLowerCase())){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.discotecas[this.idsDiscoteca.indexOf(evento.discotecaID)]
|
||||
.nombre.toLowerCase().includes(filtro.toLowerCase())){
|
||||
return true;
|
||||
}
|
||||
|
||||
else return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { GaleriamodalPage } from './galeriamodal.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GaleriamodalPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class GaleriamodalPageRoutingModule {}
|
@ -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 { GaleriamodalPageRoutingModule } from './galeriamodal-routing.module';
|
||||
|
||||
import { GaleriamodalPage } from './galeriamodal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
GaleriamodalPageRoutingModule
|
||||
],
|
||||
declarations: [GaleriamodalPage]
|
||||
})
|
||||
export class GaleriamodalPageModule {}
|
@ -1,15 +0,0 @@
|
||||
|
||||
<ion-content fullscreen>
|
||||
|
||||
<ion-button (click)="close()">
|
||||
<ion-icon name="close" slot="start"></ion-icon>
|
||||
</ion-button>
|
||||
|
||||
<ion-slide>
|
||||
<img src="{{foto}}">
|
||||
</ion-slide>
|
||||
|
||||
<ion-button (click)="borrar()">
|
||||
<ion-icon name="trash-outline"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-content>
|
@ -1,4 +0,0 @@
|
||||
ion-content {
|
||||
background: rgba(0, 0, 0, 0.589)
|
||||
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GaleriamodalPage } from './galeriamodal.page';
|
||||
|
||||
describe('GaleriamodalPage', () => {
|
||||
let component: GaleriamodalPage;
|
||||
let fixture: ComponentFixture<GaleriamodalPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GaleriamodalPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GaleriamodalPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,36 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { Tab1Service } from '../tab1/tab1.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-galeriamodal',
|
||||
templateUrl: './galeriamodal.page.html',
|
||||
styleUrls: ['./galeriamodal.page.scss'],
|
||||
})
|
||||
export class GaleriamodalPage implements OnInit {
|
||||
|
||||
foto: string;
|
||||
|
||||
sliderOpts = {
|
||||
|
||||
}
|
||||
constructor(private navParams: NavParams, private modalController: ModalController, private tab1Service: Tab1Service,
|
||||
private router: Router) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.foto = this.navParams.get('foto');
|
||||
}
|
||||
|
||||
|
||||
borrar(){
|
||||
let index = this.tab1Service.galeria.indexOf('foto');
|
||||
this.tab1Service.galeria.slice[index];
|
||||
this.close();
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
export interface Codigo {
|
||||
UserID: number,
|
||||
codigo: string,
|
||||
numReservas: number
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
export interface DiscotecaI {
|
||||
discotecaID: number,
|
||||
nombre: string,
|
||||
telefono: number,
|
||||
localizacion: string
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import { Time } from "@angular/common";
|
||||
|
||||
export interface Eventoi {
|
||||
id: number,
|
||||
discotecaID: number,
|
||||
nombre: string,
|
||||
localizacion: string,
|
||||
fecha: Date,
|
||||
hora: Date,
|
||||
descripcion: string,
|
||||
precio1: number,
|
||||
precio2: number,
|
||||
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
export interface Reservai {
|
||||
UserID: number,
|
||||
EventoID: number,
|
||||
codigoDescuento: string,
|
||||
codigoUnico: string,
|
||||
codigoUnicoID: number,
|
||||
descuentoPorciento: number
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
export interface UserLogin {
|
||||
loginUser: string;
|
||||
loginPassword: string;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
export interface User {
|
||||
userID: number;
|
||||
discotecaID: number;
|
||||
userType: number;
|
||||
username: string;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { LoginPage } from './login.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: LoginPage,
|
||||
},
|
||||
{
|
||||
path: 'tabs',
|
||||
loadChildren: () => import('../tabs/tabs.module').then(m => m.TabsPageModule)
|
||||
},
|
||||
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'login'
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class LoginPageRoutingModule {}
|
@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { LoginPageRoutingModule } from './login-routing.module';
|
||||
import { LoginPage } from './login.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
LoginPageRoutingModule
|
||||
],
|
||||
declarations: [LoginPage]
|
||||
})
|
||||
export class LoginPageModule {}
|
@ -1,18 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Login</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<span>Usuario: </span><input type="text" id="username">
|
||||
<span>Contraseña: </span><input type="password" id="password">
|
||||
<ion-button (click)="login()">
|
||||
Login
|
||||
</ion-button>
|
||||
<div>
|
||||
<div *ngIf="user">
|
||||
{{user.username}}
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
@ -1,3 +0,0 @@
|
||||
input{
|
||||
color: black;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { LoginPage } from './login.page';
|
||||
|
||||
describe('LoginPage', () => {
|
||||
let component: LoginPage;
|
||||
let fixture: ComponentFixture<LoginPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LoginPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(LoginPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,32 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { LoginService } from '../services/login.service';
|
||||
import { User } from '../interfaces/user';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.page.html',
|
||||
styleUrls: ['./login.page.scss'],
|
||||
})
|
||||
export class LoginPage implements OnInit {
|
||||
|
||||
username: string;
|
||||
password: string;
|
||||
user: User;
|
||||
|
||||
constructor(private router: Router, private loginService: LoginService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.user = this.loginService.user;
|
||||
}
|
||||
|
||||
login() {
|
||||
|
||||
this.username = (<HTMLInputElement>document.getElementById("username")).value;
|
||||
this.password = (<HTMLInputElement>document.getElementById("password")).value;
|
||||
this.loginService.validateUser(this.username, this.password)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -7,53 +7,42 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content [fullscreen]="true">
|
||||
<ion-header collapse="condense">
|
||||
<ion-toolbar>
|
||||
<ion-title class="titulo" size="large">Mi Perfil</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<div class='main'>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<div class='fotoPerfil'>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<ion-img class="fotoPerfil" width="100%" height="100%" [src]='fotoSrc' alt='barraquinha'></ion-img>
|
||||
<div class="textoPie">{{nombre}}</div>
|
||||
</div>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<div class="menuBotones">
|
||||
|
||||
<button mat-icon-button [matMenuTriggerFor]="menu">
|
||||
<ion-icon name="settings" class="settingsIcon"></ion-icon>
|
||||
</button>
|
||||
|
||||
<mat-menu #menu="matMenu" xPositon="after" yPosition="above">
|
||||
<button mat-menu-item>
|
||||
<div class="addFoto">
|
||||
<ion-button [disabled]='editDisabled'>
|
||||
<ion-icon name="image" slot="icon-only"></ion-icon>
|
||||
<input type="file" (change)="loadImageFromDevice($event);cargarImagen()" id="file-input-perfil" accept="image/png, image/jpeg">
|
||||
</button>
|
||||
</ion-button>
|
||||
</div>
|
||||
|
||||
|
||||
<button mat-menu-item (click)="enableEdit()" label="editar" [disabled]='editEnabled'>
|
||||
<div>
|
||||
<ion-button (click)="enableEdit()" label="editar" [disabled]='editEnabled'>
|
||||
<ion-icon name="create"></ion-icon>
|
||||
</button>
|
||||
|
||||
|
||||
<button mat-menu-item (click)="addEvento()">
|
||||
<ion-icon name="add-circle-outline">
|
||||
</ion-icon>
|
||||
Añadir evento
|
||||
</button>
|
||||
</mat-menu>
|
||||
</div>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
</ion-button>
|
||||
<div id="botonesHidden1" class="botonesHidden">
|
||||
<button (click)="saveEdit()" label="guardar" [disabled]='editDisabled' id="saveButton">
|
||||
<ion-button (click)="saveEdit()" label="guardar" [disabled]='editDisabled'>
|
||||
<ion-icon name="save"></ion-icon>
|
||||
</button>
|
||||
<button (click)="cancelEdit()" [disabled]='editDisabled' id="cancelButton">
|
||||
</ion-button>
|
||||
<ion-button (click)="cancelEdit()" [disabled]='editDisabled'>
|
||||
Cancelar
|
||||
</button>
|
||||
</ion-button></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
@ -67,40 +56,32 @@
|
||||
</div>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<div>
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
Descripción
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
{{descripcion}}
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<div class="galeria">
|
||||
Galería de Fotos
|
||||
|
||||
<input type="file" (change)="loadImageFromDevice($event)" id="file-input-galeria" accept="image/png, image/jpeg">
|
||||
<ion-slides (ionDrag)="onSlideChanged()" [options]="sliderOpts">
|
||||
<ion-slides (ionDrag)="onSlideChanged()">
|
||||
<ion-slide *ngFor="let foto of galeriaFotos">
|
||||
<div class="fotoGaleria"><img src="{{foto}}" tappable (click)="openPreview(foto)">
|
||||
<div class="botonesHidden" id="botonesHidden3">
|
||||
<div class="fotoGaleria"><img src="{{foto}}">
|
||||
<ion-button (click)="borrarDeGaleria()">
|
||||
<ion-icon name="trash-outline"></ion-icon>
|
||||
</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
<ion-row>
|
||||
<ion-button (click)="addEvento()">
|
||||
<ion-icon name="add-circle-outline">
|
||||
</ion-icon>
|
||||
Añadir evento
|
||||
</ion-button>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
<ion-col size="12">
|
||||
<div *ngIf="eventos.length>0" class="eventos">
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let evento of eventos" button (click)="mostrarEvento(evento)">
|
||||
@ -110,8 +91,7 @@
|
||||
<ion-icon name="calendar-outline"></ion-icon>
|
||||
{{evento.fecha}} ·
|
||||
<ion-icon name="cash-outline"></ion-icon>
|
||||
{{evento.precio1}},{{evento.precio2}}
|
||||
<ion-button (click)="editarEvento(evento);$event.stopPropagation();"><ion-icon name="pencil-outline"></ion-icon></ion-button>
|
||||
{{evento.precio1}}, {{evento.precio2}}
|
||||
</div>
|
||||
<div class="eventoDesc">
|
||||
{{evento.descripcion}}
|
||||
@ -120,13 +100,14 @@
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<ion-row>
|
||||
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</ion-grid>
|
||||
|
||||
</ion-content>
|
@ -6,20 +6,18 @@
|
||||
}
|
||||
|
||||
*{
|
||||
padding: 10px;
|
||||
display: block;
|
||||
padding: 5px;
|
||||
}
|
||||
.titulo{
|
||||
font: "arial";
|
||||
|
||||
.main{
|
||||
}
|
||||
.fotoPerfil{
|
||||
display: block;
|
||||
text-align: end;
|
||||
max-width: 800px;
|
||||
max-height: auto;
|
||||
margin: auto;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.fotoPerfil{
|
||||
text-align: end;
|
||||
|
||||
}
|
||||
|
||||
.textoPie{
|
||||
@ -39,8 +37,6 @@
|
||||
float: left;
|
||||
position: relative;
|
||||
margin: auto;
|
||||
text-align: right;
|
||||
padding-right: 50px;
|
||||
|
||||
}
|
||||
|
||||
@ -49,14 +45,15 @@
|
||||
}
|
||||
|
||||
.galeria{
|
||||
text-align: center;
|
||||
padding: 30px;
|
||||
|
||||
display: block;
|
||||
max-width: 300px;
|
||||
max-height: auto;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.botonesHidden{
|
||||
display: none;
|
||||
padding: none;
|
||||
}
|
||||
|
||||
.botonesVisible{
|
||||
@ -64,21 +61,14 @@
|
||||
}
|
||||
|
||||
.eventos{
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.evento{
|
||||
max-width:fit-content;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.evento:hover{
|
||||
background-color: rgb(97, 97, 97);
|
||||
}
|
||||
|
||||
.eventoHeader{
|
||||
font-weight: bold;
|
||||
float: left;
|
||||
|
||||
}
|
||||
|
||||
.eventoDesc{
|
||||
@ -86,28 +76,5 @@
|
||||
}
|
||||
|
||||
ion-slides {
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
mat-card-header{
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
button{
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.settingsIcon{
|
||||
font-size: large;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.menuBotones{
|
||||
position: relative;
|
||||
float: left;
|
||||
bottom: 60px;
|
||||
left: 20px;
|
||||
|
||||
height: 100%;
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Tab1Service } from '../tab1/tab1.service';
|
||||
import { IonSlides, ModalController} from '@ionic/angular';
|
||||
import { NodeCompatibleEventEmitter } from 'rxjs/internal/observable/fromEvent';
|
||||
import { Tab1Service } from '../tab1/tab1.service'
|
||||
import { Discoteca } from '../discoteca'
|
||||
import { IonSlides} from '@ionic/angular';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { ViewChild } from '@angular/core';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { Evento } from '../evento';
|
||||
import { Router } from '@angular/router';
|
||||
import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
|
||||
import { GaleriamodalPage } from '../galeriamodal/galeriamodal.page';
|
||||
import { stringify } from '@angular/compiler/src/util';
|
||||
|
||||
@Component({
|
||||
selector: 'app-perfil-discoteca',
|
||||
@ -20,7 +20,6 @@ export class PerfilDiscotecaPage implements OnInit {
|
||||
nombre: string;
|
||||
telefono: number;
|
||||
localizacion: string;
|
||||
descripcion: string;
|
||||
fotoSrc: string;
|
||||
fotoLoaded: string;
|
||||
someURL: string;
|
||||
@ -28,14 +27,10 @@ export class PerfilDiscotecaPage implements OnInit {
|
||||
editEnabled: string;
|
||||
galeriaFotos: string[];
|
||||
currentIndex: number;
|
||||
eventos: Eventoi[];
|
||||
eventos: Evento[];
|
||||
alertCtrl: AlertController;
|
||||
sliderOpts = {
|
||||
slidesPerView: 1.5,
|
||||
centeredSlides: true,
|
||||
};
|
||||
|
||||
constructor(private tab1Service: Tab1Service, private router: Router, private modalController: ModalController) {
|
||||
constructor(private tab1Service: Tab1Service, private router: Router) {
|
||||
|
||||
}
|
||||
|
||||
@ -48,12 +43,11 @@ export class PerfilDiscotecaPage implements OnInit {
|
||||
this.getTelefono();
|
||||
this.getLocalizacion();
|
||||
this.getEventos();
|
||||
this.getDescripcion();
|
||||
this.editDisabled="true";
|
||||
this.editEnabled="false";
|
||||
this.fotoSrc = '../assets/img/barraca.jpg';
|
||||
this.fotoSrc = '../assets/barraca.jpg';
|
||||
this.fotoLoaded = this.fotoSrc;
|
||||
this.galeriaFotos = this.tab1Service.galeria;
|
||||
this.galeriaFotos = [];
|
||||
|
||||
}
|
||||
|
||||
@ -70,23 +64,16 @@ export class PerfilDiscotecaPage implements OnInit {
|
||||
this.localizacion = this.tab1Service.getLocalizacion();
|
||||
}
|
||||
|
||||
|
||||
getDescripcion(): void{
|
||||
this.descripcion = this.tab1Service.getDescripcion();
|
||||
}
|
||||
|
||||
getEventos(): void{
|
||||
this.eventos = this.tab1Service.eventos;
|
||||
this.eventos = this.tab1Service.getEventos();
|
||||
}
|
||||
|
||||
|
||||
cargarImagen(){
|
||||
this.fotoSrc = this.someURL;
|
||||
}
|
||||
|
||||
addGaleria(){
|
||||
this.tab1Service.galeria.push(this.someURL);
|
||||
this.galeriaFotos = this.tab1Service.galeria;
|
||||
this.galeriaFotos.push(this.someURL);
|
||||
this.slides.update();
|
||||
|
||||
|
||||
@ -124,14 +111,10 @@ export class PerfilDiscotecaPage implements OnInit {
|
||||
let cajaDatos = document.getElementById("cajaDatos");
|
||||
cajaDatos.style.background="white";
|
||||
cajaDatos.style.color="black";
|
||||
cajaDatos.contentEditable = "true";
|
||||
let botones = document.getElementById("botonesHidden1");
|
||||
botones.style.display = "block";
|
||||
let saveButton = document.getElementById("saveButton") as HTMLButtonElement;
|
||||
saveButton.disabled=false;
|
||||
let cancelButton = document.getElementById("cancelButton") as HTMLButtonElement;
|
||||
cancelButton.disabled=false;
|
||||
|
||||
botones = document.getElementById("botonesHidden2");
|
||||
botones.style.display = "block";
|
||||
|
||||
|
||||
|
||||
@ -143,7 +126,6 @@ export class PerfilDiscotecaPage implements OnInit {
|
||||
let cajaDatos = document.getElementById("cajaDatos");
|
||||
cajaDatos.style.background="inherit";
|
||||
cajaDatos.style.color="inherit";
|
||||
cajaDatos.contentEditable="false";
|
||||
let botones = document.getElementById("botonesHidden1");
|
||||
botones.style.display = "none";
|
||||
botones = document.getElementById("botonesHidden2");
|
||||
@ -176,31 +158,14 @@ export class PerfilDiscotecaPage implements OnInit {
|
||||
this.slides.update();
|
||||
}
|
||||
|
||||
addEvento() {
|
||||
this.tab1Service.editarEvento=false;
|
||||
addEvento() {
|
||||
this.router.navigate(['/tabs/tab1/prompt-evento']);
|
||||
}
|
||||
|
||||
mostrarEvento(evento: Eventoi){
|
||||
mostrarEvento(evento: Evento){
|
||||
this.tab1Service.eventoIndex = this.eventos.indexOf(evento);
|
||||
this.router.navigate(['/tabs/tab1/view-evento']);
|
||||
}
|
||||
|
||||
editarEvento(evento: Eventoi){
|
||||
this.tab1Service.eventoIndex = this.eventos.indexOf(evento);
|
||||
this.tab1Service.editarEvento = true;
|
||||
this.tab1Service.initEventoForms();
|
||||
this.router.navigate(['/tabs/tab1/prompt-evento']);
|
||||
}
|
||||
|
||||
openPreview(foto: string){
|
||||
this.modalController.create({
|
||||
component: GaleriamodalPage,
|
||||
componentProps: {
|
||||
foto: foto
|
||||
}
|
||||
}).then(modal=>modal.present());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { PerfilUsuarioPage } from './perfil-usuario.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PerfilUsuarioPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class PerfilUsuarioPageRoutingModule {}
|
@ -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 { PerfilUsuarioPageRoutingModule } from './perfil-usuario-routing.module';
|
||||
|
||||
import { PerfilUsuarioPage } from './perfil-usuario.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
PerfilUsuarioPageRoutingModule
|
||||
],
|
||||
declarations: [PerfilUsuarioPage]
|
||||
})
|
||||
export class PerfilUsuarioPageModule {}
|
@ -1,14 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Mi perfil</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div *ngIf="codigos?.length>0">
|
||||
<div *ngFor="let codigo of codigos">
|
||||
Tu código: {{codigo.codigo}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { PerfilUsuarioPage } from './perfil-usuario.page';
|
||||
|
||||
describe('PerfilUsuarioPage', () => {
|
||||
let component: PerfilUsuarioPage;
|
||||
let fixture: ComponentFixture<PerfilUsuarioPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PerfilUsuarioPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(PerfilUsuarioPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,25 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Codigo } from '../interfaces/codigo';
|
||||
import { ApiService } from '../services/api.service';
|
||||
import { LoginService } from '../services/login.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-perfil-usuario',
|
||||
templateUrl: './perfil-usuario.page.html',
|
||||
styleUrls: ['./perfil-usuario.page.scss'],
|
||||
})
|
||||
export class PerfilUsuarioPage implements OnInit {
|
||||
|
||||
codigos: Codigo[];
|
||||
|
||||
constructor(private apiService: ApiService, private loginService: LoginService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.apiService.getCodigosUsuario(this.loginService.user)
|
||||
.subscribe(codigos => {
|
||||
this.codigos = codigos;
|
||||
console.log(this.codigos);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
@ -7,9 +7,7 @@ const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PromptEventoPage
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@ -7,61 +7,33 @@
|
||||
<ion-content>
|
||||
<form [formGroup]="eventoForm" (ngSubmit)="onSubmit()">
|
||||
|
||||
<ion-item>
|
||||
<div class="campoInput">
|
||||
<label>
|
||||
Nombre del evento:
|
||||
<input type="text" id="nombre" formControlName = "nombre">
|
||||
<input type="text" formControlName = "nombre">
|
||||
</label>
|
||||
<span
|
||||
*ngIf="nombre?.errors?.required && (nombre.touched||submitted)">
|
||||
Tu evento necesita un nombre
|
||||
</span>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<ion-item>
|
||||
<div class="campoInput">
|
||||
<label>
|
||||
Fecha:
|
||||
<ion-datetime displayFormat="YYYY/DD/MM"placeholder="Elegir Fecha" formControlName="fecha"></ion-datetime>
|
||||
<ion-datetime displayFormat="DD/MM, HH:mm"placeholder="Elegir Fecha" formControlName="fecha"></ion-datetime>
|
||||
</label>
|
||||
<span
|
||||
*ngIf="fecha?.errors?.required && submitted">
|
||||
Tu evento necesita una fecha
|
||||
</span>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<ion-item>
|
||||
<div class="campoInput">
|
||||
<label>
|
||||
Hora
|
||||
<ion-datetime displayFormat="HH:mm"placeholder="Elegir Hora" formControlName="hora"></ion-datetime>
|
||||
Descripción:
|
||||
<input type="text" formControlName = "descripcion">
|
||||
</label>
|
||||
<span
|
||||
*ngIf="hora?.errors?.required && submitted">
|
||||
Tu evento necesita una hora
|
||||
</span>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
|
||||
<ion-item>
|
||||
<div class="campoInput">
|
||||
<label>
|
||||
Precio:
|
||||
<input type="number" formControlName = "precio1"><label>, </label><input type="number" formControlName = "precio2">
|
||||
</label>
|
||||
<span
|
||||
*ngIf="precio1?.errors?.required && (precio1.touched||submitted)">
|
||||
Tu evento necesita un precio (puede ser 0)
|
||||
</span>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<label>
|
||||
Descripción:
|
||||
<textarea formControlName = "descripcion" rows="10"></textarea>
|
||||
</label>
|
||||
<span
|
||||
*ngIf="descripcion?.errors?.required && (descripcion.touched||submitted)">
|
||||
¡Dale una descripción a tu evento!
|
||||
</span>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<button type="submit">GUARDAR</button>
|
||||
</form>
|
||||
|
@ -1,33 +1,12 @@
|
||||
*{
|
||||
--ion-text-color: #fbffc4;
|
||||
padding: 15px;
|
||||
--ion-text-color: #000000;
|
||||
padding: 5px;
|
||||
letter-spacing: 2px;
|
||||
|
||||
}
|
||||
|
||||
ion-item{
|
||||
text-align: center;
|
||||
color: wheat,
|
||||
.campoInput{
|
||||
display: block;
|
||||
}
|
||||
|
||||
input{
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
color: black;
|
||||
}
|
||||
|
||||
label{
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
color: wheat,
|
||||
}
|
||||
|
||||
textarea{
|
||||
color: black;
|
||||
}
|
||||
|
||||
span{
|
||||
color: red;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
|
@ -1,108 +1,48 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { Tab1Service } from '../tab1/tab1.service';
|
||||
import { Evento } from '../evento';
|
||||
import { Router } from '@angular/router';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-prompt-evento',
|
||||
templateUrl: './prompt-evento.page.html',
|
||||
styleUrls: ['./prompt-evento.page.scss'],
|
||||
})
|
||||
export class PromptEventoPage implements OnInit{
|
||||
|
||||
evento: Eventoi;
|
||||
submitted = false;
|
||||
editarEvento = false;
|
||||
export class PromptEventoPage{
|
||||
eventoForm = new FormGroup({
|
||||
nombre: new FormControl(null, Validators.required),
|
||||
fecha: new FormControl(null, Validators.required),
|
||||
hora: new FormControl(null, Validators.required),
|
||||
precio1: new FormControl(null, Validators.required),
|
||||
precio2: new FormControl(null, Validators.required),
|
||||
descripcion: new FormControl(null, Validators.required),
|
||||
nombre: new FormControl(''),
|
||||
fecha: new FormControl(''),
|
||||
hora: new FormControl(''),
|
||||
precio1: new FormControl(''),
|
||||
precio2: new FormControl(''),
|
||||
descripcion: new FormControl('')
|
||||
});
|
||||
|
||||
eventos: Eventoi[];
|
||||
eventos: Evento[];
|
||||
|
||||
constructor(private tab1Service: Tab1Service, private router: Router) {
|
||||
|
||||
this.eventos = [];
|
||||
}
|
||||
|
||||
ngOnInit(){
|
||||
if (this.tab1Service.editarEvento==true){
|
||||
this.eventoForm = this.tab1Service.eventoForms[this.tab1Service.eventoIndex];
|
||||
}
|
||||
}
|
||||
onSubmit(){
|
||||
this.submitted = true;
|
||||
if (this.eventoForm.valid){
|
||||
if (this.tab1Service.editarEvento == true){
|
||||
this.asignarEvento(this.tab1Service.eventos[this.tab1Service.eventoIndex])}
|
||||
else{
|
||||
this.asignarEvento(this.initEventoVacio());
|
||||
};
|
||||
let evento = new Evento();
|
||||
this.asignarEvento(evento);
|
||||
this.router.navigate(['/tabs/tab1/perfil-discoteca']);
|
||||
}
|
||||
}
|
||||
|
||||
asignarEvento(evento: Eventoi){
|
||||
evento.nombre = this.eventoForm.get('nombre').value;
|
||||
evento.descripcion = this.eventoForm.get('descripcion').value;
|
||||
var fecha = this.eventoForm.get('fecha').value;
|
||||
fecha = fecha.split("T")[0];
|
||||
evento.fecha = fecha;
|
||||
var hora = this.eventoForm.get('hora').value;
|
||||
if (!this.tab1Service.editarEvento){
|
||||
hora = hora.split("T")[1];}
|
||||
hora = hora.split(":")[0]+(":")+hora.split(":")[1];
|
||||
evento.hora = hora;
|
||||
evento.precio1 = this.eventoForm.get('precio1').value;
|
||||
evento.precio2 = this.eventoForm.get('precio2').value;
|
||||
asignarEvento(evento: Evento){
|
||||
evento.setNombre(this.eventoForm.get('nombre').value);
|
||||
evento.setDesc(this.eventoForm.get('descripcion').value);
|
||||
evento.setFecha(this.eventoForm.get('fecha').value);
|
||||
evento.setPrecio1(this.eventoForm.get('precio1').value);
|
||||
evento.setPrecio2(this.eventoForm.get('precio2').value);
|
||||
//evento.setDia(evento.getFecha()); el datetime de Ion devuelve un String, no se puede
|
||||
//evento.setHora(evento.getFecha()); transformar en dia y hora
|
||||
if (!this.tab1Service.eventos){
|
||||
this.tab1Service.eventos=[];}
|
||||
if(!this.tab1Service.eventoForms){
|
||||
this.tab1Service.initEventoForms();}
|
||||
this.tab1Service.postEvento(evento);
|
||||
this.tab1Service.initEventos();}
|
||||
this.tab1Service.eventos.push(evento);
|
||||
}
|
||||
|
||||
get nombre(){
|
||||
return this.eventoForm.get('nombre');
|
||||
}
|
||||
|
||||
get fecha(){
|
||||
return this.eventoForm.get('fecha');
|
||||
}
|
||||
|
||||
get hora(){
|
||||
return this.eventoForm.get('hora');
|
||||
}
|
||||
|
||||
get precio1() {
|
||||
return this.eventoForm.get('precio1');
|
||||
}
|
||||
|
||||
get precio2() {
|
||||
return this.eventoForm.get('precio2');
|
||||
}
|
||||
|
||||
get descripcion(){
|
||||
return this.eventoForm.get('descripcion');
|
||||
}
|
||||
|
||||
initEventoVacio(): Eventoi{
|
||||
let evento = {
|
||||
id: 0,
|
||||
discotecaID: this.tab1Service.discotecaI.discotecaID,
|
||||
nombre: this.tab1Service.discotecaI.localizacion,
|
||||
localizacion: '',
|
||||
fecha: null,
|
||||
hora: null,
|
||||
precio1: 0,
|
||||
precio2: 0,
|
||||
descripcion: ''
|
||||
}
|
||||
return evento;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
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 {}
|
@ -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 { ReservamodalPageRoutingModule } from './reservamodal-routing.module';
|
||||
|
||||
import { ReservamodalPage } from './reservamodal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ReservamodalPageRoutingModule
|
||||
],
|
||||
declarations: [ReservamodalPage]
|
||||
})
|
||||
export class ReservamodalPageModule {}
|
@ -1,12 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>reservamodal</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
¡Reserva realizada!
|
||||
Tu código de reserva:
|
||||
{{codigoReserva}}
|
||||
Descuento del {{descuento}} %
|
||||
</ion-content>
|
@ -1,24 +0,0 @@
|
||||
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();
|
||||
});
|
||||
});
|
@ -1,23 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-reservamodal',
|
||||
templateUrl: './reservamodal.page.html',
|
||||
styleUrls: ['./reservamodal.page.scss'],
|
||||
})
|
||||
export class ReservamodalPage implements OnInit {
|
||||
|
||||
codigoReserva: string;
|
||||
descuento: number;
|
||||
constructor(private navParams: NavParams) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.codigoReserva = this.navParams.get('codigo');
|
||||
this.descuento = this.navParams.get('descuento');
|
||||
if(!this.descuento){
|
||||
this.descuento = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ApiService } from './api.service';
|
||||
|
||||
describe('ApiService', () => {
|
||||
let service: ApiService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ApiService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,67 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable, throwError, BehaviorSubject } from 'rxjs';
|
||||
import { catchError, retry, map, tap } from 'rxjs/operators';
|
||||
import { User } from '../interfaces/user';
|
||||
import { Codigo } from '../interfaces/codigo'
|
||||
import { Discoteca } from '../discoteca';
|
||||
import { UserLogin } from '../interfaces/user-login';
|
||||
import { DiscotecaI } from '../interfaces/discoteca-i';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { Reservai } from '../interfaces/reservai';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ApiService {
|
||||
|
||||
baseUrl = "http://localhost:3307/api/consultas";
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
validateUser(user: UserLogin): Observable<User>{
|
||||
|
||||
return this.http.post<User>(this.baseUrl+"/users", user)
|
||||
|
||||
}
|
||||
|
||||
getUserDiscoteca(discotecaId: number): Observable<DiscotecaI>{
|
||||
|
||||
return this.http.post<DiscotecaI>(this.baseUrl+"/discoteca", { "id": discotecaId});
|
||||
|
||||
}
|
||||
|
||||
postEvento(eventoInterface: Eventoi): Observable<Eventoi>{
|
||||
|
||||
return this.http.post<Eventoi>(this.baseUrl+"/evento", eventoInterface);
|
||||
|
||||
}
|
||||
|
||||
getEventos(): Observable<Eventoi[]>{
|
||||
|
||||
return this.http.get<Eventoi[]>(this.baseUrl+"/evento");
|
||||
}
|
||||
|
||||
getEventosDiscoteca(discotecaID: number): Observable<Eventoi[]>{
|
||||
|
||||
return this.http.post<Eventoi[]>(this.baseUrl+"/eventosDiscoteca", {"id": discotecaID});
|
||||
|
||||
|
||||
}
|
||||
|
||||
creaReserva(reserva: Reservai): Observable<Reservai>{
|
||||
return this.http.post<Reservai>(this.baseUrl+"/reserva", reserva);
|
||||
}
|
||||
|
||||
getCodigosUsuario(user: User){
|
||||
return this.http.post<Codigo[]>(this.baseUrl+"/codigosUsuario", user);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CodigoreservaService } from './codigoreserva.service';
|
||||
|
||||
describe('CodigoreservaService', () => {
|
||||
let service: CodigoreservaService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(CodigoreservaService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,27 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CodigoreservaService {
|
||||
|
||||
codigo: string;
|
||||
length: number;
|
||||
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
generarAleatorio(){
|
||||
this.length = 7;
|
||||
var result = [];
|
||||
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
var charactersLength = characters.length;
|
||||
for ( var i = 0; i < this.length; i++ ) {
|
||||
result.push(characters.charAt(Math.floor(Math.random() *
|
||||
charactersLength)));
|
||||
}
|
||||
return result.join("");
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { FeedService } from './feed.service';
|
||||
|
||||
describe('FeedService', () => {
|
||||
let service: FeedService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(FeedService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,31 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { DiscotecaI } from '../interfaces/discoteca-i';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { ApiService } from './api.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FeedService {
|
||||
|
||||
eventos: Eventoi[];
|
||||
eventoIndex: number;
|
||||
discotecaEvento: DiscotecaI;
|
||||
|
||||
constructor(private apiService: ApiService, private router: Router) { }
|
||||
|
||||
initFeed(): void{
|
||||
this.apiService.getEventos()
|
||||
.subscribe(eventos => {
|
||||
this.eventos = eventos;
|
||||
this.router.navigate(['/tabsUser'])
|
||||
})
|
||||
}
|
||||
|
||||
getEventoByIndex(eventoIndex: number):Eventoi{
|
||||
return this.eventos[eventoIndex];
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LoginService } from './login.service';
|
||||
|
||||
describe('LoginService', () => {
|
||||
let service: LoginService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(LoginService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,47 +0,0 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { VirtualTimeScheduler } from 'rxjs';
|
||||
import { ApiService } from './api.service';
|
||||
import { Tab1Service } from '../tab1/tab1.service';
|
||||
import { User } from '../interfaces/user';
|
||||
import { UserLogin } from '../interfaces/user-login';
|
||||
import { FeedService } from './feed.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LoginService {
|
||||
|
||||
user: User;
|
||||
|
||||
constructor(private apiService: ApiService, private router: Router, private tab1service: Tab1Service, private feedService: FeedService) {
|
||||
this.user = {
|
||||
userID: 0,
|
||||
discotecaID: 0,
|
||||
userType: 0,
|
||||
username: '',
|
||||
};
|
||||
}
|
||||
|
||||
validateUser(login: string, password: string): void{
|
||||
|
||||
let userlogin: UserLogin = {
|
||||
loginUser: login,
|
||||
loginPassword: password,
|
||||
}
|
||||
|
||||
this.apiService.validateUser(userlogin)
|
||||
.subscribe(user => {
|
||||
this.user = user[0];
|
||||
if (this.user.userType==0)
|
||||
this.tab1service.getDiscoteca(this.user.discotecaID);
|
||||
else if (this.user.userType==1)
|
||||
this.feedService.initFeed();
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -6,19 +6,17 @@ import { PromptEventoPage } from '../prompt-evento/prompt-evento.page'
|
||||
import { ViewEventoPage } from '../view-evento/view-evento.page'
|
||||
|
||||
const routes: Routes = [
|
||||
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'perfil-discoteca',
|
||||
pathMatch: 'full',
|
||||
},
|
||||
|
||||
{
|
||||
path: 'perfil-discoteca',
|
||||
component: PerfilDiscotecaPage
|
||||
},
|
||||
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'perfil-discoteca',
|
||||
pathMatch: 'full,'
|
||||
},
|
||||
|
||||
{
|
||||
path: 'prompt-evento',
|
||||
component: PromptEventoPage
|
||||
|
@ -6,6 +6,7 @@ import { PerfilDiscotecaPage } from '../perfil-discoteca/perfil-discoteca.page'
|
||||
import { IonSlides} from '@ionic/angular';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { ViewChild } from '@angular/core';
|
||||
import { Evento } from '../evento';
|
||||
import { Router } from '@angular/router';
|
||||
import { from } from 'rxjs';
|
||||
|
||||
|
@ -2,13 +2,9 @@ import { Injectable, OnInit } from '@angular/core';
|
||||
import { stringify } from 'querystring';
|
||||
import { Tab1Page } from './tab1.page'
|
||||
import { Discoteca } from '../discoteca'
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { Galeria } from '../galeria';
|
||||
import { Evento } from '../evento';
|
||||
import { NumericValueAccessor } from '@ionic/angular';
|
||||
import { DiscotecaI } from '../interfaces/discoteca-i';
|
||||
import { ApiService } from '../services/api.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
|
||||
|
||||
@Injectable({
|
||||
@ -17,109 +13,53 @@ import { Eventoi } from '../interfaces/eventoi';
|
||||
export class Tab1Service implements OnInit{
|
||||
|
||||
discoteca: Discoteca;
|
||||
discotecaI: DiscotecaI;
|
||||
galeria: string[];
|
||||
eventos: Eventoi[];
|
||||
eventoForms: FormGroup[];
|
||||
galeria: Galeria;
|
||||
eventos: Evento[];
|
||||
eventoIndex: number;
|
||||
editarEvento: boolean;
|
||||
|
||||
constructor(private apiService: ApiService, private router: Router) {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit(){
|
||||
|
||||
this.initValues();
|
||||
}
|
||||
|
||||
initValues(): void{
|
||||
this.discoteca = new Discoteca();
|
||||
this.discoteca.setId(this.discotecaI.discotecaID);
|
||||
this.discoteca.setNombre(this.discotecaI.nombre);
|
||||
this.discoteca.setTelefono(this.discotecaI.telefono);
|
||||
this.discoteca.setLocalizacion(this.discotecaI.localizacion);
|
||||
this.discoteca.setNombre('Barraca');
|
||||
this.discoteca.setTelefono(666666666);
|
||||
this.discoteca.setLocalizacion('Calle del Barquillo');
|
||||
this.galeria = new Galeria();
|
||||
this.initEventos();
|
||||
this.galeria = [];
|
||||
this.editarEvento = false;
|
||||
this.galeria.setDiscoteca(this.discoteca.getNombre());
|
||||
}
|
||||
|
||||
getNombre(): string{
|
||||
this.initValues();
|
||||
return this.discoteca.getNombre();
|
||||
}
|
||||
|
||||
getTelefono(): number{
|
||||
this.initValues();
|
||||
return this.discoteca.getTelefono();
|
||||
}
|
||||
|
||||
getLocalizacion(): string{
|
||||
this.initValues();
|
||||
return this.discoteca.getLocalizacion();
|
||||
}
|
||||
|
||||
getEventos(): Eventoi[]{
|
||||
getEventos(): Evento[]{
|
||||
return this.eventos;
|
||||
}
|
||||
|
||||
getDescripcion(): string{
|
||||
return this.discoteca.getDescripcion();
|
||||
}
|
||||
|
||||
initEventos(): void{
|
||||
this.eventos = [];
|
||||
this.apiService.getEventosDiscoteca(this.discoteca.getId())
|
||||
.subscribe(eventos => {
|
||||
this.eventos = eventos;
|
||||
this.router.navigate(['/tabs/tab1/perfil-discoteca']);
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
initEventoForms(): void{
|
||||
this.eventoForms = [];
|
||||
if (this.eventos){
|
||||
this.eventos.forEach(evento => {
|
||||
let thisForm = new FormGroup({
|
||||
nombre: new FormControl(null, Validators.required),
|
||||
fecha: new FormControl(null, Validators.required),
|
||||
hora: new FormControl(null, Validators.required),
|
||||
precio1: new FormControl(null, Validators.required),
|
||||
precio2: new FormControl(null, Validators.required),
|
||||
descripcion: new FormControl(null, Validators.required),
|
||||
});
|
||||
thisForm.patchValue(evento);
|
||||
this.eventoForms.push(thisForm);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
getEventobyIndex(eventoIndex: number){
|
||||
return this.eventos[eventoIndex];
|
||||
}
|
||||
|
||||
getDiscoteca(discotecaId: number){
|
||||
if (discotecaId != 0){
|
||||
this.apiService.getUserDiscoteca(discotecaId)
|
||||
.subscribe(discoteca => {
|
||||
this.discotecaI = discoteca[0];
|
||||
console.log(this.discotecaI);
|
||||
this.initValues();
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
postEvento(evento: Eventoi){
|
||||
this.apiService.postEvento(evento)
|
||||
.subscribe(evento => {
|
||||
this.initEventos();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
updateEvento(evento: Eventoi){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,23 +1,11 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { FeedPage } from '../feed/feed.page';
|
||||
import { Tab2Page } from './tab2.page';
|
||||
import { ViewEventoClientePage } from '../view-evento-cliente/view-evento-cliente.page';
|
||||
import { ViewDiscotecaClientePage } from '../view-discoteca-cliente/view-discoteca-cliente.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: FeedPage,
|
||||
|
||||
},
|
||||
{
|
||||
path: 'view-evento-cliente',
|
||||
component: ViewEventoClientePage
|
||||
},
|
||||
{
|
||||
path: 'view-discoteca-cliente',
|
||||
component: ViewDiscotecaClientePage
|
||||
component: Tab2Page,
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -0,0 +1,56 @@
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="utf-8">
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<meta name="page_type" content="np-template-header-footer-from-plugin">
|
||||
<title>Página 1</title>
|
||||
<link rel="stylesheet" href="nicepage.css" media="screen">
|
||||
<link rel="stylesheet" href="Página-1.css" media="screen">
|
||||
<script class="u-script" type="text/javascript" src="jquery.js" defer=""></script>
|
||||
<script class="u-script" type="text/javascript" src="nicepage.js" defer=""></script>
|
||||
<meta name="generator" content="Nicepage 3.0.9, nicepage.com">
|
||||
<link id="u-theme-google-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i|Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i">
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Página 1">
|
||||
<meta property="og:type" content="website">
|
||||
<meta name="theme-color" content="#478ac9">
|
||||
<link rel="canonical" href="index.html">
|
||||
<meta property="og:url" content="index.html">
|
||||
</head>
|
||||
<body class="u-body">
|
||||
<section class="u-clearfix u-section-1" id="sec-6396">
|
||||
<div class="u-clearfix u-sheet u-sheet-1">
|
||||
<div class="u-clearfix u-expanded-width u-layout-wrap u-layout-wrap-1">
|
||||
<div class="u-layout">
|
||||
<div class="u-layout-row">
|
||||
<div class="u-size-30">
|
||||
<div class="u-layout-col">
|
||||
<div class="u-container-style u-layout-cell u-size-60 u-layout-cell-1">
|
||||
|
||||
<div class="u-container-layout u-container-layout-1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-size-30">
|
||||
<div class="u-layout-col">
|
||||
<div class="u-container-style u-layout-cell u-size-30 u-layout-cell-2">
|
||||
<div class="u-container-layout u-container-layout-2"></div>
|
||||
</div>
|
||||
<div class="u-container-style u-layout-cell u-size-30 u-layout-cell-3">
|
||||
<div class="u-container-layout u-container-layout-3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
@ -1,19 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { FeedService } from '../services/feed.service';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tab2',
|
||||
templateUrl: 'tab2.page.html',
|
||||
styleUrls: ['tab2.page.scss']
|
||||
})
|
||||
export class Tab2Page implements OnInit{
|
||||
|
||||
export class Tab2Page {
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { PerfilUsuarioPage } from '../perfil-usuario/perfil-usuario.page';
|
||||
import { Tab3Page } from './tab3.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PerfilUsuarioPage,
|
||||
component: Tab3Page,
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -1,34 +0,0 @@
|
||||
import { FullscreenOverlayContainer } from '@angular/cdk/overlay';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { TabsUserPage } from './tabs-user.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: TabsUserPage,
|
||||
children: [
|
||||
{
|
||||
path: 'tab2',
|
||||
loadChildren: ()=> import('../tab2/tab2.module').then(m=>m.Tab2PageModule),
|
||||
},
|
||||
|
||||
{
|
||||
path: 'tab3',
|
||||
loadChildren: ()=> import('../tab3/tab3.module').then(m=>m.Tab3PageModule),
|
||||
},
|
||||
|
||||
{
|
||||
path:'',
|
||||
redirectTo: 'tab2',
|
||||
pathMatch: 'full'
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class TabsUserPageRoutingModule {}
|
@ -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 { TabsUserPageRoutingModule } from './tabs-user-routing.module';
|
||||
|
||||
import { TabsUserPage } from './tabs-user.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
TabsUserPageRoutingModule
|
||||
],
|
||||
declarations: [TabsUserPage]
|
||||
})
|
||||
export class TabsUserPageModule {}
|
@ -1,17 +0,0 @@
|
||||
<ion-tabs>
|
||||
|
||||
<ion-tab-bar slot="bottom">
|
||||
<ion-tab-button tab="tab2">
|
||||
<ion-icon name="search-outline"></ion-icon>
|
||||
<ion-label>Feed</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<ion-tab-button tab="tab3">
|
||||
<ion-icon name="accessibility-outline"></ion-icon>
|
||||
<ion-label>Mi Perfil</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
|
||||
</ion-tab-bar>
|
||||
|
||||
</ion-tabs>
|
@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { TabsUserPage } from './tabs-user.page';
|
||||
|
||||
describe('TabsUserPage', () => {
|
||||
let component: TabsUserPage;
|
||||
let fixture: ComponentFixture<TabsUserPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TabsUserPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(TabsUserPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,15 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tabs-user',
|
||||
templateUrl: './tabs-user.page.html',
|
||||
styleUrls: ['./tabs-user.page.scss'],
|
||||
})
|
||||
export class TabsUserPage implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
@ -4,24 +4,33 @@ import { TabsPage } from './tabs.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
path: 'tabs',
|
||||
component: TabsPage,
|
||||
children: [
|
||||
{
|
||||
path: 'tab1',
|
||||
loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule),
|
||||
loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule)
|
||||
},
|
||||
{
|
||||
path: 'tab2',
|
||||
loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
|
||||
},
|
||||
{
|
||||
path: 'tab3',
|
||||
loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
|
||||
},
|
||||
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'tab1',
|
||||
redirectTo: '/tabs/tab1',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
redirectTo: 'tabs',
|
||||
redirectTo: '/tabs/tab1',
|
||||
pathMatch: 'full'
|
||||
}
|
||||
];
|
||||
|
@ -2,11 +2,19 @@
|
||||
|
||||
<ion-tab-bar slot="bottom">
|
||||
<ion-tab-button tab="tab1">
|
||||
<ion-icon name="home-outline"></ion-icon>
|
||||
<ion-label>Perfil</ion-label>
|
||||
<ion-icon name="triangle"></ion-icon>
|
||||
<ion-label>Tab 1</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<ion-tab-button tab="tab2">
|
||||
<ion-icon name="ellipse"></ion-icon>
|
||||
<ion-label>Tab 2</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
<ion-tab-button tab="tab3">
|
||||
<ion-icon name="square"></ion-icon>
|
||||
<ion-label>Tab 3</ion-label>
|
||||
</ion-tab-button>
|
||||
</ion-tab-bar>
|
||||
|
||||
</ion-tabs>
|
||||
|
@ -1,17 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ViewDiscotecaClientePage } from './view-discoteca-cliente.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ViewDiscotecaClientePage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ViewDiscotecaClientePageRoutingModule {}
|
@ -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 { ViewDiscotecaClientePageRoutingModule } from './view-discoteca-cliente-routing.module';
|
||||
|
||||
import { ViewDiscotecaClientePage } from './view-discoteca-cliente.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ViewDiscotecaClientePageRoutingModule
|
||||
],
|
||||
declarations: [ViewDiscotecaClientePage]
|
||||
})
|
||||
export class ViewDiscotecaClientePageModule {}
|
@ -1,9 +0,0 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>view-discoteca-cliente</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
|
||||
</ion-content>
|
@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ViewDiscotecaClientePage } from './view-discoteca-cliente.page';
|
||||
|
||||
describe('ViewDiscotecaClientePage', () => {
|
||||
let component: ViewDiscotecaClientePage;
|
||||
let fixture: ComponentFixture<ViewDiscotecaClientePage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewDiscotecaClientePage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ViewDiscotecaClientePage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,28 +0,0 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { DiscotecaI } from '../interfaces/discoteca-i';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { FeedService } from '../services/feed.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-discoteca-cliente',
|
||||
templateUrl: './view-discoteca-cliente.page.html',
|
||||
styleUrls: ['./view-discoteca-cliente.page.scss'],
|
||||
})
|
||||
export class ViewDiscotecaClientePage implements OnInit {
|
||||
|
||||
discoteca: DiscotecaI
|
||||
eventos: Eventoi[]
|
||||
|
||||
constructor(private feedService: FeedService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.eventos = [];
|
||||
this.discoteca = this.feedService.discotecaEvento;
|
||||
this.feedService.eventos.forEach(evento => {
|
||||
if (this.discoteca.discotecaID == evento.discotecaID){
|
||||
this.eventos.push(evento);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { ViewDiscotecaClientePage } from '../view-discoteca-cliente/view-discoteca-cliente.page';
|
||||
|
||||
import { ViewEventoClientePage } from './view-evento-cliente.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ViewEventoClientePage
|
||||
},
|
||||
{
|
||||
path: 'view-discoteca-cliente',
|
||||
component: ViewDiscotecaClientePage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ViewEventoClientePageRoutingModule {}
|
@ -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 {}
|
@ -1,39 +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>
|
||||
<ion-row>
|
||||
<div class="discotecaEvento">
|
||||
<a [routerLink]="['/tabsUser/tab2/view-discoteca-cliente']">{{discoteca?.nombre}}</a>
|
||||
</div>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-button (click)="openReserva()">
|
||||
Reserva
|
||||
</ion-button>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<span>Código de descuento: </span><input type="text" id="codigoDescuento">
|
||||
</ion-row>
|
||||
</div>
|
||||
</ion-grid>
|
||||
</ion-content>
|
@ -1,3 +0,0 @@
|
||||
.discotecaEvento{
|
||||
padding: 40px;
|
||||
}
|
@ -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();
|
||||
});
|
||||
});
|
@ -1,79 +0,0 @@
|
||||
import { stringify } from '@angular/compiler/src/util';
|
||||
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 { ApiService } from '../services/api.service';
|
||||
import { CodigoreservaService } from '../services/codigoreserva.service';
|
||||
import { FeedService } from '../services/feed.service';
|
||||
import { LoginService } from '../services/login.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;
|
||||
discoteca: DiscotecaI;
|
||||
reserva: Reservai;
|
||||
codigoReserva: string;
|
||||
reservaRealizada: boolean;
|
||||
|
||||
constructor(private feedService: FeedService, private modalController: ModalController,
|
||||
private codigoReservaService: CodigoreservaService, private loginService: LoginService, private apiService: ApiService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.reservaRealizada = false;
|
||||
this.evento = this.feedService.getEventoByIndex(this.feedService.eventoIndex);
|
||||
this.discoteca = this.feedService.discotecaEvento;
|
||||
}
|
||||
|
||||
generarCodigo(){
|
||||
return stringify(this.codigoReservaService.generarAleatorio());
|
||||
}
|
||||
|
||||
initReserva(){
|
||||
this.reserva = {
|
||||
UserID: this.loginService.user.userID,
|
||||
EventoID: this.evento.id,
|
||||
codigoDescuento: null,
|
||||
codigoUnico: '',
|
||||
codigoUnicoID: null,
|
||||
descuentoPorciento: null
|
||||
}
|
||||
}
|
||||
|
||||
openReserva(){
|
||||
this.initReserva();
|
||||
this.reserva.codigoDescuento = (<HTMLInputElement>document.getElementById("codigoDescuento")).value;
|
||||
this.reserva.codigoUnico = this.generarCodigo();
|
||||
this.creaReserva(this.reserva);
|
||||
}
|
||||
|
||||
creaReserva(reserva){
|
||||
this.apiService.creaReserva(reserva)
|
||||
.subscribe(
|
||||
data => {
|
||||
console.log(data);
|
||||
this.reserva = data;
|
||||
this.reservaRealizada = true;
|
||||
this.modalController.create({
|
||||
component: ReservamodalPage,
|
||||
componentProps : {
|
||||
codigo: this.reserva.codigoUnico,
|
||||
descuento: this.reserva.descuentoPorciento
|
||||
}
|
||||
|
||||
}).then(modal => modal.present());
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
@ -5,22 +5,5 @@
|
||||
</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>
|
||||
<label>{{evento.nombre}}</label>
|
||||
</ion-content>
|
||||
|
@ -1,17 +0,0 @@
|
||||
.eventoHeader{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.eventoDesc{
|
||||
color: white;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.evento{
|
||||
display: block;
|
||||
max-width: 800px;
|
||||
max-height: auto;
|
||||
margin: auto;
|
||||
text-align: justify;
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { Evento } from '../evento';
|
||||
import { Tab1Service } from '../tab1/tab1.service';
|
||||
|
||||
@Component({
|
||||
@ -9,7 +9,7 @@ import { Tab1Service } from '../tab1/tab1.service';
|
||||
})
|
||||
export class ViewEventoPage implements OnInit {
|
||||
|
||||
evento: Eventoi;
|
||||
evento: Evento;
|
||||
|
||||
constructor(private tab1Service: Tab1Service) { }
|
||||
|
||||
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
Loading…
Reference in New Issue
Block a user