New file upload
This commit is contained in:
@@ -11,8 +11,6 @@
|
||||
|
||||
<ion-content>
|
||||
<!-- <ion-icon slot="start" name="arrow-back" class="back" (click)="onBack()"></ion-icon>-->
|
||||
|
||||
|
||||
<div class="ion-padding">
|
||||
<div class="boxed_contents">
|
||||
<div class="flex">
|
||||
@@ -31,78 +29,9 @@
|
||||
<ion-icon name="return-down-forward-outline"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let item of messageResult;" lines="none">
|
||||
<ion-grid class="msg-grid">
|
||||
<ion-row><ion-col>{{item.msg_from}} -
|
||||
<span class="mdate"> {{item.msg_date}}</span>
|
||||
</ion-col> </ion-row>
|
||||
<ion-row><ion-col class="mmsg">{{item.msg}}</ion-col></ion-row>
|
||||
<ion-row>
|
||||
<ion-col style="text-align: right;">
|
||||
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<!-- <ion-row><ion-col>FF</ion-col> </ion-row>-->
|
||||
</ion-grid>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- <div class="row">-->
|
||||
<!-- <ion-label class="bg_text">3D Design</ion-label>-->
|
||||
<!-- <div class="rate">-->
|
||||
<!-- <ion-icon name="star-half-outline" color="warning"></ion-icon>-->
|
||||
<!-- <ion-label class="review">4.8 (4478 reviews)</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <ion-label class="color_text">$40</ion-label>-->
|
||||
|
||||
<!-- <div class="items">-->
|
||||
<!--<!– <div class="stud">–>-->
|
||||
<!--<!– <ion-icon slot="start" name="people" color="primary"></ion-icon>–>-->
|
||||
<!--<!– <ion-label>9876 Students</ion-label>–>-->
|
||||
<!--<!– </div>–>-->
|
||||
<!--<!– <div class="stud">–>-->
|
||||
<!--<!– <ion-icon slot="start" name="time" color="primary"></ion-icon>–>-->
|
||||
<!--<!– <ion-label>2.5 hours</ion-label>–>-->
|
||||
<!--<!– </div>–>-->
|
||||
<!--<!– <div class="stud">–>-->
|
||||
<!--<!– <ion-icon slot="start" name="document-text" color="primary"></ion-icon>–>-->
|
||||
<!--<!– <ion-label>Certificate</ion-label>–>-->
|
||||
<!--<!– </div>–>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="lesson">-->
|
||||
<!-- <div class="video" *ngFor="let item of jobManagerOffersData">-->
|
||||
<!-- <div class="left">-->
|
||||
<!-- <div class="bg_image men_image" [style.backgroundImage]="'url('+session_image_server+'/'+curr_session+'/job/'+item.job_uid+')'"></div>-->
|
||||
|
||||
<!-- <div class="text">-->
|
||||
<!-- <ion-label class="bold_text">{{item.title}}</ion-label>-->
|
||||
<!-- <ion-label class="grey_text">{{item.description}}</ion-label>-->
|
||||
<!-- <ion-label class="price_line">{{item.offer_code}} {{item.price*0.01}} {{item.currency}} </ion-label>-->
|
||||
<!-- <ion-label class="due_date">Expire: {{item.expire |date}}</ion-label>-->
|
||||
<!-- <ion-label class="grey_text">Send to : {{item.job_to}}</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="right">-->
|
||||
<!-- <ion-icon name="chevron-forward-outline" color="medium"></ion-icon>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
<!--<ion-footer>-->
|
||||
<!-- <ion-toolbar>-->
|
||||
<!-- <div class="button" (click)="onBack()">-->
|
||||
<!-- <ion-label class="text">Return</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </ion-toolbar>-->
|
||||
<!--</ion-footer>-->
|
||||
|
||||
@@ -100,10 +100,10 @@
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col style="text-align: left;">
|
||||
<ion-button fill="outline" size="small" color="secondary" (click)="startCamera(100)">
|
||||
<ion-button fill="outline" size="small" color="secondary" (click)="pickFiles(100)">
|
||||
<ion-icon slot="icon-only" name="camera-reverse-outline"></ion-icon>
|
||||
</ion-button>
|
||||
<ion-button fill="outline" size="small" style="margin-left: 10px;" (click)="startCamera(0)">
|
||||
<ion-button fill="outline" size="small" style="margin-left: 10px;" (click)="pickFiles(0)">
|
||||
<ion-icon slot="icon-only" name="folder-outline"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
@@ -124,19 +124,7 @@
|
||||
</div>
|
||||
|
||||
<app-taskactivities [jobData]="jobData"></app-taskactivities>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
<!--<ion-footer>-->
|
||||
<!-- <ion-toolbar>-->
|
||||
<!-- <div class="button" (click)="onBack()">-->
|
||||
<!-- <ion-label class="text">Return</ion-label>-->
|
||||
<!-- </div>-->
|
||||
<!-- </ion-toolbar>-->
|
||||
<!--</ion-footer>-->
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import {Router} from "@angular/router";
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {Camera, CameraResultType, CameraSource} from "@capacitor/camera";
|
||||
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
||||
import {MediaConnectService} from "../../services/media-connect.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-jobreview',
|
||||
@@ -23,7 +25,8 @@ export class JobreviewPage implements OnInit {
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private alertController:AlertController,
|
||||
private loadingCtrl: LoadingController
|
||||
private loadingCtrl: LoadingController,
|
||||
private mediaConnectService: MediaConnectService
|
||||
) {
|
||||
this.jobData = this.router.getCurrentNavigation().extras.state;
|
||||
this.item_banner = this.jobData.banner;
|
||||
@@ -208,6 +211,7 @@ export class JobreviewPage implements OnInit {
|
||||
|
||||
uploadResult:any;
|
||||
async startCamera(cameraMode){
|
||||
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 50,
|
||||
width : 600,
|
||||
@@ -216,8 +220,18 @@ export class JobreviewPage implements OnInit {
|
||||
resultType: CameraResultType.Base64,
|
||||
source: (cameraMode == 100 ) ? CameraSource.Camera : CameraSource.Prompt // Camera, Photos or Prompt!
|
||||
});
|
||||
// const image_test = await Camera.getPhoto({
|
||||
// quality: 50,
|
||||
// width : 600,
|
||||
// height : 300,
|
||||
// allowEditing: false,
|
||||
// resultType: CameraResultType.Uri,
|
||||
// source: (cameraMode == 100 ) ? CameraSource.Camera : CameraSource.Prompt // Camera, Photos or Prompt!
|
||||
// });
|
||||
|
||||
if (image) {
|
||||
debugger;
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Uploading updates',
|
||||
duration: 5000,
|
||||
@@ -253,4 +267,59 @@ export class JobreviewPage implements OnInit {
|
||||
// console.log( this.uploadData);
|
||||
}
|
||||
}
|
||||
|
||||
uploadFormData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
contract: string,
|
||||
sessionid: string,
|
||||
msg_type:'FILE',
|
||||
file: any
|
||||
};
|
||||
|
||||
async pickFiles (fileMode) {
|
||||
const result = await FilePicker.pickFiles({
|
||||
types: ['image/png','image/jpeg','video/mp4'],
|
||||
multiple: false,
|
||||
readData:true
|
||||
});
|
||||
|
||||
|
||||
if(result){
|
||||
console.log(result);
|
||||
// debugger;
|
||||
this.uploadFormData={
|
||||
action:14010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
contract: this.jobData.contract,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
msg_type:'FILE',
|
||||
file: result.files[0]
|
||||
};
|
||||
|
||||
//result.files[0]
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file', this.uploadFormData.file )
|
||||
formData.append('uid', this.sessionDataProviderService.member_uid)
|
||||
formData.append('sessionid', this.sessionDataProviderService.session)
|
||||
formData.append('member_id', this.sessionDataProviderService.member_id.toString())
|
||||
formData.append('action', '14010')
|
||||
formData.append('msg_type', 'FILE')
|
||||
formData.append('contract', this.jobData.contract)
|
||||
|
||||
this.mediaConnectService.uploadtaskFile(formData).subscribe(
|
||||
uploadResult => {
|
||||
this.uploadResult = uploadResult;
|
||||
console.log("this.mediaConnectService.uploadFile RETURN DATA->", formData);
|
||||
const event = new Event("app-taskactivities-refresh");
|
||||
// Dispatch the event.
|
||||
dispatchEvent(event);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user