New file upload
This commit is contained in:
@@ -89,6 +89,7 @@ ionic generate service waiting-interest
|
||||
|
||||
ionic generate service socket-tools
|
||||
|
||||
ionic generate service media-connect
|
||||
|
||||
ionic generate component tracking
|
||||
ionic generate component myjob-offers
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "WrenchBoard",
|
||||
"version": "46.2.4",
|
||||
"version": "46.2.5",
|
||||
"author": "WrenchBaoard LLC",
|
||||
"homepage": "https://www.wrenchboard.com/",
|
||||
"scripts": {
|
||||
@@ -35,9 +35,11 @@
|
||||
"@capacitor/keyboard": "^5.0.0",
|
||||
"@capacitor/preferences": "^5.0.6",
|
||||
"@capacitor/status-bar": "^5.0.0",
|
||||
"@capawesome/capacitor-file-picker": "^5.3.0",
|
||||
"@codetrix-studio/capacitor-google-auth": "^3.3.2",
|
||||
"@ionic/angular": "^6.1.9",
|
||||
"angularx-qrcode": "^14.0.0",
|
||||
"axios": "^1.5.1",
|
||||
"bn-ng-idle": "^2.0.5",
|
||||
"flutterwave-angular-v3": "^1.2.1",
|
||||
"jwt-decode": "^3.1.2",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MediaConnectService } from './media-connect.service';
|
||||
|
||||
describe('MediaConnectService', () => {
|
||||
let service: MediaConnectService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(MediaConnectService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {HttpClient, HttpHeaders} from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { SessionDataProviderService } from '../store/session-data-provider.service';
|
||||
import {Router} from "@angular/router";
|
||||
import axios from "axios";
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MediaConnectService {
|
||||
|
||||
apiKey = '99dfe35fcb7de1ee';
|
||||
url;
|
||||
|
||||
constructor(private http: HttpClient,
|
||||
private router: Router,
|
||||
public sessionDataProviderService :SessionDataProviderService) {
|
||||
// this is test
|
||||
this.url = 'https://dev-media.wrenchboard.com';
|
||||
}
|
||||
|
||||
sendPostData(reqPath:string, reqData): Observable<any> {
|
||||
let headers = new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
/* 'Authorization': this.basic */});
|
||||
let options = { headers: headers };
|
||||
|
||||
headers.append('Content-Type','multipart/form-data');
|
||||
|
||||
const apiReturn = this.http.post(
|
||||
`${environment.baseMediaUrl}/${reqPath}`,reqData, { headers: headers}
|
||||
);
|
||||
|
||||
// const apiReturn = this.http.post(
|
||||
// `${environment.baseMediaUrl}/${reqPath}`,reqData
|
||||
// );
|
||||
|
||||
console.log(reqData);
|
||||
|
||||
axios.post('https://dev-media.wrenchboard.com/upload/contract',reqData )
|
||||
.then( res => {})
|
||||
.catch(er => console.log(er))
|
||||
|
||||
return apiReturn;
|
||||
}
|
||||
uploadtaskFile(formData){
|
||||
// debugger;
|
||||
console.log("formData == > ", formData);
|
||||
const pathUpload = "upload/contract";
|
||||
return this.sendPostData(pathUpload, formData);
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -384,133 +384,4 @@ export class WrenchService {
|
||||
uploadFile(uploadData){
|
||||
return this.getPostData("/uploads", uploadData);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
|
||||
registerUser(newUserData) {
|
||||
// no session needed - will start the session
|
||||
return this.http.post(this.url + '/createmobileuser', newUserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
completeRegisterUser(newUserData) {
|
||||
// no session needed - will start the session
|
||||
return this.http.post(this.url + '/completemobileuser', newUserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
startResetPassword(UserData) {
|
||||
// no session needed - will start the session
|
||||
return this.http.post(this.url + '/startresetpasword', UserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getStartData() {
|
||||
return this.http.post(this.url + '/startjoblist', { limit: '10', page: '1' })
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getJobsData() {
|
||||
return this.http.post(this.url + '/getjobsdata', { limit: '20', page: '1' })
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getPendingJobsData(userData: any) {
|
||||
return this.http.post(this.url + '/getpendingjobs', userData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getMessages(UserData) {
|
||||
console.log("getMessages Called");
|
||||
return this.http.post(this.url + '/message', UserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
//JOBS
|
||||
getActiveJobData(UserData) {
|
||||
console.log("getActiveJobData Called");
|
||||
return this.http.post(this.url + '/activejoblist', UserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getMyOffersJobData(UserData) {
|
||||
console.log("getMyOffersJobData Called");
|
||||
return this.http.post(this.url + '/offerslist', UserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
//=========================================
|
||||
getPaymentHx(UserData) {
|
||||
console.log("getPaymentHx Called");
|
||||
return this.http.post(this.url + '/paymenthx', UserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getOffersJobDataff() {
|
||||
console.log("getOffersJobData Called");
|
||||
return this.http.post(this.url + '/offerslist', { limit: '10', page: '1', sessionid: 'ADNGHGHGHGHGHGH', member_id: 1 })
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getDashData(memberID, sessionID) {
|
||||
// session required here
|
||||
return this.http.post(this.url + '/dashdata', { sessionid: sessionID, member_id: memberID })
|
||||
.map(res => res.json());
|
||||
}
|
||||
getUserAccount(memberID, sessionID) {
|
||||
// account
|
||||
return this.http.post(this.url + '/account', { sessionid: sessionID, member_id: memberID })
|
||||
.map(res => res.json());
|
||||
}
|
||||
getProfile(memberID, sessionID) {
|
||||
//loadprofile
|
||||
return this.http.post(this.url + '/loadprofile', { sessionid: sessionID, member_id: memberID })
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getUserBankList(UserData) {
|
||||
console.log("getActiveJobData Called");
|
||||
return this.http.post(this.url + '/mybanklist', UserData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
userSendMoneyt(SendMoneydata) {
|
||||
console.log("userSendMoneyt Called");
|
||||
return this.http.post(this.url + '/sendmoney', SendMoneydata)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
sendMoneyFee(SendMoneydata) {
|
||||
console.log("sendMoneyFee Called");
|
||||
return this.http.post(this.url + '/sendmoneyfee', SendMoneydata)
|
||||
.map(res => res.json());
|
||||
}
|
||||
sendJobInterest(SendJobInterestData) {
|
||||
console.log("sendJobInterest Called");
|
||||
return this.http.post(this.url + '/sendinterest', SendJobInterestData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
sendOfferInterest(SendJobInterestData) {
|
||||
console.log("sendOfferInterest Called");
|
||||
return this.http.post(this.url + '/sendofferinterest', SendJobInterestData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
sendJobInterestMessage(sendJobInterestMessage) {
|
||||
console.log("sendJobInterestMessage Called");
|
||||
return this.http.post(this.url + '/sendinterestmessage', sendJobInterestMessage)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
getTaskMessage(taskData: any) {
|
||||
console.log("getTaskMessage Called");
|
||||
return this.http.post(this.url + '/taskmessage', taskData)
|
||||
.map(res => res.json());
|
||||
}
|
||||
|
||||
sendTaskMessage(taskMessage: any) {
|
||||
console.log("sendTaskMessage Called");
|
||||
return this.http.post(this.url + '/sendtaskmessage', taskMessage)
|
||||
.map(res => res.json());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user