Files
doneit-web/src/app/modals/preview-camera/preview-camera.page.ts
T

107 lines
2.2 KiB
TypeScript
Raw Normal View History

2021-11-17 15:34:15 +01:00
import { Component, OnInit, ViewChild } from '@angular/core';
import { IonSlides, ModalController, NavParams } from '@ionic/angular';
2021-11-18 13:01:53 +01:00
import { ImageCroppedEvent } from 'ngx-image-cropper';
2021-11-29 15:48:35 +01:00
import { PublicationsService } from 'src/app/services/publications.service';
2021-11-18 13:01:53 +01:00
import { GroupIconsPage } from '../group-icons/group-icons.page';
2021-11-17 15:34:15 +01:00
@Component({
selector: 'app-preview-camera',
templateUrl: './preview-camera.page.html',
styleUrls: ['./preview-camera.page.scss'],
})
export class PreviewCameraPage implements OnInit {
constructor( private modalController: ModalController,
2021-11-29 15:48:35 +01:00
private navParams:NavParams,
private publicService: PublicationsService) { }
2021-11-17 15:34:15 +01:00
@ViewChild(IonSlides) slides : IonSlides
image: any;
username: string
_updatedAt: string
2021-11-18 13:01:53 +01:00
// myimage: null
// croppedImageBase64: any
2021-11-17 15:34:15 +01:00
// @Input('img') img: any
// @Input() username: string;
// @Input() date: string;
slideOpts = {
zoom: true
}
ngOnInit() {
this.image = this.navParams.get('image')
this.username = this.navParams.get('username')
this._updatedAt = this.navParams.get('_updatedAt')
console.log(this.image)
2021-11-18 13:01:53 +01:00
// this.image = this.myimage
2021-11-17 15:34:15 +01:00
}
ionViewDidEnter(){
this.slides.update()
}
async zoom(zoomIn: boolean){
const slider = await this.slides.getSwiper() //is swipper =!
const zoom = slider.zoom
zoomIn ? zoom.in(): zoom.out()
}
close(){
this.modalController.dismiss()
}
2021-11-18 13:01:53 +01:00
// imageCropped(ev: ImageCroppedEvent){
// this.croppedImageBase64 = ev.base64
// }
// async grupo(){
// const modal = await this.modalController.create({
// component: GroupIconsPage,
// cssClass: 'transparent-modal',
// });
// modal.present();
// }
2021-11-19 08:51:10 +01:00
async getIconGallery(){
const modal = await this.modalController.create({
component: GroupIconsPage ,
animated: true,
2021-11-29 15:48:35 +01:00
cssClass: 'transparent-modal',
2021-11-19 08:51:10 +01:00
});
modal.present();
}
2021-11-17 15:34:15 +01:00
2021-11-22 13:53:37 +01:00
openChat(){
2021-11-17 15:34:15 +01:00
2021-11-22 13:53:37 +01:00
2021-11-29 15:48:35 +01:00
}
clear() {
this.getIconGallery()
2021-11-23 16:05:32 +01:00
}
openChatVideo(){
2021-11-22 13:53:37 +01:00
}
2021-11-29 15:48:35 +01:00
deleteImage(){
window.onload = function(){
const delmage = document.getElementById("img")
delmage.onclick = function(){
return window.localStorage.removeItem("img")
}
2021-11-18 13:01:53 +01:00
2021-11-29 15:48:35 +01:00
}
2021-11-19 08:51:10 +01:00
2021-11-29 15:48:35 +01:00
}
}