Compare commits
No commits in common. "594332fd87bf7a766219dd05e9ee30210cc6c74d" and "5f48a57c6fc9b5d17aab6573c3d7d1b3e0115e98" have entirely different histories.
594332fd87
...
5f48a57c6f
@ -7,12 +7,15 @@ const routes: Routes = [
|
|||||||
path: '',
|
path: '',
|
||||||
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: 'view-evento',
|
path: 'prompt-evento',
|
||||||
loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule)
|
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({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -10,14 +10,4 @@
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
--ion-color-primary: #c4b700;
|
|
||||||
--ion-color-primary-rgb: 196, 183, 0;
|
|
||||||
--ion-color-primary-contrast: #ffffff;
|
|
||||||
--ion-color-primary-contrast-rgb: 255,255,255;
|
|
||||||
--ion-color-primary-shade: #695100;
|
|
||||||
--ion-color-primary-tint: #8a8b39;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { RouteReuseStrategy } from '@angular/router';
|
import { RouteReuseStrategy } from '@angular/router';
|
||||||
import { ReactiveFormsModule } from '@angular/forms';
|
|
||||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||||
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
|
||||||
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
import { StatusBar } from '@ionic-native/status-bar/ngx';
|
||||||
|
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { PerfilDiscotecaPage } from './perfil-discoteca/perfil-discoteca.page';
|
|
||||||
import { PromptEventoPage} from './prompt-evento/prompt-evento.page'
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AppComponent, PerfilDiscotecaPage, PromptEventoPage],
|
declarations: [AppComponent],
|
||||||
entryComponents: [],
|
entryComponents: [],
|
||||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, ReactiveFormsModule],
|
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
|
||||||
providers: [
|
providers: [
|
||||||
StatusBar,
|
StatusBar,
|
||||||
SplashScreen,
|
SplashScreen,
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
export class Evento {
|
export class Evento {
|
||||||
private id: number;
|
private id: number;
|
||||||
nombre: string;
|
private nombre: string;
|
||||||
localizacion: string;
|
private localizacion: string;
|
||||||
fecha: Date;
|
private fecha: Date;
|
||||||
dia: string;
|
private desc: string;
|
||||||
hora: string;
|
|
||||||
descripcion: string;
|
|
||||||
precio1: number;
|
|
||||||
precio2: number;
|
|
||||||
|
|
||||||
setNombre(nombre: string): void{
|
setNombre(nombre: string): void{
|
||||||
this.nombre = nombre;
|
this.nombre = nombre;
|
||||||
@ -34,42 +30,10 @@ export class Evento {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setDesc(desc: string): void{
|
setDesc(desc: string): void{
|
||||||
this.descripcion = desc;
|
this.desc = desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
getDesc(): string{
|
getDesc(): string{
|
||||||
return this.descripcion;
|
return this.desc;
|
||||||
}
|
|
||||||
|
|
||||||
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 +1,13 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes, RouterModule, ChildrenOutletContexts } from '@angular/router';
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import { PerfilDiscotecaPage } from './perfil-discoteca.page';
|
import { PerfilDiscotecaPage } from './perfil-discoteca.page';
|
||||||
import { PromptEventoPage} from '../prompt-evento/prompt-evento.page'
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: PerfilDiscotecaPage,
|
component: PerfilDiscotecaPage
|
||||||
|
}
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
@ -1,22 +1,19 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
import { IonicModule } from '@ionic/angular';
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
import { PerfilDiscotecaPageRoutingModule } from './perfil-discoteca-routing.module';
|
import { PerfilDiscotecaPageRoutingModule } from './perfil-discoteca-routing.module';
|
||||||
|
|
||||||
import { PerfilDiscotecaPage } from './perfil-discoteca.page';
|
import { PerfilDiscotecaPage } from './perfil-discoteca.page';
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
PerfilDiscotecaPageRoutingModule,
|
PerfilDiscotecaPageRoutingModule
|
||||||
ExploreContainerComponentModule,
|
|
||||||
],
|
|
||||||
|
|
||||||
exports: [
|
|
||||||
PerfilDiscotecaPage
|
|
||||||
],
|
],
|
||||||
declarations: [PerfilDiscotecaPage]
|
declarations: [PerfilDiscotecaPage]
|
||||||
})
|
})
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<ion-header [translucent]="true">
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>
|
<ion-title>Mi Perfil</ion-title>
|
||||||
Mi Perfil
|
|
||||||
</ion-title>
|
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
@ -17,6 +15,7 @@
|
|||||||
<div class='fotoPerfil'>
|
<div class='fotoPerfil'>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col>
|
<ion-col>
|
||||||
|
|
||||||
<ion-img class="fotoPerfil" width="100%" height="100%" [src]='fotoSrc' alt='barraquinha'></ion-img>
|
<ion-img class="fotoPerfil" width="100%" height="100%" [src]='fotoSrc' alt='barraquinha'></ion-img>
|
||||||
<div class="textoPie">{{nombre}}</div>
|
<div class="textoPie">{{nombre}}</div>
|
||||||
|
|
||||||
@ -57,7 +56,6 @@
|
|||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col>
|
<ion-col>
|
||||||
<div class="galeria">
|
<div class="galeria">
|
||||||
Galería de Fotos
|
|
||||||
<input type="file" (change)="loadImageFromDevice($event)" id="file-input-galeria" accept="image/png, image/jpeg">
|
<input type="file" (change)="loadImageFromDevice($event)" id="file-input-galeria" accept="image/png, image/jpeg">
|
||||||
<ion-slides (ionDrag)="onSlideChanged()">
|
<ion-slides (ionDrag)="onSlideChanged()">
|
||||||
<ion-slide *ngFor="let foto of galeriaFotos">
|
<ion-slide *ngFor="let foto of galeriaFotos">
|
||||||
@ -81,27 +79,6 @@
|
|||||||
</ion-button>
|
</ion-button>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
|
|
||||||
<ion-row>
|
|
||||||
<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>
|
|
||||||
</ion-item>
|
|
||||||
</ion-list>
|
|
||||||
</div>
|
|
||||||
</ion-row>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,80 +0,0 @@
|
|||||||
: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;
|
|
||||||
}
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
.eventos{
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.evento:hover{
|
|
||||||
background-color: rgb(97, 97, 97);
|
|
||||||
}
|
|
||||||
.eventoHeader{
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.eventoDesc{
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-slides {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
@ -7,7 +7,6 @@ import { AlertController } from '@ionic/angular';
|
|||||||
import { ViewChild } from '@angular/core';
|
import { ViewChild } from '@angular/core';
|
||||||
import { Evento } from '../evento';
|
import { Evento } from '../evento';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { THIS_EXPR } from '@angular/compiler/src/output/output_ast';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-perfil-discoteca',
|
selector: 'app-perfil-discoteca',
|
||||||
@ -26,6 +25,7 @@ export class PerfilDiscotecaPage implements OnInit {
|
|||||||
editDisabled: string;
|
editDisabled: string;
|
||||||
editEnabled: string;
|
editEnabled: string;
|
||||||
galeriaFotos: string[];
|
galeriaFotos: string[];
|
||||||
|
galeriaFake: string[];
|
||||||
currentIndex: number;
|
currentIndex: number;
|
||||||
eventos: Evento[];
|
eventos: Evento[];
|
||||||
alertCtrl: AlertController;
|
alertCtrl: AlertController;
|
||||||
@ -77,6 +77,7 @@ export class PerfilDiscotecaPage implements OnInit {
|
|||||||
this.slides.update();
|
this.slides.update();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadImageFromDevice(event): void{
|
loadImageFromDevice(event): void{
|
||||||
@ -159,12 +160,7 @@ export class PerfilDiscotecaPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addEvento() {
|
addEvento() {
|
||||||
this.router.navigate(['/tabs/tab1/prompt-evento']);
|
this.router.navigate(['prompt-evento']);
|
||||||
}
|
|
||||||
|
|
||||||
mostrarEvento(evento: Evento){
|
|
||||||
this.tab1Service.eventoIndex = this.eventos.indexOf(evento);
|
|
||||||
this.router.navigate(['/tabs/tab1/view-evento']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,40 +5,6 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<form [formGroup]="eventoForm" (ngSubmit)="onSubmit()">
|
|
||||||
|
|
||||||
<div class="campoInput">
|
|
||||||
<label>
|
|
||||||
Nombre del evento:
|
|
||||||
<input type="text" formControlName = "nombre">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="campoInput">
|
|
||||||
<label>
|
|
||||||
Fecha:
|
|
||||||
<ion-datetime displayFormat="DD/MM, HH:mm"placeholder="Elegir Fecha" formControlName="fecha"></ion-datetime>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="campoInput">
|
|
||||||
<label>
|
|
||||||
Descripción:
|
|
||||||
<input type="text" formControlName = "descripcion">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="campoInput">
|
|
||||||
<label>
|
|
||||||
Precio:
|
|
||||||
<input type="number" formControlName = "precio1"><label>, </label><input type="number" formControlName = "precio2">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="submit">GUARDAR</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
*{
|
|
||||||
--ion-text-color: #000000;
|
|
||||||
padding: 5px;
|
|
||||||
letter-spacing: 2px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.campoInput{
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,48 +1,15 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormControl, FormGroup } from '@angular/forms';
|
|
||||||
import { Tab1Service } from '../tab1/tab1.service';
|
|
||||||
import { Evento } from '../evento';
|
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { FormBuilder } from '@angular/forms';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-prompt-evento',
|
selector: 'app-prompt-evento',
|
||||||
templateUrl: './prompt-evento.page.html',
|
templateUrl: './prompt-evento.page.html',
|
||||||
styleUrls: ['./prompt-evento.page.scss'],
|
styleUrls: ['./prompt-evento.page.scss'],
|
||||||
})
|
})
|
||||||
export class PromptEventoPage{
|
export class PromptEventoPage implements OnInit {
|
||||||
eventoForm = new FormGroup({
|
|
||||||
nombre: new FormControl(''),
|
|
||||||
fecha: new FormControl(''),
|
|
||||||
hora: new FormControl(''),
|
|
||||||
precio1: new FormControl(''),
|
|
||||||
precio2: new FormControl(''),
|
|
||||||
descripcion: new FormControl('')
|
|
||||||
});
|
|
||||||
|
|
||||||
eventos: Evento[];
|
constructor() { }
|
||||||
|
|
||||||
constructor(private tab1Service: Tab1Service, private router: Router) {
|
ngOnInit() {
|
||||||
this.eventos = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(){
|
|
||||||
let evento = new Evento();
|
|
||||||
this.asignarEvento(evento);
|
|
||||||
this.router.navigate(['/tabs/tab1/perfil-discoteca']);
|
|
||||||
}
|
|
||||||
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.initEventos();}
|
|
||||||
this.tab1Service.eventos.push(evento);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,36 +1,13 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { Tab1Page } from './tab1.page';
|
import { Tab1Page } from './tab1.page';
|
||||||
import { PerfilDiscotecaPage } from '../perfil-discoteca/perfil-discoteca.page'
|
|
||||||
import { PromptEventoPage } from '../prompt-evento/prompt-evento.page'
|
|
||||||
import { ViewEventoPage } from '../view-evento/view-evento.page'
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
redirectTo: 'perfil-discoteca',
|
component: Tab1Page,
|
||||||
pathMatch: 'full',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
path: 'perfil-discoteca',
|
|
||||||
component: PerfilDiscotecaPage
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: 'prompt-evento',
|
|
||||||
component: PromptEventoPage
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
path: 'view-evento',
|
|
||||||
component: ViewEventoPage
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ import { NgModule } from '@angular/core';
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { Tab1Page } from './tab1.page';
|
import { Tab1Page } from './tab1.page';
|
||||||
import { PerfilDiscotecaPageModule} from '../perfil-discoteca/perfil-discoteca.module'
|
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
||||||
|
|
||||||
import { Tab1PageRoutingModule } from './tab1-routing.module';
|
import { Tab1PageRoutingModule } from './tab1-routing.module';
|
||||||
@ -14,8 +13,7 @@ import { Tab1PageRoutingModule } from './tab1-routing.module';
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ExploreContainerComponentModule,
|
ExploreContainerComponentModule,
|
||||||
Tab1PageRoutingModule,
|
Tab1PageRoutingModule
|
||||||
|
|
||||||
],
|
],
|
||||||
declarations: [Tab1Page]
|
declarations: [Tab1Page]
|
||||||
})
|
})
|
||||||
|
@ -0,0 +1,92 @@
|
|||||||
|
<ion-header [translucent]="true">
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>
|
||||||
|
Mi Perfil
|
||||||
|
</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<ion-grid>
|
||||||
|
<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 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">
|
||||||
|
</ion-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<ion-button (click)="enableEdit()" label="editar" [disabled]='editEnabled'>
|
||||||
|
<ion-icon name="create"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<div id="botonesHidden1" class="botonesHidden">
|
||||||
|
<ion-button (click)="saveEdit()" label="guardar" [disabled]='editDisabled'>
|
||||||
|
<ion-icon name="save"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
<ion-button (click)="cancelEdit()" [disabled]='editDisabled'>
|
||||||
|
Cancelar
|
||||||
|
</ion-button></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
|
|
||||||
|
<ion-row>
|
||||||
|
<ion-col>
|
||||||
|
<div id="cajaDatos" class='datosDisplay'>
|
||||||
|
<div class="datosLabel">Teléfono: </div>
|
||||||
|
<div [contentEditable]='editEnabled'>{{telefono}}</div>
|
||||||
|
<div class="datosLabel">Localización: </div>
|
||||||
|
<div [contentEditable]='editEnabled'>{{localizacion}}</div>
|
||||||
|
</div>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col>
|
||||||
|
<div class="galeria">
|
||||||
|
<input type="file" (change)="loadImageFromDevice($event)" id="file-input-galeria" accept="image/png, image/jpeg">
|
||||||
|
<ion-slides (ionDrag)="onSlideChanged()">
|
||||||
|
<ion-slide *ngFor="let foto of galeriaFotos">
|
||||||
|
<div class="fotoGaleria"><img src="{{foto}}">
|
||||||
|
<ion-button (click)="borrarDeGaleria()">
|
||||||
|
<ion-icon name="trash-outline"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</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>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
|
</ion-content>
|
@ -2,13 +2,12 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { NodeCompatibleEventEmitter } from 'rxjs/internal/observable/fromEvent';
|
import { NodeCompatibleEventEmitter } from 'rxjs/internal/observable/fromEvent';
|
||||||
import { Tab1Service } from './tab1.service'
|
import { Tab1Service } from './tab1.service'
|
||||||
import { Discoteca } from '../discoteca'
|
import { Discoteca } from '../discoteca'
|
||||||
import { PerfilDiscotecaPage } from '../perfil-discoteca/perfil-discoteca.page'
|
|
||||||
import { IonSlides} from '@ionic/angular';
|
import { IonSlides} from '@ionic/angular';
|
||||||
import { AlertController } from '@ionic/angular';
|
import { AlertController } from '@ionic/angular';
|
||||||
import { ViewChild } from '@angular/core';
|
import { ViewChild } from '@angular/core';
|
||||||
import { Evento } from '../evento';
|
import { Evento } from '../evento';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { from } from 'rxjs';
|
import { PerfilDiscotecaPageModule } from '../perfil-discoteca/perfil-discoteca.module';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-tab1',
|
selector: 'app-tab1',
|
||||||
@ -18,18 +17,153 @@ import { from } from 'rxjs';
|
|||||||
|
|
||||||
|
|
||||||
export class Tab1Page implements OnInit {
|
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) {
|
constructor(private tab1Service: Tab1Service, private router: Router) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(){
|
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']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import { Tab1Page } from './tab1.page'
|
|||||||
import { Discoteca } from '../discoteca'
|
import { Discoteca } from '../discoteca'
|
||||||
import { Galeria } from '../galeria';
|
import { Galeria } from '../galeria';
|
||||||
import { Evento } from '../evento';
|
import { Evento } from '../evento';
|
||||||
import { NumericValueAccessor } from '@ionic/angular';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -15,7 +14,6 @@ export class Tab1Service implements OnInit{
|
|||||||
discoteca: Discoteca;
|
discoteca: Discoteca;
|
||||||
galeria: Galeria;
|
galeria: Galeria;
|
||||||
eventos: Evento[];
|
eventos: Evento[];
|
||||||
eventoIndex: number;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
@ -31,7 +29,6 @@ export class Tab1Service implements OnInit{
|
|||||||
this.discoteca.setTelefono(666666666);
|
this.discoteca.setTelefono(666666666);
|
||||||
this.discoteca.setLocalizacion('Calle del Barquillo');
|
this.discoteca.setLocalizacion('Calle del Barquillo');
|
||||||
this.galeria = new Galeria();
|
this.galeria = new Galeria();
|
||||||
this.initEventos();
|
|
||||||
this.galeria.setDiscoteca(this.discoteca.getNombre());
|
this.galeria.setDiscoteca(this.discoteca.getNombre());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,15 +48,7 @@ export class Tab1Service implements OnInit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
getEventos(): Evento[]{
|
getEventos(): Evento[]{
|
||||||
return this.eventos;
|
return this.discoteca.getEventos();
|
||||||
}
|
|
||||||
|
|
||||||
initEventos(): void{
|
|
||||||
this.eventos = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
getEventobyIndex(eventoIndex: number){
|
|
||||||
return this.eventos[eventoIndex];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,7 @@ const routes: Routes = [
|
|||||||
path: '',
|
path: '',
|
||||||
redirectTo: '/tabs/tab1',
|
redirectTo: '/tabs/tab1',
|
||||||
pathMatch: 'full'
|
pathMatch: 'full'
|
||||||
},
|
}
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
|
||||||
|
|
||||||
import { ViewEventoPage } from './view-evento.page';
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
component: ViewEventoPage
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [RouterModule.forChild(routes)],
|
|
||||||
exports: [RouterModule],
|
|
||||||
})
|
|
||||||
export class ViewEventoPageRoutingModule {}
|
|
@ -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 { ViewEventoPageRoutingModule } from './view-evento-routing.module';
|
|
||||||
|
|
||||||
import { ViewEventoPage } from './view-evento.page';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
FormsModule,
|
|
||||||
IonicModule,
|
|
||||||
ViewEventoPageRoutingModule
|
|
||||||
],
|
|
||||||
declarations: [ViewEventoPage]
|
|
||||||
})
|
|
||||||
export class ViewEventoPageModule {}
|
|
@ -1,9 +0,0 @@
|
|||||||
<ion-header>
|
|
||||||
<ion-toolbar>
|
|
||||||
<ion-title>ViewEvento</ion-title>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content>
|
|
||||||
<label>{{evento.nombre}}</label>
|
|
||||||
</ion-content>
|
|
@ -1,24 +0,0 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
import { IonicModule } from '@ionic/angular';
|
|
||||||
|
|
||||||
import { ViewEventoPage } from './view-evento.page';
|
|
||||||
|
|
||||||
describe('ViewEventoPage', () => {
|
|
||||||
let component: ViewEventoPage;
|
|
||||||
let fixture: ComponentFixture<ViewEventoPage>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ ViewEventoPage ],
|
|
||||||
imports: [IonicModule.forRoot()]
|
|
||||||
}).compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ViewEventoPage);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,20 +0,0 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
|
||||||
import { Evento } from '../evento';
|
|
||||||
import { Tab1Service } from '../tab1/tab1.service';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-view-evento',
|
|
||||||
templateUrl: './view-evento.page.html',
|
|
||||||
styleUrls: ['./view-evento.page.scss'],
|
|
||||||
})
|
|
||||||
export class ViewEventoPage implements OnInit {
|
|
||||||
|
|
||||||
evento: Evento;
|
|
||||||
|
|
||||||
constructor(private tab1Service: Tab1Service) { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.evento = this.tab1Service.getEventobyIndex(this.tab1Service.eventoIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user