family assign

This commit is contained in:
CHIEFSOFT\ameye
2023-12-02 19:27:39 -05:00
parent d11a5dc1d7
commit 4b19abdcb3
2 changed files with 56 additions and 23 deletions
@@ -42,16 +42,19 @@
<ion-col>
<div class="t_label">Reward</div>
<div class="t_item" style="display: flex;">
<ion-input style="background-color: #dff8df; border-radius: 10px 0px 0px 10px;"></ion-input>
<div style="max-width:2px; background-color: white; "></div>
<ion-input [(ngModel)]='price'
(ionChange)="testInputs()"
style="background-color: #dff8df;
border-radius: 10px 0px 0px 10px;"></ion-input>
<div style="max-width:2px;background-color: white; "></div>
<ion-select style="max-width: 100px;
background-color: #f5f8f5;
border-radius: 0px 10px 10px 0px;"
[(ngModel)]='country'
(ionChange)="testInputs()"
aria-label="Favorite Fruit" value="Naira">
<ion-select-option value="NG">NGN</ion-select-option>
<ion-select-option value="US">USD</ion-select-option>
<ion-select-option *ngFor="let item of walletData" value="{{item.country}}">{{item.code}}</ion-select-option>
<!-- <ion-select-option value="US">USD</ion-select-option>-->
</ion-select>
</div>
</ion-col>
@@ -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);
}
}