Skip to content

Commit

Permalink
se realiza cambios de diseno y correccion de errores visuales
Browse files Browse the repository at this point in the history
  • Loading branch information
Meruxxx committed Sep 2, 2021
1 parent d8fb2e3 commit f13adc4
Show file tree
Hide file tree
Showing 20 changed files with 265 additions and 112 deletions.
1 change: 0 additions & 1 deletion hola

This file was deleted.

44 changes: 21 additions & 23 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
<nb-layout justify
><nb-layout-header>
<nb-layout-column>
<div class="flex-wrap space-x-3 position">
<button
outline
nbButton
[nbContextMenu]="items"
nbContextMenuTag="context-menu"
>
Créditos
</button>
<button
outline
nbButton
[nbContextMenu]="itemsAhorros"
nbContextMenuTag="context-menu"
>
Ahorros
</button>
</div>
</nb-layout-column>
<nb-layout justify>
<nb-layout-header>
<div class="flex w-full justify-center space-x-6">
<button outline nbButton [nbContextMenu]="items" nbContextMenuTag="context-menu" [ngClass]="{ 'btn' : esCredito }">
Créditos
</button>
<button outline nbButton [nbContextMenu]="itemsAhorros" nbContextMenuTag="context-menu" [ngClass]="{ 'btn' : esAhorros }">
Ahorros
</button>
</div>
</nb-layout-header>

<nb-layout-column>
<router-outlet></router-outlet>
</nb-layout-column>
<nb-layout-footer>Contact us</nb-layout-footer>

<nb-layout-footer class="text-center text-xs">
AVISO LEGAL. El servicio que ofrece la COOPERATIVA para efectos de simulación de ahorro y créditos
es de carácter eminentemente ilustrativo e informativo, brindando a sus asociados la posibilidad de formarse una
idea cercana de las condiciones a las que podría acceder a nuestros servicios de ahorro y crédito, sin embargo,
tanto el efectivo otorgamiento de un crédito como las reales y definitivas condiciones del mismo, dependerán
enteramente de las políticas de otorgamiento de crédito que tiene vigente la COOPERATIVA, por lo que los resultados
de la simulación no son vinculantes para ésta en cuanto tener que otorgar un crédito o mantener los resultados que
arroje la simulación
</nb-layout-footer>
</nb-layout>
25 changes: 24 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,32 @@ export class AppComponent implements OnInit {
{ title: 'Educativo' },
{ title: 'CrediFacil' },
];

itemsAhorros = [{ title: 'CDAT' }, { title: 'Contractuales' }];

