offers
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ ionic generate page ownersjob
|
||||
ionic generate component latest-market
|
||||
ionic generate service tasks-data
|
||||
ionic generate service banners-data
|
||||
|
||||
ionic generate service usersoffers-data
|
||||
***ionic generate service pendingjob-data
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</ion-segment>
|
||||
|
||||
<div *ngIf="tabs =='tasks'" class="lesson">
|
||||
<div *ngIf="active_job_count == 0">
|
||||
<div *ngIf="active_job_count == 0 && active_offers_count == 0 ">
|
||||
<ion-card>
|
||||
<img alt="WrenchBoard Tasks" src="https://www.wrenchboard.com/assets/images/apps/current-tasks.png" />
|
||||
<ion-card-header>
|
||||
@@ -40,6 +40,20 @@
|
||||
</ion-card>
|
||||
</div>
|
||||
|
||||
<div *ngIf="active_job_count == 0 && active_offers_count > 0; ">
|
||||
<ion-card style="margin:0px; background-color: #141d71; color: white; border-radius: 15px;">
|
||||
<img alt="WrenchBoard Tasks" src="https://www.wrenchboard.com/assets/images/apps/current-tasks.png" />
|
||||
<ion-card-header>
|
||||
<ion-card-title style="color: white; font-weight: bolder'">Ready to Start</ion-card-title>
|
||||
</ion-card-header>
|
||||
|
||||
<ion-card-content>
|
||||
You have one or more task offers waiting for you to start.
|
||||
</ion-card-content>
|
||||
|
||||
</ion-card>
|
||||
<ion-button (click)="startOfferPage()" style="margin-top: 5px;" expand="block" shape="round" color="secondary">Start Now</ion-button>
|
||||
</div>
|
||||
|
||||
<div class="chat" *ngFor="let item of jobsData;" (click)="activeSeleted(item)">
|
||||
<div class="flex">
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { WrenchService } from 'src/app/services/wrench.service';
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {TasksDataService} from "../../store/tasks-data.service";
|
||||
import {UsersoffersDataService} from "../../store/usersoffers-data.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-mytasks',
|
||||
@@ -14,6 +15,7 @@ export class MytasksPage implements OnInit {
|
||||
|
||||
tabs: any = 'tasks';
|
||||
|
||||
active_offers_count:number =0;
|
||||
active_job_count:number =0;
|
||||
pastdue_job_count:number =0;
|
||||
review_job_count:number =0;
|
||||
@@ -24,24 +26,20 @@ export class MytasksPage implements OnInit {
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
public tasksDataService:TasksDataService
|
||||
public tasksDataService:TasksDataService,
|
||||
public usersoffersDataService:UsersoffersDataService
|
||||
) { }
|
||||
|
||||
myOffersData :[];
|
||||
ngOnInit() {
|
||||
// debugger;
|
||||
this.refreshJobsData();
|
||||
this.getJobsData();
|
||||
// this.getPastDueJobsData();
|
||||
// this.getInReviewJobsData();
|
||||
}
|
||||
|
||||
// onCall() {
|
||||
// this.router.navigate(['call']);
|
||||
// }
|
||||
//
|
||||
// onMessage() {
|
||||
// this.router.navigate(['message']);
|
||||
// }
|
||||
startOfferPage(){
|
||||
this.router.navigate(['joboffers']);
|
||||
}
|
||||
activeSeleted(item) {
|
||||
this.router.navigate(['activetask'],{state: item});
|
||||
}
|
||||
@@ -76,6 +74,12 @@ export class MytasksPage implements OnInit {
|
||||
this.pastdue_job_count = this.tasksDataService.pastdue_job_count;
|
||||
this.review_job_count = this.tasksDataService.review_job_count;
|
||||
|
||||
|
||||
this.myOffersData = this.usersoffersDataService.myOffersData;
|
||||
|
||||
this.active_offers_count = this.usersoffersDataService.total_offers;
|
||||
|
||||
console.log("Any OFFERRRR-> :::: ",this.active_offers_count);
|
||||
}
|
||||
async getJobsData(){
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import {SessionDataProviderService} from "./session-data-provider.service";
|
||||
import {MarketDataService} from "./market-data.service";
|
||||
import {TasksDataService} from "./tasks-data.service";
|
||||
import {BannersDataService} from "./banners-data.service";
|
||||
import {UsersoffersDataService} from "./usersoffers-data.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -12,11 +13,12 @@ export class IntervalRefreshService {
|
||||
constructor( public sessionDataProviderService:SessionDataProviderService,
|
||||
public marketDataService:MarketDataService,
|
||||
public tasksDataService:TasksDataService,
|
||||
public bannersDataService:BannersDataService) {
|
||||
public bannersDataService:BannersDataService,
|
||||
public usersoffersDataService:UsersoffersDataService) {
|
||||
this.marketDataService.getJobsData();
|
||||
}
|
||||
|
||||
startIntervalCalls(){
|
||||
async startIntervalCalls(){
|
||||
console.log("Hello Start ",this.sessionDataProviderService.session,this.sessionDataProviderService.refresh );
|
||||
var interval = setInterval( ()=> {
|
||||
|
||||
@@ -28,6 +30,7 @@ export class IntervalRefreshService {
|
||||
this.marketDataService.getJobsData();
|
||||
this.tasksDataService.getJobsData();
|
||||
this.bannersDataService.getBannersData();
|
||||
this.usersoffersDataService.getMyOffersData();
|
||||
|
||||
}, this.sessionDataProviderService.refresh*2);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UsersoffersDataService } from './usersoffers-data.service';
|
||||
|
||||
describe('UsersoffersDataService', () => {
|
||||
let service: UsersoffersDataService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(UsersoffersDataService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {SessionDataProviderService} from "./session-data-provider.service";
|
||||
import {AlertController, LoadingController} from "@ionic/angular";
|
||||
import {WrenchService} from "../services/wrench.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class UsersoffersDataService {
|
||||
|
||||
constructor(public sessionDataProviderService: SessionDataProviderService,
|
||||
private alertController:AlertController,
|
||||
private wrenchService: WrenchService,
|
||||
private loadingCtrl: LoadingController) { }
|
||||
|
||||
session_image_server:string='';
|
||||
curr_session:string='';
|
||||
//
|
||||
usrData: {
|
||||
action:number, member_id: number, uid: string,
|
||||
sessionid: string,
|
||||
limit:20,
|
||||
page:1, offset:number
|
||||
};
|
||||
total_offers:number = 0;
|
||||
myOffersTotalData:any;
|
||||
myOffersData: [];
|
||||
async getMyOffersData(){
|
||||
this.usrData = {action:15010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
limit:20, page:1,offset: 0}
|
||||
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
this.wrenchService.getMyOffers(this.usrData).subscribe(
|
||||
myOffersTotalData => {
|
||||
this.myOffersTotalData = myOffersTotalData;
|
||||
this.session_image_server = this.myOffersTotalData.session_image_server;
|
||||
console.log("myOffersTotalData RETURN->", this.myOffersTotalData);
|
||||
this.myOffersData = this.myOffersTotalData.result_list;
|
||||
console.log("myOffersData RETURN DATA->", this.myOffersData);
|
||||
this.total_offers = this.myOffersData.length;
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user