Compare commits

..

No commits in common. "b163dee4b7732c54f0ebb10dd6952345753b6da7" and "139e3fcb8b5731dfd5c58603810542e17ccfd2fd" have entirely different histories.

16 changed files with 97 additions and 168 deletions

View File

@ -13,10 +13,6 @@ const routes: Routes = [
path: 'tabs', path: 'tabs',
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) 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', path: 'view-evento',
loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule) loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule)
@ -30,11 +26,6 @@ const routes: Routes = [
redirectTo: 'login', redirectTo: 'login',
pathMatch: 'full' pathMatch: 'full'
}, },
{
path: 'tabs-user',
loadChildren: () => import('./tabs-user/tabs-user.module').then( m => m.TabsUserPageModule)
},

View File

@ -6,7 +6,7 @@ export interface Eventoi {
nombre: string, nombre: string,
localizacion: string, localizacion: string,
fecha: Date, fecha: Date,
hora: Date, hora: Time,
descripcion: string, descripcion: string,
precio1: number, precio1: number,
precio2: number, precio2: number,

View File

@ -32,10 +32,10 @@
<ion-item> <ion-item>
<label> <label>
Hora Hora
<ion-datetime displayFormat="HH:mm"placeholder="Elegir Hora" formControlName="hora"></ion-datetime> <ion-datetime displayFormat="HH:MM"placeholder="Elegir Hora" formControlName="hora"></ion-datetime>
</label> </label>
<span <span
*ngIf="hora?.errors?.required && submitted"> *ngIf="hora.errors.required && submitted">
Tu evento necesita una hora Tu evento necesita una hora
</span> </span>
</ion-item> </ion-item>

View File

@ -48,6 +48,7 @@ export class PromptEventoPage implements OnInit{
precio1: null, precio1: null,
precio2: null precio2: null
}; };
this.asignarEvento(evento); this.asignarEvento(evento);
@ -65,11 +66,22 @@ export class PromptEventoPage implements OnInit{
evento.hora = hora; evento.hora = hora;
evento.precio1 = this.eventoForm.get('precio1').value; evento.precio1 = this.eventoForm.get('precio1').value;
evento.precio2 = this.eventoForm.get('precio2').value; evento.precio2 = this.eventoForm.get('precio2').value;
//evento.setDia(evento.getFecha()); el datetime de Ion devuelve un String, no se puede
if (!this.tab1Service.eventos){ if (!this.tab1Service.eventos){
this.tab1Service.initEventos();} this.tab1Service.initEventos();}
if(!this.tab1Service.eventoForms){ if(!this.tab1Service.eventoForms){
this.tab1Service.initEventoForms();} this.tab1Service.initEventoForms();}
if(this.tab1Service.editarEvento==true){
this.tab1Service.updateEvento(evento);
//this.tab1Service.eventos[this.tab1Service.eventoIndex] = evento;
//this.tab1Service.eventoForms[this.tab1Service.eventoIndex] = this.eventoForm;
}
else{
this.tab1Service.postEvento(evento); this.tab1Service.postEvento(evento);
//this.tab1Service.eventos.push(evento);
//this.tab1Service.eventoForms.push(this.eventoForm);
}
} }
get nombre(){ get nombre(){

View File

@ -16,7 +16,7 @@ export class FeedService {
this.apiService.getEventos() this.apiService.getEventos()
.subscribe(eventos => { .subscribe(eventos => {
this.eventos = eventos; this.eventos = eventos;
this.router.navigate(['/tabsUser'])
}) })
} }
} }

View File

@ -86,7 +86,12 @@ export class Tab1Service implements OnInit{
precio2: new FormControl(null, Validators.required), precio2: new FormControl(null, Validators.required),
descripcion: new FormControl(null, Validators.required), descripcion: new FormControl(null, Validators.required),
}); });
thisForm.patchValue(evento); thisForm.controls['nombre'].setValue(evento.nombre);
thisForm.controls['fecha'].setValue(evento.fecha);
thisForm.controls['hora'].setValue(evento.hora);
thisForm.controls['precio1'].setValue(evento.precio1);
thisForm.controls['precio2'].setValue(evento.precio2);
thisForm.controls['descripcion'].setValue(evento.descripcion);
this.eventoForms.push(thisForm); this.eventoForms.push(thisForm);
}) })
} }