constructor(private nbMenuService: NbMenuService, private router: Router) {
rutasCredito: string[] = [
'credito',
'comercio',
'vivienda',
'educativo',
'credifacil',
];
rutasAhorros: string[] = ['cdat', 'contractuales'];

constructor(private nbMenuService: NbMenuService, private router: Router) {}

get lastRoute(): string {
const routes = window.location.pathname.split('/');
const lastRoute = routes[routes.length - 1];
return lastRoute;
}

get esCredito(): boolean {
return this.rutasCredito.includes(this.lastRoute);
}

get esAhorros(): boolean {
return this.rutasAhorros.includes(this.lastRoute);
}

ngOnInit(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/enviar-correo/enviar-correo.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
style="width: 60%"
nbButton
shape="round"
status="primary"
class="btn"
[disabled]="buttonVisible"
(click)="onClickContacto()"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
<nb-card>
<nb-card-header>{{title}}</nb-card-header>
<nb-card class="h-full">
<nb-card-header>
<h3 class="h4">Resultado de simulación</h3>
</nb-card-header>
<nb-card-body>
<form>
<div class="flex flex-col space-y-6">
<div class="bg-blue-600 text-white rounded-lg p-6">
<span *ngIf="title==='Informción Crédito'" class="uppercase text-xs text-blue-300">Valor de la cuota</span>
<span *ngIf="title==='Informción Ahorro'" class="uppercase text-xs text-blue-300">Valor de la ganacia</span>
<h1
class="block text-center text-6xl text-white py-16 font-extrabold"
>
{{ valorCuota| currency}} <!-- | mask:'separator':'.' -->
<div class="bg-brand-blue-200 text-white rounded-lg p-6">
<span class="uppercase text-white">{{informacion.titleLabel}}</span>

<h1 class="block text-center text-6xl text-white py-16 font-extrabold">
{{ informacion.title | currency}} <!-- | mask:'separator':'.' -->
</h1>

<div class="flex space-x-12">
<div >
<span class="uppercase text-xs text-blue-300" >Total</span>
<!-- <h6 class="block text-white">{{ valorCuota | currency }}</h6> -->
<h6 *ngIf="title==='Informción Ahorro'" class="block text-white" >{{ TotalAhorro | currency }}</h6>
<h6 *ngIf="title==='Informción Crédito'" class="block text-white" >{{ valorCuota | currency }}</h6>
<span class="uppercase text-white" >{{ informacion.footerFirstLabel}} </span>
<h6 class="block text-white" >{{ informacion.footerFirstValue }}</h6>
</div>
<div>
<span class="uppercase text-xs text-blue-300">Interés</span>
<h6 class="block text-white">{{ intereses + "%" }}</h6>
<span class="uppercase text-white" >{{ informacion.footerSecondLabel}} </span>
<h6 class="block text-white" >{{ informacion.footerSecondValue }}</h6>
</div>
<div *ngIf="this.title === 'Informción Crédito'">
<span class="uppercase text-white" >{{ informacion.footerThirdLabel}} </span>
<h6 class="block text-white" >{{ informacion.footerThirdValue }}</h6>
</div>
</div>
</div>
<!-- <div style="background-color: #1c85e8; color: white; height: 50%">
<span>hola</span>
</div> -->
</div>
</form>
</nb-card-body>
Expand All @@ -39,7 +38,7 @@ <h6 class="block text-white">{{ intereses + "%" }}</h6>
style="width: 60%"
nbButton
shape="round"
status="primary"
class="btn"
(click)="open()"
>
<!-- (click)="onClickContacto()" -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CurrencyPipe } from '@angular/common';
import { Component, Input } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { NbDialogService } from '@nebular/theme';
Expand All @@ -8,43 +9,54 @@ import { EnviarCorreoPage } from './../../components/enviar-correo/enviar-correo
selector: 'app-informacion-credito',
templateUrl: './informacion-credito.component.html',
styleUrls: ['./informacion-credito.component.css'],
providers: [CurrencyPipe]
})
export class InformacionCreditoComponent {
@Input() valorCuota!: number;
@Input() title!: any;
@Input() intereses!: any;
@Input() interesesEA!: any;
@Input() TotalAhorro!: any;
@Input() TotalCredito!: any;
@Input() tipoSolicitud!: any;

_Tem: number = 1;

// form!: FormGroup;
constructor(
private formBuilder: FormBuilder,
private emailService: EmailService,
private dialogService: NbDialogService
private dialogService: NbDialogService,
private currencyPipe: CurrencyPipe
) {
// this.form = this.formBuilder.group({
// NombreCliente: ['', [Validators.required]],
// emailCliente: ['', [Validators.required, Validators.email]],
// TelCel: ['', [Validators.required, Validators.maxLength(256)]],
// });

}

// onClickContacto(): void {
// const { NombreCliente, emailCliente, TelCel } = this.form.value;
// this.emailService
// .send({
// to: '[email protected]',
// params: {
// nombre_contacto: NombreCliente,
// email_contacto: emailCliente,
// telefono_contacto: TelCel,
// },
// })
// .then(console.log);
// }
get informacion() {
if (this.title === 'Informción Crédito') {
return {
titleLabel: 'Valor de la cuota',
title: this.valorCuota,
footerFirstLabel: 'Interés mensuales' ,
footerFirstValue: `${this.intereses}%`,
footerSecondLabel: 'Tasa efectiva anual',
footerSecondValue: this.interesesEA,
footerThirdLabel: 'Pago total del crédito',
footerThirdValue: this.toCurrency(this.TotalCredito),
}
} else {
return {
titleLabel: 'Valor de la ganacia',
title: this.TotalAhorro,
footerFirstLabel: '% Tasa EA',
footerFirstValue: `${this.intereses}%`,
footerSecondLabel: 'Tasa efectiva anual',
footerSecondValue: this.toCurrency(this.valorCuota),
}

}
}


open(): void {
this.dialogService.open(EnviarCorreoPage, {
autoFocus: true,
Expand All @@ -54,4 +66,8 @@ export class InformacionCreditoComponent {
}
});
}

private toCurrency(value: number): string {
return this.currencyPipe.transform(value) || '';
}
}
5 changes: 3 additions & 2 deletions src/app/core/utils/calculos.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const CALCULOS_UTILS = {
tipoDeuda: TipoDeuda,
monto: number,
numeroCuotas: number
): [valor:number,interes:number] | null {
): [valor:number,interes:number,interesesEA:number] | null {
let parametros;
let tasaMensual;
let tasaEA;
Expand All @@ -130,6 +130,7 @@ export const CALCULOS_UTILS = {
) {
return null;
}

tasaMensual = tasaInteresLibreInversion[numeroCuotas].tasaMensual;
tasaEA = tasaInteresLibreInversion[numeroCuotas].tasaEA;
break;
Expand Down Expand Up @@ -191,7 +192,7 @@ export const CALCULOS_UTILS = {
);
const division = 1 - tasaPlazo;
const valorCuota = (interes * monto) / division;
return [valorCuota,tasaMensual];
return [valorCuota,tasaMensual,tasaEA];
},
//TODO: Se debe retornar tambien la informacion del error ocurrido y mostrado en un Toast
calcularInteresAhorro(
Expand Down
11 changes: 8 additions & 3 deletions src/app/pages/cdat/cdat.page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="mb-12 text-center">
<h1 class="text-brand-blue-100">SIMULADOR DE AHORRO</h1>
<h2>cuota fija y tasa fija</h2>
</div>
<div class="container grid gap-12 grid-col-1 lg:grid-cols-2">
<nb-card>
<nb-card-header>Información Ahorro CDAT</nb-card-header>
<nb-card class="h-full">
<nb-card-header><h3 class="h4">Información Ahorro CDAT</h3></nb-card-header>
<nb-card-body>
<form [formGroup]="form">
<div class="flex flex-col space-y-6">
Expand Down Expand Up @@ -72,7 +76,8 @@ <h6>Plazo de la inversión</h6>
style="width: 60%"
nbButton
shape="round"
status="primary"
class="btn"
[disabled]="haSimulado"
(click)="onClick()"
>
Simular
Expand Down
18 changes: 13 additions & 5 deletions src/app/pages/cdat/cdat.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export class CdatPage {
valorCuota = 0;
interes = 0;
totalahorrado = 0;
haSimulado = false;
form!: FormGroup;


tipoCredito = ['Vivienda', 'Prestamo', 'Estudio'];

options: any = [
Expand Down Expand Up @@ -108,18 +110,24 @@ export class CdatPage {
this.valorCuota = valorCuota[0];
this.interes = valorCuota[1];
this.totalahorrado=parseFloat(this.montoPrestamo.value)+valorCuota[0];
this.haSimulado = true;
} else {
this.toastrService.show('',`'Error '${this.montoPrestamo.value}`,
{
status: 'warning'
}
);
this.toastrService.show('',`'Error '${this.montoPrestamo.value}`, { status: 'warning' });
}

}
}
onClickContacto(): void {}

onClickNumCuotas(e: any) {
this.resetValues()
this.form.patchValue({ numeroCuotas: e.value });
this.haSimulado = false;
}

private resetValues(): void {
this.valorCuota = 0;
this.interes = 0;
this.totalahorrado = 0;
}
}
10 changes: 7 additions & 3 deletions src/app/pages/comercio/comercio.page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="mb-12 text-center">
<h1 class="text-brand-blue-100">SIMULADOR DE CRÉDITO</h1>
<h2>cuota fija y tasa fija</h2>
</div>
<div class="container grid gap-12 grid-col-1 lg:grid-cols-2">
<nb-card>
<nb-card-header>Información Crédito De Comercio</nb-card-header>
<nb-card class="h-full">
<nb-card-header><h3 class="h4">Información Crédito De Comercio</h3></nb-card-header>
<nb-card-body>
<form [formGroup]="form">
<div class="flex flex-col space-y-6">
Expand Down Expand Up @@ -63,7 +67,7 @@ <h6>Plazo del credito</h6>
style="width: 60%"
nbButton
shape="round"
status="primary"
class="btn"
(click)="onClick()"
>
Simular
Expand Down
10 changes: 7 additions & 3 deletions src/app/pages/contractuales/contractuales.page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="mb-12 text-center">
<h1 class="text-brand-blue-100">SIMULADOR DE AHORRO</h1>
<h2>cuota fija y tasa fija</h2>
</div>
<div class="container grid gap-12 grid-col-1 lg:grid-cols-2">
<nb-card>
<nb-card-header>Información Ahorro Contractual</nb-card-header>
<nb-card class="h-full">
<nb-card-header><h3 class="h4">Información Ahorro Contractual</h3></nb-card-header>
<nb-card-body>
<form [formGroup]="form">
<div class="flex flex-col space-y-6">
Expand Down Expand Up @@ -70,7 +74,7 @@ <h6>Plazo de la inversión</h6>
style="width: 60%"
nbButton
shape="round"
status="primary"
class="btn"
(click)="onClick()"
>
Simular
Expand Down
10 changes: 7 additions & 3 deletions src/app/pages/credifacil/credifacil.page.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="mb-12 text-center">
<h1 class="text-brand-blue-100">SIMULADOR DE CRÉDITO</h1>
<h2>cuota fija y tasa fija</h2>
</div>
<div class="container grid gap-12 grid-col-1 lg:grid-cols-2">
<nb-card>
<nb-card-header>Información Crédito CrediFacil</nb-card-header>
<nb-card class="h-full">
<nb-card-header><h3 class="h4">Información Crédito CrediFacil</h3></nb-card-header>
<nb-card-body>
<form [formGroup]="form">
<div class="flex flex-col space-y-6">
Expand Down Expand Up @@ -70,7 +74,7 @@ <h6>Plazo del credito</h6>
style="width: 60%"
nbButton
shape="round"
status="primary"
class="btn"
(click)="onClick()"
>
Simular
Expand Down
Loading

0 comments on commit f13adc4

Please sign in to comment.