\ No newline at end of file
diff --git a/src/app/pages/activetask/activetask.page.html b/src/app/pages/activetask/activetask.page.html
index 2ac67b2..7b0da53 100644
--- a/src/app/pages/activetask/activetask.page.html
+++ b/src/app/pages/activetask/activetask.page.html
@@ -48,27 +48,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
Description
{{jobData.job_description}}
@@ -96,15 +84,18 @@
-
+
-
+
- Send Updates
+ Send Updates
diff --git a/src/app/pages/activetask/activetask.page.ts b/src/app/pages/activetask/activetask.page.ts
index 60012ee..6051327 100644
--- a/src/app/pages/activetask/activetask.page.ts
+++ b/src/app/pages/activetask/activetask.page.ts
@@ -1,9 +1,10 @@
import {Component, OnInit, ViewChild} from '@angular/core';
-import {AlertController, NavController} from "@ionic/angular";
+import {AlertController, LoadingController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
import { BlogDataService } from 'src/app/store/blog-data.service';
import { WrenchService } from 'src/app/services/wrench.service';
+import {Camera, CameraResultType, CameraSource} from "@capacitor/camera";
@Component({
selector: 'app-activetask',
@@ -24,7 +25,8 @@ export class ActivetaskPage implements OnInit {
public sessionDataProviderService: SessionDataProviderService,
private alertController:AlertController,
private wrenchService: WrenchService,
- public blogDataService: BlogDataService
+ public blogDataService: BlogDataService,
+ private loadingCtrl: LoadingController
) {
this.yourmessage='';
this.jobData = this.router.getCurrentNavigation().extras.state;
@@ -32,6 +34,9 @@ export class ActivetaskPage implements OnInit {
console.log("XXXXX 2", this.router.getCurrentNavigation().extras.state);
//console.log("XXXXX 3", this.router.getCurrentNavigation().extras.state.ID);
this.status_description = this.jobData?.status_description;
+ if ( this.jobData == undefined || this.jobData.status_description==''){
+ this.onBack();
+ }
}
ngOnInit() {
@@ -115,12 +120,16 @@ export class ActivetaskPage implements OnInit {
interest_msg_status:string = "";
msgReqResult:any;
- sendActiveJobMessage(){
+ async sendActiveJobMessage(){
if (this.yourmessage == undefined || this.yourmessage?.length < 5){
alert("Enter Message to send");
return;
}
+ const loading = await this.loadingCtrl.create({
+ message: 'Sending...',
+ duration: 2500,
+ });
this.reqData = {action:14010,
member_id: this.sessionDataProviderService.member_id,
uid: this.sessionDataProviderService.member_uid,
@@ -130,6 +139,7 @@ export class ActivetaskPage implements OnInit {
message: this.yourmessage
}
+ loading.present();
this.wrenchService.sendTaskMessage(this.reqData).subscribe(
reqResult => {
this.msgReqResult = reqResult;
@@ -227,5 +237,62 @@ export class ActivetaskPage implements OnInit {
}
+ uploadData: {
+ action:number,
+ member_id: number,
+ uid: string,
+ family_uid: string,
+ sessionid: string,
+ msg_type:'FILE',
+ file_name: string,
+ file_size: number,
+ file_type: string,
+ file_data: string
+ };
+
+ uploadResult:any;
+ async startCamera(cameraMode){
+ const image = await Camera.getPhoto({
+ quality: 50,
+ width : 600,
+ height : 300,
+ allowEditing: false,
+ resultType: CameraResultType.Base64,
+ source: (cameraMode == 100 ) ? CameraSource.Camera : CameraSource.Photos // Camera, Photos or Prompt!
+ });
+
+ if (image) {
+ const loading = await this.loadingCtrl.create({
+ message: 'Uploading updates',
+ duration: 5000,
+ });
+ var file_size = parseInt(String(image.base64String.toString().length / 1.3224954) ) ;
+ // this.saveImage(image)
+ //debugger;
+ //image.base64String
+ this.uploadData={
+ action:11305,
+ member_id: this.sessionDataProviderService.member_id,
+ uid: this.sessionDataProviderService.member_uid,
+ family_uid: 'FAKE',
+ sessionid: this.sessionDataProviderService.session ,
+ msg_type:'FILE',
+ file_name: `family-banner.${image.format}`,
+ file_size: file_size ,
+ 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);
+ }
+ }
}
diff --git a/src/global.scss b/src/global.scss
index ba7e54b..d732bad 100644
--- a/src/global.scss
+++ b/src/global.scss
@@ -118,15 +118,16 @@ ion-modal.custom_modal_bottom {
color:green;
}
.SENDER{
- background-color: yellow;
+ background-color: #eaf3f6;
margin-left: 50px;
}
.RECIPIENT{
+ background-color: #e3f8f8;
margin-right: 50px;
}
.work_area{
- background-color: lightblue;
+ background-color: #e9f3f6;
padding: 10px;
border-radius: 5px;
}