mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
added croppe to new publications on mobile
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
|
||||
<ion-content>
|
||||
|
||||
<!-- <div style="height: 100%; width: 100%;">
|
||||
<div style="height: 100%; width: 100%;">
|
||||
<image-cropper
|
||||
[imageBase64]="this.capturedImage"
|
||||
[imageBase64]="this.base64ToCroppe"
|
||||
[maintainAspectRatio]="true"
|
||||
[aspectRatio]="1 / 1"
|
||||
format="jpeg"
|
||||
@@ -17,6 +17,27 @@
|
||||
(imageLoaded)="imageLoaded($event)"
|
||||
(loadImageFailed)="loadImageFailed()"
|
||||
></image-cropper>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div>
|
||||
<button (click)="save()">Salvar</button>
|
||||
<button (click)="cancel()">Cancelar</button>
|
||||
</div> -->
|
||||
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="footer-toolbar">
|
||||
<ion-buttons slot="start">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" (click)="cancel()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { NavParams } from '@ionic/angular';
|
||||
import { ImageCroppedEvent, ImageCropperComponent } from 'ngx-image-cropper';
|
||||
|
||||
@Component({
|
||||
@@ -12,10 +14,18 @@ export class CropImagePage implements OnInit {
|
||||
croppedImage: any = '';
|
||||
@ViewChild('cropper') cropper: ImageCropperComponent;
|
||||
capturedImage: any = "";
|
||||
base64ToCroppe = "";
|
||||
|
||||
constructor() { }
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
private modalController: ModalController,
|
||||
) {
|
||||
this.base64ToCroppe = this.navParams.get('base64ToCroppe')
|
||||
console.log('To cropp',this.base64ToCroppe)
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log('To cropp',this.base64ToCroppe)
|
||||
}
|
||||
|
||||
fileChangeEvent(event: any): void {
|
||||
@@ -28,19 +38,23 @@ export class CropImagePage implements OnInit {
|
||||
console.log('Croped image 22',this.croppedImage)
|
||||
// event.blob can be used to upload the cropped image
|
||||
}
|
||||
/* cropperReady() {
|
||||
if(this.croppedImage != '')
|
||||
var fileObject = {
|
||||
FileBase64: this.croppedImage,
|
||||
FileExtension: 'jpeg',
|
||||
OriginalFileName: 'image',
|
||||
FileSize: this.fileSizeToMB(this.croppedImage.length)
|
||||
}
|
||||
this.seletedContent.push(fileObject)
|
||||
return true
|
||||
|
||||
imageLoaded($event){
|
||||
|
||||
}
|
||||
|
||||
loadImageFailed() {
|
||||
// show message
|
||||
} */
|
||||
console.log('cropp iage faile')
|
||||
}
|
||||
|
||||
save() {
|
||||
this.modalController.dismiss({
|
||||
base64ToCroppe: this.croppedImage
|
||||
});
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.modalController.dismiss()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user