Add Beneficios
This commit is contained in:
@@ -70,6 +70,10 @@
|
||||
<span>DNI: {{ siuDni }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<ion-button expand="block" fill="outline" color="primary" (click)="generateCertificate()" class="btn-cert">
|
||||
<ion-icon name="document-text-outline" slot="start"></ion-icon>
|
||||
Certificado de Alumno Regular
|
||||
</ion-button>
|
||||
<ion-button expand="block" fill="clear" color="danger" (click)="logoutSiu()" class="btn-logout">
|
||||
<ion-icon name="log-out-outline" slot="start"></ion-icon>
|
||||
Cerrar sesión SIU
|
||||
@@ -167,6 +171,39 @@
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<!-- Beneficios del Estudiante -->
|
||||
<div class="section-header ion-padding-horizontal">
|
||||
<h3>Beneficios del Estudiante</h3>
|
||||
<p>Aprovechá convenios exclusivos por ser parte de UNICABA.</p>
|
||||
</div>
|
||||
|
||||
<ion-row class="benefits-row">
|
||||
<ion-col size="6">
|
||||
<ion-card class="benefit-card" (click)="showBenefitDetail('soy')">
|
||||
<div class="benefit-icon-container soy">
|
||||
<ion-icon name="school-outline"></ion-icon>
|
||||
</div>
|
||||
<ion-card-content>
|
||||
<h4>SOY Estudiante</h4>
|
||||
<p>Descuentos en pasajes de micro.</p>
|
||||
<ion-badge color="success">Activo</ion-badge>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-col>
|
||||
<ion-col size="6">
|
||||
<ion-card class="benefit-card" (click)="showBenefitDetail('google')">
|
||||
<div class="benefit-icon-container google">
|
||||
<ion-icon name="logo-google" color="primary"></ion-icon>
|
||||
</div>
|
||||
<ion-card-content>
|
||||
<h4>Google Students</h4>
|
||||
<p>Gemini PRO & Drive 1TB.</p>
|
||||
<ion-badge color="tertiary">Bonificado</ion-badge>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
|
||||
<div class="security-info ion-padding">
|
||||
<ion-icon name="lock-closed" color="medium"></ion-icon>
|
||||
|
||||
@@ -189,65 +189,100 @@
|
||||
}
|
||||
}
|
||||
|
||||
.info-section-container {
|
||||
background: white;
|
||||
border-radius: 20px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
|
||||
|
||||
.section-title {
|
||||
.btn-cert {
|
||||
margin-top: 12px;
|
||||
--border-radius: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-top: 24px;
|
||||
h3 {
|
||||
margin: 0;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
font-size: 1.1rem;
|
||||
color: var(--ion-color-dark);
|
||||
margin: 0 0 15px 0;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
p {
|
||||
margin: 4px 0 0;
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
color: var(--ion-color-medium);
|
||||
margin-bottom: 15px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
|
||||
ion-icon {
|
||||
font-size: 1.4rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
strong {
|
||||
color: var(--ion-color-dark);
|
||||
}
|
||||
}
|
||||
|
||||
.version-info {
|
||||
margin-top: 20px;
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
padding-top: 15px;
|
||||
color: var(--ion-color-medium);
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
.error-text {
|
||||
color: var(--ion-color-danger);
|
||||
font-size: 0.85rem;
|
||||
margin-top: 10px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
.benefits-row {
|
||||
padding: 0 8px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
||||
.benefit-card {
|
||||
margin: 8px;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 16px);
|
||||
transition: transform 0.2s;
|
||||
overflow: hidden;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.96);
|
||||
}
|
||||
|
||||
.benefit-icon-container {
|
||||
height: 80px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&.soy {
|
||||
background: linear-gradient(135deg, #f0f7ff 0%, #e0e7ff 100%);
|
||||
ion-icon { font-size: 40px; color: #1a73e8; }
|
||||
}
|
||||
|
||||
&.google {
|
||||
background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
|
||||
ion-icon { font-size: 40px; }
|
||||
}
|
||||
}
|
||||
|
||||
ion-card-content {
|
||||
padding: 12px;
|
||||
text-align: center;
|
||||
|
||||
h4 {
|
||||
margin: 0;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
color: var(--ion-color-dark);
|
||||
}
|
||||
p {
|
||||
margin: 6px 0;
|
||||
font-size: 0.75rem;
|
||||
color: var(--ion-color-medium);
|
||||
line-height: 1.2;
|
||||
}
|
||||
ion-badge {
|
||||
font-size: 0.65rem;
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.security-info {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
gap: 10px;
|
||||
opacity: 0.7;
|
||||
|
||||
ion-icon {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 0.8rem;
|
||||
margin: 0;
|
||||
@@ -255,3 +290,20 @@
|
||||
max-width: 280px;
|
||||
}
|
||||
}
|
||||
|
||||
:host ::ng-deep .benefit-alert {
|
||||
.alert-message {
|
||||
text-align: left;
|
||||
}
|
||||
.benefit-modal-content {
|
||||
b { color: var(--ion-color-primary); }
|
||||
ol {
|
||||
padding-left: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
li {
|
||||
margin-bottom: 8px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,50 @@ export class PerfilPage implements OnInit, OnDestroy {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
// --- AUTOMATIZACIÓN DE CERTIFICADOS ---
|
||||
|
||||
async generateCertificate() {
|
||||
const creds = await this.authService.getSiuCredentials();
|
||||
if (!creds.dni || !creds.pass) {
|
||||
this.showToast('Debe estar conectado al SIU para generar el certificado', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
const loader = await this.loadingCtrl.create({
|
||||
message: 'Gestionando Certificado en SIU Guaraní...<br><small>Esto puede demorar unos segundos</small>',
|
||||
spinner: 'crescent'
|
||||
});
|
||||
await loader.present();
|
||||
|
||||
try {
|
||||
const result = await this.siuService.downloadCertificate(creds.dni, creds.pass);
|
||||
await this.siuService.saveAndOpenFile(result.base64, result.filename);
|
||||
|
||||
this.showToast('¡Certificado generado y abierto!', 'success');
|
||||
await Haptics.impact({ style: ImpactStyle.Heavy }).catch(() => { });
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
const alert = await this.alertCtrl.create({
|
||||
header: 'Error de Certificado',
|
||||
message: `No se pudo automatizar la descarga: ${e.message || 'Error desconocido'}. Por favor, intentalo más tarde o desde el SIU web.`,
|
||||
buttons: ['Entendido']
|
||||
});
|
||||
await alert.present();
|
||||
} finally {
|
||||
await loader.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
async showBenefitDetail(type: 'soy' | 'google') {
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: InfoModalComponent,
|
||||
componentProps: {
|
||||
selectedSegment: 'benefits'
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
// --- NUEVAS FUNCIONES CONSOLIDADAS ---
|
||||
|
||||
async openInfo() {
|
||||
|
||||
Reference in New Issue
Block a user