mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<ion-content class="text-white">
|
||||
<div class="wrapper" *ngIf="pin ==false">
|
||||
<div class="wrapper" *ngIf="userLoginPreference != 'pin' && userLoginPreference != 'fingerprint' && !setPint">
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/logo-no-bg.png' alt='logo'>
|
||||
</div>
|
||||
@@ -17,7 +17,7 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="main-content height-100" *ngIf="pin">
|
||||
<div class="main-content height-100" *ngIf="userLoginPreference == 'pin' || setPint">
|
||||
<div class=" align-center justify-center">
|
||||
<div class="div-top-header">
|
||||
|
||||
@@ -55,9 +55,14 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="voltar d-flex align-center justify-center pt-25 clear" (click)="pin=!pin">
|
||||
Voltar
|
||||
<div *ngIf="!setPint" class="voltar d-flex align-center justify-center pt-25 clear" (click)="pin=!pin">
|
||||
Entrar com senha
|
||||
</div>
|
||||
|
||||
<div *ngIf="setPint" class="voltar d-flex align-center justify-center pt-25 clear" (click)="pin=!pin">
|
||||
Limpar
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ export class LoginPage implements OnInit {
|
||||
|
||||
pin = localStorage.getItem('PIN') != null
|
||||
|
||||
userLoginPreference: any
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private notificatinsservice: NotificationsService,
|
||||
@@ -48,7 +50,17 @@ export class LoginPage implements OnInit {
|
||||
public alertController: AlertController,
|
||||
private modalController: ModalController
|
||||
//private fcm: FCM
|
||||
) { }
|
||||
) {
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
this.userLoginPreference = userData.loginPreference
|
||||
} else {
|
||||
this.userLoginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
@@ -60,6 +72,7 @@ export class LoginPage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
async presentAlert(message: string) {
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
@@ -125,6 +138,8 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
|
||||
setCode(code: string) {
|
||||
|
||||
|
||||
if(this.code.length < 4) {
|
||||
this.code.push(code)
|
||||
}
|
||||
@@ -163,6 +178,7 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
|
||||
storePin() {
|
||||
|
||||
const code = this.code.join('')
|
||||
const encrypted = crypto.SHA1(code)
|
||||
|
||||
|
||||
@@ -29,15 +29,16 @@
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="align-center d-flex">
|
||||
<div (click)="addPin()" class="d-flex align-center">
|
||||
<ion-checkbox class="checkBox"></ion-checkbox>
|
||||
<div class="d-flex align-center" (click)="LoginPreferenceMethod('pin')">
|
||||
<!-- -->
|
||||
<ion-checkbox [checked]="userLoginPreference=='pin' " class="checkBox" ></ion-checkbox>
|
||||
PIN
|
||||
</div>
|
||||
|
||||
</ion-col>
|
||||
<ion-col class="align-center d-flex">
|
||||
<div (click)="addFingerprint()" class="d-flex align-center">
|
||||
<ion-checkbox class="checkBox"></ion-checkbox>
|
||||
<ion-checkbox class="checkBox" [checked]="false"></ion-checkbox>
|
||||
Impressão Digital
|
||||
</div>
|
||||
</ion-col>
|
||||
@@ -46,22 +47,25 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-center mt-10">
|
||||
<ion-buttons slot="start" class="buttonSize" (click)="logout()" >
|
||||
<ion-button class="btn-cancel buttonSize" fill="clear" style="background:#ffe0e0;" >
|
||||
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-center mt-10">
|
||||
<ion-button (click)="addPin()" class="btn-ok buttonSize" fill="clear" color="#fff" >
|
||||
<ion-label>Alterar PIN</ion-label>
|
||||
</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
|
||||
<ion-footer class=" footer-container ion-no-border bg-blue">
|
||||
|
||||
<div class="d-flex justify-center mb-10">
|
||||
<ion-buttons slot="start" (click)="logout()">
|
||||
<ion-button class="btn-cancel" fill="clear"style="background:#ffe0e0;" >
|
||||
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-space-between">
|
||||
|
||||
<ion-buttons slot="start" (click)="close()">
|
||||
@@ -74,7 +78,6 @@
|
||||
<ion-label>Gravar</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-footer>
|
||||
@@ -57,4 +57,8 @@
|
||||
.checkBox{
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttonSize {
|
||||
width: 100% !important;
|
||||
}
|
||||
@@ -110,5 +110,37 @@ export class ProfileComponent implements OnInit {
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
|
||||
LoginPreferenceMethod(type: string) {
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
if (userData.loginPreference != type) {
|
||||
if (type) {
|
||||
userData.loginPreference = type
|
||||
}
|
||||
} else {
|
||||
userData.loginPreference = 'none'
|
||||
}
|
||||
|
||||
} else {
|
||||
userData.loginPreference = 'none'
|
||||
}
|
||||
|
||||
localStorage.setItem('UserData', JSON.stringify(userData) )
|
||||
}
|
||||
|
||||
get userLoginPreference() {
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
console.log( userData.loginPreference)
|
||||
return userData.loginPreference
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
|
||||
<div (click)="close()" class="d-flex align-center justify-center pt-25 clear">
|
||||
Voltar
|
||||
Cancelar
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user