This commit is contained in:
tiago.kayaya
2021-06-09 10:01:45 +01:00
parent 419330e572
commit cb658bfa1f
8 changed files with 112 additions and 18 deletions
@@ -431,7 +431,7 @@ export class DespachoPage implements OnInit {
return this.animationController.create() return this.animationController.create()
.addElement(baseEl) .addElement(baseEl)
.easing('ease-out') .easing('ease-out')
.duration(500) .duration(7000)
.addAnimation([backdropAnimation, wrapperAnimation]); .addAnimation([backdropAnimation, wrapperAnimation]);
} }
@@ -474,7 +474,7 @@ export class DespachoPage implements OnInit {
return this.animationController.create() return this.animationController.create()
.addElement(baseEl) .addElement(baseEl)
.easing('ease-out') .easing('ease-out')
.duration(500) .duration(7000)
.addAnimation([backdropAnimation, wrapperAnimation]); .addAnimation([backdropAnimation, wrapperAnimation]);
} }
@@ -2,7 +2,7 @@
<app-header></app-header> <app-header></app-header>
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)"> <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content> <ion-refresher-content>
</ion-refresher-content> </ion-refresher-content>
@@ -37,7 +37,7 @@ export class EventListPage implements OnInit {
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) { if(event instanceof NavigationEnd && event.url == this.router.url) {
this.LoadToApproveEvents(); this.doRefresh();
} }
}); });
@@ -96,11 +96,10 @@ export class EventListPage implements OnInit {
doRefresh(event) { doRefresh() {
this.LoadToApproveEvents(); this.LoadToApproveEvents();
console.log('refresh'); console.log('refresh');
setTimeout(() => { setTimeout(() => {
event.target.complete();
}, 2000); }, 2000);
} }
close(){ close(){
+8 -1
View File
@@ -41,7 +41,8 @@ ion-item{
--background: transparent; --background: transparent;
} }
.form{ .form{
width: 400px; width: 300px;
margin: auto;
overflow: auto; overflow: auto;
} }
.form-label{ .form-label{
@@ -160,3 +161,9 @@ ion-item{
text-align: center; text-align: center;
} }
} }
@media only screen and (min-width: 1024px){
.form{
width: 400px;
}
}
+5 -2
View File
@@ -1,12 +1,15 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AlertController } from '@ionic/angular'; import { AlertController, AnimationController } from '@ionic/angular';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class AlertService { export class AlertService {
constructor(public alertController: AlertController) { } constructor(
public alertController: AlertController,
private animationController: AnimationController,
) { }
async presentAlert(message:string) { async presentAlert(message:string) {
const alert = await this.alertController.create({ const alert = await this.alertController.create({
+94 -2
View File
@@ -1,12 +1,18 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { ToastController } from '@ionic/angular'; import { AnimationController, ModalController, ToastController } from '@ionic/angular';
import { BadRequestPage } from '../shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from '../shared/popover/success-message/success-message.page';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class ToastService { export class ToastService {
constructor(public toastController: ToastController) { } constructor(
public toastController: ToastController,
private animationController: AnimationController,
private modalController: ModalController,
) { }
async presentToast(infoMessage: string) { async presentToast(infoMessage: string) {
const toast = await this.toastController.create({ const toast = await this.toastController.create({
@@ -16,4 +22,90 @@ export class ToastService {
toast.present(); toast.present();
} }
async successMessage(message?: string) {
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(7000)
.addAnimation([backdropAnimation, wrapperAnimation]);
}
const leaveAnimation = (baseEl: any) => {
return enterAnimation(baseEl).direction('reverse');
}
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: SuccessMessagePage,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'notification-modal'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
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(7000)
.addAnimation([backdropAnimation, wrapperAnimation]);
}
const leaveAnimation = (baseEl: any) => {
return enterAnimation(baseEl).direction('reverse');
}
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: BadRequestPage,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'notification-modal'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
} }
@@ -119,11 +119,6 @@ export class EventsToApprovePage implements OnInit {
}); });
} */ } */
lis(){
console.log('Teste');
}
doRefresh() { doRefresh() {
console.log('Refresh Events'); console.log('Refresh Events');
@@ -4,6 +4,4 @@
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon> <ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon>
{{ message }} {{ message }}
</p> </p>
</div> </div>