Compare commits

..

No commits in common. "80088382b5379bd1601b62835766f9042eae7ae0" and "3c2976437d7e2e0016409c8f256a040878fa19b2" have entirely different histories.

15 changed files with 59 additions and 217 deletions

View File

@ -41,9 +41,6 @@ const routes: Routes = [
{
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)
},
@ -51,7 +48,6 @@ const routes: Routes = [
];
@NgModule({
imports: [

View File

@ -22,9 +22,6 @@
<div class="eventoDesc">
{{evento.descripcion}}
</div>
<div class="discotecaEvento">
{{discotecas[idsDiscoteca.indexOf(evento.discotecaID)]?.nombre}}
</div>
</div>
</ion-item>
</ion-list>

View File

@ -1,8 +1,6 @@
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';
@ -14,46 +12,16 @@ import { Tab1Service } from '../tab1/tab1.service';
export class FeedPage implements OnInit {
eventos: Eventoi[];
discotecas: DiscotecaI[];
idsDiscoteca: number[];
constructor(private feedService:FeedService, private tab1Service: Tab1Service, private router:Router, private apiService: ApiService ) { }
constructor(private feedService:FeedService, private tab1Service: Tab1Service, private router:Router ) { }
ngOnInit() {
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]);
})
}
)
}
}

View File

@ -1,6 +1,5 @@
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';
@ -11,7 +10,6 @@ export class FeedService {
eventos: Eventoi[];
eventoIndex: number;
discotecaEvento: DiscotecaI;
constructor(private apiService: ApiService, private router: Router) { }

View File

@ -3,21 +3,17 @@ 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
}
];

View File

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

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

View File

@ -1,9 +0,0 @@
<ion-header>
<ion-toolbar>
<ion-title>view-discoteca-cliente</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
</ion-content>

View File

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

View File

@ -1,27 +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.discoteca = this.feedService.discotecaEvento;
this.feedService.eventos.forEach(evento => {
if (this.discoteca.discotecaID == evento.discotecaID){
this.eventos.push(evento);
}
})
}
}

View File

@ -1,6 +1,5 @@
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';
@ -8,10 +7,6 @@ const routes: Routes = [
{
path: '',
component: ViewEventoClientePage
},
{
path: 'view-discoteca-cliente',
component: ViewDiscotecaClientePage
}
];

View File

@ -21,11 +21,6 @@
{{evento.descripcion}}
</div>
</ion-row>
<ion-row>
<div class="discotecaEvento">
<a [routerLink]="['/tabsUser/tab2/view-discoteca-cliente']">{{discoteca?.nombre}}</a>
</div>
</ion-row>
</div>
</ion-grid>
</ion-content>

View File

@ -1,3 +0,0 @@
.discotecaEvento{
padding: 40px;
}

View File

@ -1,5 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { DiscotecaI } from '../interfaces/discoteca-i';
import { Eventoi } from '../interfaces/eventoi';
import { FeedService } from '../services/feed.service';
@ -11,12 +10,10 @@ import { FeedService } from '../services/feed.service';
export class ViewEventoClientePage implements OnInit {
evento: Eventoi;
discoteca: DiscotecaI;
constructor(private feedService: FeedService) { }
ngOnInit() {
this.evento = this.feedService.getEventoByIndex(this.feedService.eventoIndex);
this.discoteca = this.feedService.discotecaEvento;
}
}