mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add and takepicture bug solved on group chat
This commit is contained in:
@@ -216,13 +216,13 @@
|
||||
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button hidden title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-icon name="document"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||
<ion-icon name="image"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Tirar Fotografia" (click)="takePicture()" color="light">
|
||||
<ion-fab-button title="Tirar Fotografia" (click)="takePictureMobile()" color="light">
|
||||
<ion-icon name="camera"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Documento da Gestão Documental" (click)="addFileWebtrix()" color="light">
|
||||
|
||||
@@ -32,6 +32,7 @@ import { CameraService } from 'src/app/services/camera.service';
|
||||
import { element } from 'protractor';
|
||||
import { FileType } from 'src/app/models/fileType';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||
|
||||
/*
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
@@ -542,6 +543,41 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
async takePictureMobile() {
|
||||
const roomId = this.roomId
|
||||
|
||||
const file = await Camera.getPhoto({
|
||||
quality: 90,
|
||||
// allowEditing: true,
|
||||
resultType: CameraResultType.Base64,
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
console.log('ADDFILECHAT', file)
|
||||
//const imageData = await this.fileToBase64Service.convert(file)
|
||||
//console.log('ADDFILECHAT', imageData)
|
||||
|
||||
const response = await fetch('data:image/jpeg;base64,'+ file.base64String!);
|
||||
const blob = await response.blob();
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "application/img",
|
||||
"guid": '',
|
||||
},
|
||||
temporaryData: formData,
|
||||
attachments: [{
|
||||
"title": file.path ,
|
||||
"image_url": 'data:image/jpeg;base64,' +file.base64String,
|
||||
"text": "description",
|
||||
"title_link_download": false,
|
||||
}]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
async takePicture() {
|
||||
const roomId = this.roomId
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
<ion-fab-button title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Adicionar Documento" hidden (click)="addFile()" color="light">
|
||||
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-icon name="document"></ion-icon>
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||
|
||||
Reference in New Issue
Block a user