diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8ede31a..4f354c8 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -8,14 +8,7 @@ const routes: Routes = [ loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) }, - { - path: 'prompt-evento', - loadChildren: () => import('./prompt-evento/prompt-evento.module').then( m => m.PromptEventoPageModule) - }, - { - path: 'perfil-discoteca', - loadChildren: () => import('./perfil-discoteca/perfil-discoteca.module').then( m => m.PerfilDiscotecaPageModule) - }, + ]; @NgModule({ imports: [ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index f111814..afcb8df 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -8,9 +8,10 @@ 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'; @NgModule({ - declarations: [AppComponent], + declarations: [AppComponent, PerfilDiscotecaPage], entryComponents: [], imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule], providers: [ diff --git a/src/app/perfil-discoteca/perfil-discoteca-routing.module.ts b/src/app/perfil-discoteca/perfil-discoteca-routing.module.ts index 541b7ed..05f6906 100644 --- a/src/app/perfil-discoteca/perfil-discoteca-routing.module.ts +++ b/src/app/perfil-discoteca/perfil-discoteca-routing.module.ts @@ -1,13 +1,17 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - +import { Routes, RouterModule, ChildrenOutletContexts } from '@angular/router'; import { PerfilDiscotecaPage } from './perfil-discoteca.page'; +import { PromptEventoPage} from '../prompt-evento/prompt-evento.page' const routes: Routes = [ { path: '', - component: PerfilDiscotecaPage - } + component: PerfilDiscotecaPage, + + }, + + + ]; @NgModule({ diff --git a/src/app/perfil-discoteca/perfil-discoteca.module.ts b/src/app/perfil-discoteca/perfil-discoteca.module.ts index b81576f..978a0d3 100644 --- a/src/app/perfil-discoteca/perfil-discoteca.module.ts +++ b/src/app/perfil-discoteca/perfil-discoteca.module.ts @@ -1,19 +1,22 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; - import { IonicModule } from '@ionic/angular'; - import { PerfilDiscotecaPageRoutingModule } from './perfil-discoteca-routing.module'; - import { PerfilDiscotecaPage } from './perfil-discoteca.page'; +import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - PerfilDiscotecaPageRoutingModule + PerfilDiscotecaPageRoutingModule, + ExploreContainerComponentModule, + ], + + exports: [ + PerfilDiscotecaPage ], declarations: [PerfilDiscotecaPage] }) diff --git a/src/app/perfil-discoteca/perfil-discoteca.page.html b/src/app/perfil-discoteca/perfil-discoteca.page.html index 09c0a82..d6a22c0 100644 --- a/src/app/perfil-discoteca/perfil-discoteca.page.html +++ b/src/app/perfil-discoteca/perfil-discoteca.page.html @@ -1,6 +1,8 @@ - + - Mi Perfil + + Mi Perfil + @@ -15,7 +17,6 @@
-
{{nombre}}
@@ -87,4 +88,4 @@ - + \ No newline at end of file diff --git a/src/app/perfil-discoteca/perfil-discoteca.page.scss b/src/app/perfil-discoteca/perfil-discoteca.page.scss index e69de29..7292cb9 100644 --- a/src/app/perfil-discoteca/perfil-discoteca.page.scss +++ b/src/app/perfil-discoteca/perfil-discoteca.page.scss @@ -0,0 +1,65 @@ +:root {--ion-background-color: #494949; + --ion-background-color-rgb: 73,73,73; + + --ion-text-color: #eeeeee; + --ion-text-color-rgb: 238,238,238;} + + *{ + padding: 5px; + letter-spacing: 2px; + } + .titulo{ + font: "arial"; + + } + .fotoPerfil{ + display: block; + text-align: end; + max-width: 800px; + max-height: auto; + margin: auto; + } + + .textoPie{ + position: relative; + bottom: 40px; + right: 20px; + float: right; + } + + .addFoto{ + position: relative; + float: left; + } + + .datosDisplay{ + + float: left; + position: relative; + margin: auto; + + } + + .datosLabel{ + color: grey; + } + + .galeria{ + + display: block; + max-width: 300px; + max-height: auto; + margin: auto; + } + + .botonesHidden{ + display: none; + } + + .botonesVisible{ + display: none; + } + + ion-slides { + height: 100%; + } \ No newline at end of file diff --git a/src/app/perfil-discoteca/perfil-discoteca.page.ts b/src/app/perfil-discoteca/perfil-discoteca.page.ts index 125bc79..0516f4f 100644 --- a/src/app/perfil-discoteca/perfil-discoteca.page.ts +++ b/src/app/perfil-discoteca/perfil-discoteca.page.ts @@ -7,6 +7,7 @@ import { AlertController } from '@ionic/angular'; import { ViewChild } from '@angular/core'; import { Evento } from '../evento'; import { Router } from '@angular/router'; +import { THIS_EXPR } from '@angular/compiler/src/output/output_ast'; @Component({ selector: 'app-perfil-discoteca', @@ -160,7 +161,7 @@ export class PerfilDiscotecaPage implements OnInit { } addEvento() { - this.router.navigate(['prompt-evento']); + this.router.navigate(['/tabs/tab1/tab1/prompt-evento']); } } diff --git a/src/app/tab1/tab1-routing.module.ts b/src/app/tab1/tab1-routing.module.ts index 64ec447..1ba5051 100644 --- a/src/app/tab1/tab1-routing.module.ts +++ b/src/app/tab1/tab1-routing.module.ts @@ -1,12 +1,29 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { Tab1Page } from './tab1.page'; +import { PerfilDiscotecaPage } from '../perfil-discoteca/perfil-discoteca.page' +import { PromptEventoPage } from '../prompt-evento/prompt-evento.page' const routes: Routes = [ - { - path: '', - component: Tab1Page, - }, + { + path: '', + redirectTo: 'perfil-discoteca', + pathMatch: 'full', + }, + + { + path: 'perfil-discoteca', + component: PerfilDiscotecaPage + }, + + { + path: 'prompt-evento', + component: PromptEventoPage + }, + + + + ]; diff --git a/src/app/tab1/tab1.module.ts b/src/app/tab1/tab1.module.ts index 135eeae..4ce64b3 100644 --- a/src/app/tab1/tab1.module.ts +++ b/src/app/tab1/tab1.module.ts @@ -3,6 +3,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { Tab1Page } from './tab1.page'; +import { PerfilDiscotecaPageModule} from '../perfil-discoteca/perfil-discoteca.module' import { ExploreContainerComponentModule } from '../explore-container/explore-container.module'; import { Tab1PageRoutingModule } from './tab1-routing.module'; @@ -13,7 +14,8 @@ import { Tab1PageRoutingModule } from './tab1-routing.module'; CommonModule, FormsModule, ExploreContainerComponentModule, - Tab1PageRoutingModule + Tab1PageRoutingModule, + ], declarations: [Tab1Page] }) diff --git a/src/app/tab1/tab1.page.html b/src/app/tab1/tab1.page.html index df82af2..e69de29 100644 --- a/src/app/tab1/tab1.page.html +++ b/src/app/tab1/tab1.page.html @@ -1,92 +0,0 @@ - - - - Mi Perfil - - - - - - - - Mi Perfil - - - - -
- - - - -
{{nombre}}
- -
- - - - -
- -
- - - -
- - - - - Cancelar -
-
- - - -
-
- - - - -
-
Teléfono:
-
{{telefono}}
-
Localización:
-
{{localizacion}}
-
-
- -
- - - -
- - - -
-
-
-
-
-
- - - - - - - Añadir evento - - - -
- - - - - -
- -
\ No newline at end of file diff --git a/src/app/tab1/tab1.page.ts b/src/app/tab1/tab1.page.ts index e2dfcfd..b29c1e3 100644 --- a/src/app/tab1/tab1.page.ts +++ b/src/app/tab1/tab1.page.ts @@ -2,12 +2,13 @@ import { Component, OnInit } from '@angular/core'; import { NodeCompatibleEventEmitter } from 'rxjs/internal/observable/fromEvent'; import { Tab1Service } from './tab1.service' import { Discoteca } from '../discoteca' +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 { PerfilDiscotecaPageModule } from '../perfil-discoteca/perfil-discoteca.module'; +import { from } from 'rxjs'; @Component({ selector: 'app-tab1', @@ -17,153 +18,18 @@ import { PerfilDiscotecaPageModule } from '../perfil-discoteca/perfil-discoteca. export class Tab1Page implements OnInit { - @ViewChild('IonSlides') slides: IonSlides; - nombre: string; - telefono: number; - localizacion: string; - fotoSrc: string; - fotoLoaded: string; - someURL: string; - editDisabled: string; - editEnabled: string; - galeriaFotos: string[]; - galeriaFake: string[]; - currentIndex: number; - eventos: Evento[]; - alertCtrl: AlertController; + constructor(private tab1Service: Tab1Service, private router: Router) { } ngOnInit(){ - this.initValues(); - } - - initValues(): void{ - this.getNombre(); - this.getTelefono(); - this.getLocalizacion(); - this.getEventos(); - this.editDisabled="true"; - this.editEnabled="false"; - this.fotoSrc = '../assets/barraca.jpg'; - this.fotoLoaded = this.fotoSrc; - this.galeriaFotos = []; } - getNombre(): void{ - this.nombre = this.tab1Service.getNombre(); - } - - getTelefono(): void{ - this.telefono = this.tab1Service.getTelefono(); - } - - getLocalizacion(): void{ - this.localizacion = this.tab1Service.getLocalizacion(); - } - - getEventos(): void{ - this.eventos = this.tab1Service.getEventos(); - } - - cargarImagen(){ - this.fotoSrc = this.someURL; - } - - addGaleria(){ - this.galeriaFotos.push(this.someURL); - this.slides.update(); - - - - } - - loadImageFromDevice(event): void{ - - const file = event.target.files[0]; - - let blobURL: string; - const reader = new FileReader(); - - reader.readAsDataURL(file); - - reader.onload = () => { - - let blob: Blob = new Blob([new Uint8Array((reader.result as ArrayBuffer))]); - let blobURL = URL.createObjectURL(blob); - this.someURL = reader.result as string; - if (event.target.id=="file-input-perfil") - this.cargarImagen(); - else if (event.target.id=="file-input-galeria") - this.addGaleria(); - - }; - - - }; - - - enableEdit(){ - this.editDisabled="false"; - this.editEnabled="true"; - let cajaDatos = document.getElementById("cajaDatos"); - cajaDatos.style.background="white"; - cajaDatos.style.color="black"; - let botones = document.getElementById("botonesHidden1"); - botones.style.display = "block"; - botones = document.getElementById("botonesHidden2"); - botones.style.display = "block"; - - - - } - - disableEdit(){ - this.editDisabled="true"; - this.editEnabled="false"; - let cajaDatos = document.getElementById("cajaDatos"); - cajaDatos.style.background="inherit"; - cajaDatos.style.color="inherit"; - let botones = document.getElementById("botonesHidden1"); - botones.style.display = "none"; - botones = document.getElementById("botonesHidden2"); - botones.style.display = "none"; - - - } - - saveEdit(){ - this.fotoLoaded = this.fotoSrc; - this.disableEdit(); - - } - - cancelEdit(){ - if(this.fotoLoaded) - this.fotoSrc = this.fotoLoaded; - this.disableEdit();} - - borrarDeGaleria(){ - this.galeriaFotos.splice(this.currentIndex, 1); - - } - - onSlideChanged() { - this.slides.getActiveIndex().then(index =>{ - this.currentIndex = index;} - ); - - this.slides.update(); -} - -addEvento() { - this.router.navigate(['prompt-evento']); -} } diff --git a/src/app/tabs/tabs-routing.module.ts b/src/app/tabs/tabs-routing.module.ts index 468f849..19c6a1b 100644 --- a/src/app/tabs/tabs-routing.module.ts +++ b/src/app/tabs/tabs-routing.module.ts @@ -23,7 +23,9 @@ const routes: Routes = [ path: '', redirectTo: '/tabs/tab1', pathMatch: 'full' - } + }, + + ] }, {