Compare commits

..

No commits in common. "594332fd87bf7a766219dd05e9ee30210cc6c74d" and "e8b52ec48dfe29142173c1a1cf8ff32fee06568d" have entirely different histories.

18 changed files with 20 additions and 297 deletions

View File

@ -7,10 +7,6 @@ const routes: Routes = [
path: '',
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
},
{
path: 'view-evento',
loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule)
},
];

View File

@ -10,14 +10,4 @@
margin-right: auto;
text-align: center;
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;
}
}

View File

@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
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';
@ -9,12 +9,11 @@ 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'
@NgModule({
declarations: [AppComponent, PerfilDiscotecaPage, PromptEventoPage],
declarations: [AppComponent, PerfilDiscotecaPage],
entryComponents: [],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, ReactiveFormsModule],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
providers: [
StatusBar,
SplashScreen,

View File

@ -1,13 +1,9 @@
export class Evento {
private id: number;
nombre: string;
localizacion: string;
fecha: Date;
dia: string;
hora: string;
descripcion: string;
precio1: number;
precio2: number;
private nombre: string;
private localizacion: string;
private fecha: Date;
private desc: string;
setNombre(nombre: string): void{
this.nombre = nombre;
@ -34,42 +30,10 @@ export class Evento {
}
setDesc(desc: string): void{
this.descripcion = desc;
this.desc = 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;
return this.desc;
}
}

View File

@ -57,7 +57,6 @@
</ion-col>
<ion-col>
<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()">
<ion-slide *ngFor="let foto of galeriaFotos">
@ -80,27 +79,6 @@
Añadir evento
</ion-button>
</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>

View File

@ -2,11 +2,11 @@
--ion-background-color-rgb: 73,73,73;
--ion-text-color: #eeeeee;
--ion-text-color-rgb: 238,238,238;
}
--ion-text-color-rgb: 238,238,238;}
*{
padding: 5px;
letter-spacing: 2px;
}
.titulo{
font: "arial";
@ -59,22 +59,7 @@
.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%;
}
}

View File

@ -26,6 +26,7 @@ export class PerfilDiscotecaPage implements OnInit {
editDisabled: string;
editEnabled: string;
galeriaFotos: string[];
galeriaFake: string[];
currentIndex: number;
eventos: Evento[];
alertCtrl: AlertController;
@ -77,6 +78,7 @@ export class PerfilDiscotecaPage implements OnInit {
this.slides.update();
}
loadImageFromDevice(event): void{
@ -161,11 +163,6 @@ export class PerfilDiscotecaPage implements OnInit {
addEvento() {
this.router.navigate(['/tabs/tab1/prompt-evento']);
}
mostrarEvento(evento: Evento){
this.tab1Service.eventoIndex = this.eventos.indexOf(evento);
this.router.navigate(['/tabs/tab1/view-evento']);
}
}

View File

@ -5,40 +5,6 @@
</ion-header>
<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>

View File

@ -1,12 +0,0 @@
*{
--ion-text-color: #000000;
padding: 5px;
letter-spacing: 2px;
}
.campoInput{
display: block;
}

View File

@ -1,48 +1,15 @@
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({
selector: 'app-prompt-evento',
templateUrl: './prompt-evento.page.html',
styleUrls: ['./prompt-evento.page.scss'],
})
export class PromptEventoPage{
eventoForm = new FormGroup({
nombre: new FormControl(''),
fecha: new FormControl(''),
hora: new FormControl(''),
precio1: new FormControl(''),
precio2: new FormControl(''),
descripcion: new FormControl('')
});
export class PromptEventoPage implements OnInit {
eventos: Evento[];
constructor() { }
constructor(private tab1Service: Tab1Service, private router: Router) {
this.eventos = [];
}
onSubmit(){
let evento = new Evento();
this.asignarEvento(evento);
this.router.navigate(['/tabs/tab1/perfil-discoteca']);
ngOnInit() {
}
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);
}
}

View File

@ -3,7 +3,6 @@ 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'
import { ViewEventoPage } from '../view-evento/view-evento.page'
const routes: Routes = [
{
@ -21,11 +20,6 @@ const routes: Routes = [
path: 'prompt-evento',
component: PromptEventoPage
},
{
path: 'view-evento',
component: ViewEventoPage
}

View File

@ -4,7 +4,6 @@ import { Tab1Page } from './tab1.page'
import { Discoteca } from '../discoteca'
import { Galeria } from '../galeria';
import { Evento } from '../evento';
import { NumericValueAccessor } from '@ionic/angular';
@Injectable({
@ -15,7 +14,6 @@ export class Tab1Service implements OnInit{
discoteca: Discoteca;
galeria: Galeria;
eventos: Evento[];
eventoIndex: number;
constructor() {
@ -31,7 +29,6 @@ export class Tab1Service implements OnInit{
this.discoteca.setTelefono(666666666);
this.discoteca.setLocalizacion('Calle del Barquillo');
this.galeria = new Galeria();
this.initEventos();
this.galeria.setDiscoteca(this.discoteca.getNombre());
}
@ -51,15 +48,7 @@ export class Tab1Service implements OnInit{
}
getEventos(): Evento[]{
return this.eventos;
}
initEventos(): void{
this.eventos = [];
}
getEventobyIndex(eventoIndex: number){
return this.eventos[eventoIndex];
return this.discoteca.getEventos();
}
}

View File

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

View File

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

View File

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

View File

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

View File

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