profile pictures
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { NavController } from '@ionic/angular';
|
||||
import {LoadingController, NavController} from '@ionic/angular';
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
import { WrenchService } from 'src/app/services/wrench.service';
|
||||
@@ -20,6 +20,7 @@ export class EditProfilePage implements OnInit {
|
||||
constructor(
|
||||
private navctr: NavController,
|
||||
public sessionDataProviderService:SessionDataProviderService,
|
||||
private loadingCtrl: LoadingController,
|
||||
private wrenchService: WrenchService,
|
||||
) {
|
||||
// this.firstname = this.sessionDataProviderService.firstname;
|
||||
@@ -104,6 +105,19 @@ export class EditProfilePage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
uploadData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
msg_type:'FILE',
|
||||
file_name: string,
|
||||
file_size: number,
|
||||
file_type: string,
|
||||
file_data: string
|
||||
};
|
||||
|
||||
uploadResult:any;
|
||||
async startCamera(){
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 90,
|
||||
@@ -113,9 +127,35 @@ export class EditProfilePage implements OnInit {
|
||||
});
|
||||
|
||||
if (image) {
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Uploading Profile',
|
||||
duration: 5000,
|
||||
});
|
||||
// this.saveImage(image)
|
||||
console.log(image);
|
||||
}
|
||||
//debugger;
|
||||
//image.base64String
|
||||
this.uploadData={
|
||||
action:11300,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
msg_type:'FILE',
|
||||
file_name: `family-banner.${image.format}`,
|
||||
file_size: image.base64String.toString().length,
|
||||
file_type: `image/${image.format}`,
|
||||
file_data: image.base64String
|
||||
};
|
||||
//console.log(image);
|
||||
loading.present();
|
||||
this.wrenchService.uploadFile(this.uploadData).subscribe(
|
||||
uploadResult => {
|
||||
this.uploadResult = uploadResult;
|
||||
console.log("this.wrenchService.uploadFile RETURN DATA->", this.uploadResult);
|
||||
}
|
||||
);
|
||||
|
||||
console.log( this.uploadData);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user