Commit 88dab287 authored by metalvarez's avatar metalvarez

soporte para multiples consulados

parent 70582335
......@@ -116,61 +116,52 @@
</ion-row>
<div *ngFor="let consulado of consulados">
<ion-row >
<p class="title1">{{nombre}}</p>
<p class="title1">{{consulado.nombre}}</p>
</ion-row>
<ion-row class="border oddcolor">
<!-- {{phone | json} -->
<ion-col col-1 col-xl-1 class="iconfix">
<img src="assets/imgs/Marqueta/telephone-handle-silhouette.png">
</ion-col>
<ion-col col-5 col-xl-5 class="textclr">
Telefono consulado
</ion-col>
<ion-col col-6 col-xl-6 style="text-align: right;">
<ion-grid *ngFor="let phone of telephone">
<ion-grid *ngFor="let phone of consulado.telephone">
<ion-row class="ionlbl" >
{{phone.numero}}
</ion-row>
</ion-grid>
</ion-col>
</ion-row>
<ion-row class="border evencolor">
<ion-col col-1 col-xl-1 class="iconfix">
<img src="assets/imgs/Marqueta/maps-and-flags.png">
</ion-col>
<ion-col col-5 col-xl-5 class="textclr">
Direccion consulado
</ion-col>
<ion-col col-6 col-xl-6 class="ionlbl">
{{direccion}}
{{consulado.direccion}}
</ion-col>
</ion-row>
<ion-row class="border oddcolor">
<ion-col col-1 col-xl-1 class="iconfix">
<img src="assets/imgs/Marqueta/close-envelope.png">
</ion-col>
<ion-col col-5 col-xl-5 class="textclr">
correo electrónico
</ion-col>
<ion-col col-6 col-xl-6 class="ionlbl">
{{email}}
{{consulado.email}}
</ion-col>
</ion-row>
</div>
<ion-row class="border evencolor">
......
......@@ -44,6 +44,7 @@ export class UsefulinfoPage {
countrie: any;
ports: Port[];
port: Port;
consulados: any = [];
constructor(public navCtrl: NavController, public navParams: NavParams, public storage: Storage,
public restProvider: RestProvider, private loader: Loader) {
......@@ -98,6 +99,7 @@ export class UsefulinfoPage {
}
portChange(event: { component: SelectSearchableComponent, value: any }) {
this.consulados = [];
this.error = '';
this.countrie = event.value.nombre;
for (var i = 0; i < this.informations.length; i++) {
......@@ -107,15 +109,29 @@ export class UsefulinfoPage {
this.moneda = this.datoutils.moneda;
this.capital = this.datoutils.capital;
this.idioma = this.datoutils.idioma;
this.nombre = this.datoutils.consulados.nombre;
this.direccion = this.datoutils.consulados.direccion;
this.email = this.datoutils.consulados.email;
this.telephone = this.datoutils.consulados.telefonos;
if (Array.isArray(this.datoutils.consulados)) {
this.datoutils.consulados.forEach(consulado => {
this.consulados.push({
nombre: consulado.nombre,
direccion: consulado.direccion,
email: consulado.email,
telephone: consulado.telefonos
});
});
} else {
this.consulados.push({
nombre: this.datoutils.consulados.nombre,
direccion: this.datoutils.consulados.direccion,
email: this.datoutils.consulados.email,
telephone: this.datoutils.consulados.telefonos
});
}
} else {
console.log("else");
}
}
}
ionViewDidLoad() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment