From 4b19abdcb3d1fac270e10ca165546db367f43c99 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 2 Dec 2023 19:27:39 -0500 Subject: [PATCH] family assign --- .../pending-suggested.component.html | 11 +-- .../pending-suggested.component.ts | 68 +++++++++++++------ 2 files changed, 56 insertions(+), 23 deletions(-) diff --git a/src/app/components/pending-suggested/pending-suggested.component.html b/src/app/components/pending-suggested/pending-suggested.component.html index d24b660..a4e9e4a 100644 --- a/src/app/components/pending-suggested/pending-suggested.component.html +++ b/src/app/components/pending-suggested/pending-suggested.component.html @@ -42,16 +42,19 @@
Reward
- -
+ +
- NGN - USD + {{item.code}} +
diff --git a/src/app/components/pending-suggested/pending-suggested.component.ts b/src/app/components/pending-suggested/pending-suggested.component.ts index 968adb5..a005477 100644 --- a/src/app/components/pending-suggested/pending-suggested.component.ts +++ b/src/app/components/pending-suggested/pending-suggested.component.ts @@ -4,6 +4,7 @@ import {Router} from "@angular/router"; import {SessionDataProviderService} from "../../store/session-data-provider.service"; import {WrenchService} from "../../services/wrench.service"; import {FamilysuggestPendingService} from "../../store/familysuggest-pending.service"; +import {UserWalletService} from "../../store/user-wallet.service"; @Component({ selector: 'app-pending-suggested', @@ -19,7 +20,8 @@ export class PendingSuggestedComponent implements OnInit { public sessionDataProviderService: SessionDataProviderService, private wrenchService: WrenchService, public familysuggestPendingService: FamilysuggestPendingService, - private loadingCtrl: LoadingController) { + private loadingCtrl: LoadingController, + public userWalletService:UserWalletService) { addEventListener('app-pending-suggested-closemodal', () => { this.setCloseModal(); @@ -30,6 +32,7 @@ export class PendingSuggestedComponent implements OnInit { ngOnInit() { //this.getFamilyPeningData(); this.familyPendingData = this.familysuggestPendingService.familyPendingData; + //this.userWalletService.getWalletData(); } suggestion_total:number=0; @@ -79,9 +82,10 @@ selectedItem:any; console.log("timelineOptions == ",this.timelineOptions); console.log("SUGGESTED ITEM - >", item); this.selectedItem = item; - + this.walletData = this.userWalletService.walletData; this.modalTile = item.firstname+ ' Suggested Task'; - + this.price =0; + this.timeline_days = 0; this.isModalOpen = true; this.isModalOpenBackdrop= true; } @@ -103,26 +107,31 @@ selectedItem:any; banner: string, title: string, timeline_days: number, - job_description: string, + description: string, job_detail:string, country: string, + price:number, assign_mode: number }; @ViewChild('timeline_days') timeline_days; -@ViewChild('title') title; -@ViewChild('job_description') job_description; +// @ViewChild('title') title; +// @ViewChild('job_description') job_description; @ViewChild('job_detail') job_detail; @ViewChild('country') country; +@ViewChild('price') price; + assigResult:any; assign_ind_result:string=''; assign_mak_result:string=''; + walletData : any; - async sendOfferToFamily(){ + async processTask(){ if ( this.timeline_days== undefined || this.timeline_days < 1){ alert("Select Duration"); return; } + this.reqData = { action:13025, member_id: this.sessionDataProviderService.member_id, @@ -130,17 +139,18 @@ selectedItem:any; sessionid: this.sessionDataProviderService.session, family_uid: this.selectedItem.family_uid, category:'', - banner: '', + banner: this.selectedItem.banner, title: this.selectedItem.title, timeline_days: this.timeline_days, - job_description: this.selectedItem.description, - job_detail: this.timeline_days, + description: this.selectedItem.description, + job_detail: this.job_detail, country: this.country, + price: this.price*100, assign_mode: 110055 }; -// console.log('XXX-> ', this.reqData ); - // debugger; - +// console.log('XXX-> ', this.reqData ); +// debugger; +// return; const loading = await this.loadingCtrl.create({ message: 'Sending...', duration: 5000, @@ -153,13 +163,16 @@ selectedItem:any; this.assigResult = assigResult; console.log("assigResult RETURN->", this.assigResult); if ( this.assigResult != undefined && this.assigResult.internal_return > 0){ - this.assign_mak_result = "Task sent to market"; - const event = new Event("app-myjob-offers-refresh"); + this.assign_mak_result = "Task Sent."; + // const event = new Event("app-myjob-offers-refresh"); // Dispatch the event. - dispatchEvent(event); + + //dispatchEvent(event); + this.familysuggestPendingService.getFamilyPeningData(); setTimeout(() => { this.assign_mak_result =''; - }, 3000); + this.setCloseModal(); + }, 5000); } else { @@ -170,9 +183,26 @@ selectedItem:any; } testInputs(){ + console.log("this.walletData=>",this.walletData); + this.isDisabled = true; + if ( + this.price != undefined && + this.timeline_days != undefined && + this.country != undefined && + this.job_detail !=undefined && + this.isNumeric(this.price) && + this.isNumeric(this.timeline_days) && + this.price> 0 + && this.country !='' + && this.job_detail !='' + && this.timeline_days != 0 + ){ + this.isDisabled = false; + } //isDisabled } - processTask(){ - + isNumeric(value) { + return /^-?\d+$/.test(value); } + }