diff --git a/src/app/shared/fingerprint/fingerprint.page.html b/src/app/shared/fingerprint/fingerprint.page.html index a8d5a4a8a..b5127e50e 100644 --- a/src/app/shared/fingerprint/fingerprint.page.html +++ b/src/app/shared/fingerprint/fingerprint.page.html @@ -9,52 +9,17 @@ - Digite o PIN novo -
-
-
-
-
-
-
+ .... -
-
1
2
3
-
+
-
-
4
5
6
-
+
Login
-
-
7
8
9
-
+
Register
-
-
0
-
-
- Limpar -
- - -
- - - Cancelar - - - - - Gravar - - -
- -
diff --git a/src/app/shared/fingerprint/fingerprint.page.ts b/src/app/shared/fingerprint/fingerprint.page.ts index f647aaab5..4a73ff357 100644 --- a/src/app/shared/fingerprint/fingerprint.page.ts +++ b/src/app/shared/fingerprint/fingerprint.page.ts @@ -12,31 +12,32 @@ import { FingerprintAIO } from '@ionic-native/fingerprint-aio'; export class FingerprintPage implements OnInit { constructor( private modalController: ModalController, - private faio: FingerprintAIO) { + //private faio: FingerprintAIO + ) { } ngOnInit() { } login() { - this.faio.show({ - clientId: 'Fingerprint-Demo', - clientSecret: 'password', //Only necessary for Android - disableBackup:true, //Only for Android(optional) - localizedFallbackTitle: 'Use Pin', //Only for iOS - localizedReason: 'Please authenticate' //Only for iOS - }) - .then((FingerPrintHash: any) => { - console.log(FingerPrintHash) + // this.faio.show({ + // clientId: 'Fingerprint-Demo', + // clientSecret: 'password', //Only necessary for Android + // disableBackup:true, //Only for Android(optional) + // localizedFallbackTitle: 'Use Pin', //Only for iOS + // localizedReason: 'Please authenticate' //Only for iOS + // }) + // .then((FingerPrintHash: any) => { + // console.log(FingerPrintHash) - const storedFinderPrint = localStorage.getItem('FingerPrintHash') - if(FingerPrintHash == storedFinderPrint) { + // const storedFinderPrint = localStorage.getItem('FingerPrintHash') + // if(FingerPrintHash == storedFinderPrint) { - } - }) - .catch((error: any) => { - console.log(error) - }); + // } + // }) + // .catch((error: any) => { + // console.log(error) + // }); } close() { @@ -46,20 +47,20 @@ export class FingerprintPage implements OnInit { async save() { - this.faio.show({ - clientId: 'Fingerprint-Demo', - clientSecret: 'password', //Only necessary for Android - disableBackup:true, //Only for Android(optional) - localizedFallbackTitle: 'Use Pin', //Only for iOS - localizedReason: 'Please authenticate' //Only for iOS - }) - .then((FingerPrintHash: any) => { - this.successMessage() - localStorage.setItem('FingerPrintHash', FingerPrintHash) - }) - .catch((error: any) => { - this.badRequest() - }); + // this.faio.show({ + // clientId: 'Fingerprint-Demo', + // clientSecret: 'password', //Only necessary for Android + // disableBackup:true, //Only for Android(optional) + // localizedFallbackTitle: 'Use Pin', //Only for iOS + // localizedReason: 'Please authenticate' //Only for iOS + // }) + // .then((FingerPrintHash: any) => { + // this.successMessage() + // localStorage.setItem('FingerPrintHash', FingerPrintHash) + // }) + // .catch((error: any) => { + // this.badRequest() + // }); } diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.html b/src/app/shared/headers/header-no-search/profile/profile.page.html index 50682e210..f962248d5 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.html +++ b/src/app/shared/headers/header-no-search/profile/profile.page.html @@ -31,15 +31,19 @@ -
+
+ + PIN +
+ + + +
Impressão Digital
- - - PIN - +
diff --git a/src/app/shared/headers/header-no-search/profile/profile.page.ts b/src/app/shared/headers/header-no-search/profile/profile.page.ts index 509164ec7..3f34aebd7 100644 --- a/src/app/shared/headers/header-no-search/profile/profile.page.ts +++ b/src/app/shared/headers/header-no-search/profile/profile.page.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AnimationController, ModalController } from '@ionic/angular'; import { User } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; +import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page'; import { PinPage } from 'src/app/shared/pin/pin.page'; @Component({ @@ -66,4 +67,42 @@ export class ProfileComponent implements OnInit { } + async addFingerprint() { + const enterAnimation = (baseEl: any) => { + const backdropAnimation = this.animationController.create() + .addElement(baseEl.querySelector('ion-backdrop')!) + .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); + + const wrapperAnimation = this.animationController.create() + .addElement(baseEl.querySelector('.modal-wrapper')!) + .keyframes([ + { offset: 0, opacity: '1', right: '-100%' }, + { offset: 1, opacity: '1', right: '0px' } + ]); + + return this.animationController.create() + .addElement(baseEl) + .easing('ease-out') + .duration(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + + const modal = await this.modalController.create({ + enterAnimation, + leaveAnimation, + component: FingerprintPage, + cssClass: 'model profile-modal', + componentProps: { + } + }); + + modal.present(); + } + + }