aded job
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
|
||||
<!--REQ_LONG(in, "member_id", 1, -1);-->
|
||||
<!--REQ_LONG(in, "price", 1, -1);-->
|
||||
<!--REQ_LONG(in, "timeline_days", 1, -1);-->
|
||||
<!--REQ_STRING(in, "title", 5, 149, "(.*)");-->
|
||||
<!--REQ_STRING(in, "country", 2, 3, "(.*)");-->
|
||||
<!--REQ_STRING(in, "description", 5, 299, "(.*)");-->
|
||||
<!--REQ_STRING (in, "job_detail", 4, 1440, "(.*)");-->
|
||||
|
||||
<div>
|
||||
<ion-list>
|
||||
@@ -6,14 +12,14 @@
|
||||
<ion-textarea label="Title"
|
||||
(ionChange)="verifyEntry()"
|
||||
[(ngModel)]='title'
|
||||
maxlength="20"
|
||||
maxlength="149"
|
||||
placeholder="Enter Title"></ion-textarea>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-textarea label="Description"
|
||||
(ionChange)="verifyEntry()"
|
||||
[(ngModel)]='description'
|
||||
maxlength="20"
|
||||
maxlength="299"
|
||||
labelPlacement="stacked"
|
||||
placeholder="Job Description"></ion-textarea>
|
||||
</ion-item>
|
||||
@@ -22,7 +28,7 @@
|
||||
(ionChange)="verifyEntry()"
|
||||
[(ngModel)]='job_detail'
|
||||
style="min-height: 150px;"
|
||||
maxlength="20"
|
||||
maxlength="1440"
|
||||
labelPlacement="floating"
|
||||
placeholder="Delivery Details"></ion-textarea>
|
||||
</ion-item>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {UserWalletService} from "../../store/user-wallet.service";
|
||||
import {LoadingController} from "@ionic/angular";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
@Component({
|
||||
selector: 'app-add-jobs',
|
||||
templateUrl: './add-jobs.component.html',
|
||||
@@ -16,12 +18,15 @@ export class AddJobsComponent implements OnInit {
|
||||
@ViewChild('price') price:any;
|
||||
@ViewChild('country') country:any;
|
||||
durationArray:any;
|
||||
curr_session:string='';
|
||||
|
||||
isDisabled:boolean=true;
|
||||
|
||||
constructor(
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
public userWalletService: UserWalletService
|
||||
public userWalletService: UserWalletService,
|
||||
private loadingCtrl: LoadingController,
|
||||
private wrenchService: WrenchService
|
||||
) {
|
||||
this.durationArray = this.sessionDataProviderService.durationArray;
|
||||
this.walletResult = this.userWalletService.walletResult.result_list;
|
||||
@@ -43,7 +48,62 @@ export class AddJobsComponent implements OnInit {
|
||||
this.price > 0 &&
|
||||
this.country.length > 1);
|
||||
}
|
||||
processCreateJob(){
|
||||
async processCreateJob(){
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Creating Job...',
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.reqData = {
|
||||
action:13010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
country: this.country,
|
||||
price:this.price*100,
|
||||
timeline_days:this.timeline_days,
|
||||
banner:'default.jpg',
|
||||
title:this.title,
|
||||
description:this.description,
|
||||
job_detail:this.job_detail,
|
||||
category:''
|
||||
}
|
||||
|
||||
loading.present();
|
||||
this.wrenchService.jobManagerCreateJob(this.reqData).subscribe(
|
||||
jobManagerCreateResult => {
|
||||
loading.dismiss();
|
||||
this.jobManagerCreateResult = jobManagerCreateResult;
|
||||
console.log("jobManagerCreateResult RETURN->", this.jobManagerCreateResult);
|
||||
if (this.jobManagerCreateResult !=null && this.jobManagerCreateResult.job_uid != '' ){
|
||||
alert("Job Created");
|
||||
|
||||
setTimeout(()=>{
|
||||
dispatchEvent(new Event("app_add_jobs"));
|
||||
}, 3000);
|
||||
}
|
||||
else{
|
||||
alert("Unable to create job");
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
reqData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string, sessionid: string,
|
||||
country:string,
|
||||
price:number,
|
||||
timeline_days:number,
|
||||
banner:string,
|
||||
title:string,
|
||||
description:string,
|
||||
job_detail:string,
|
||||
category:string
|
||||
};
|
||||
jobManagerCreateResult:any;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,10 @@ export class JoblistPage implements OnInit {
|
||||
private wrenchService: WrenchService
|
||||
) {
|
||||
|
||||
|
||||
addEventListener('app_add_jobs', () => {
|
||||
this.getJobManagerList()
|
||||
this.setCloseModal();
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -69,6 +69,9 @@ export class WrenchService {
|
||||
return this.getPostData('jobmanagerlist', reqData);
|
||||
}
|
||||
|
||||
jobManagerCreateJob(reqData){
|
||||
return this.getPostData('jobmanagercreatejob', reqData);
|
||||
}
|
||||
verifyPassReset(reqData){
|
||||
return this.getPostData('stepresetpass', reqData);
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user