View File

@ -1,33 +1,56 @@
<ion-header> <head>
<ion-toolbar> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<ion-title>Eventos Próximos</ion-title> <meta charset="utf-8">
</ion-toolbar> <meta name="keywords" content="">
</ion-header> <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">
<ion-content>
<ion-grid>
<ion-row> <meta property="og:title" content="Página 1">
<ion-col size="12"> <meta property="og:type" content="website">
<div *ngIf="eventos.length>0" class="eventos"> <meta name="theme-color" content="#478ac9">
<ion-list> <link rel="canonical" href="index.html">
<ion-item *ngFor="let evento of eventos" button (click)="mostrarEvento(evento)"> <meta property="og:url" content="index.html">
<div class="evento"> </head>
<div class="eventoHeader"> <body class="u-body">
{{evento.nombre}} · <section class="u-clearfix u-section-1" id="sec-6396">
<ion-icon name="calendar-outline"></ion-icon> <div class="u-clearfix u-sheet u-sheet-1">
{{evento.fecha}} · <div class="u-clearfix u-expanded-width u-layout-wrap u-layout-wrap-1">
<ion-icon name="cash-outline"></ion-icon> <div class="u-layout">
{{evento.precio1}},{{evento.precio2}} <div class="u-layout-row">
<ion-button (click)="editarEvento(evento);$event.stopPropagation();"><ion-icon name="pencil-outline"></ion-icon></ion-button> <div class="u-size-30">
</div> <div class="u-layout-col">
<div class="eventoDesc"> <div class="u-container-style u-layout-cell u-size-60 u-layout-cell-1">
{{evento.descripcion}}
<div class="u-container-layout u-container-layout-1"></div>
</div> </div>
</div> </div>
</ion-item>
</ion-list>
</div> </div>
</ion-col> <div class="u-size-30">
</ion-row> <div class="u-layout-col">
</ion-grid> <div class="u-container-style u-layout-cell u-size-30 u-layout-cell-2">
</ion-content> <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>

View File

@ -1,19 +1,12 @@
import { Component, OnInit } from '@angular/core'; import { Component } from '@angular/core';
import { Eventoi } from '../interfaces/eventoi';
import { FeedService } from '../services/feed.service';
@Component({ @Component({
selector: 'app-tab2', selector: 'app-tab2',
templateUrl: 'tab2.page.html', templateUrl: 'tab2.page.html',
styleUrls: ['tab2.page.scss'] styleUrls: ['tab2.page.scss']
}) })
export class Tab2Page implements OnInit{ export class Tab2Page {
eventos: Eventoi[]; constructor() {}
constructor(private feedService: FeedService) {}
ngOnInit(){
this.eventos = this.feedService.eventos;
}
} }

View File

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

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 { TabsUserPageRoutingModule } from './tabs-user-routing.module';
import { TabsUserPage } from './tabs-user.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
TabsUserPageRoutingModule
],
declarations: [TabsUserPage]
})
export class TabsUserPageModule {}

View File

@ -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>Me</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>

View File

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

View File

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

View File

@ -11,7 +11,14 @@ const routes: Routes = [
path: 'tab1', 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: '', path: '',
redirectTo: 'tab1', redirectTo: 'tab1',

View File

@ -2,11 +2,19 @@
<ion-tab-bar slot="bottom"> <ion-tab-bar slot="bottom">
<ion-tab-button tab="tab1"> <ion-tab-button tab="tab1">
<ion-icon name="home-outline"></ion-icon> <ion-icon name="triangle"></ion-icon>
<ion-label>Perfil</ion-label> <ion-label>Tab 1</ion-label>
</ion-tab-button> </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-tab-bar>
</ion-tabs> </ion-tabs>