tesk data
This commit is contained in:
@@ -21,6 +21,7 @@ import { GoogleAuth, User } from '@codetrix-studio/capacitor-google-auth';
|
||||
import {UserWalletService} from "../../store/user-wallet.service";
|
||||
import {IntervalRefreshService} from "../../store/interval-refresh.service";
|
||||
import {MarketDataService} from "../../store/market-data.service";
|
||||
import {TasksDataService} from "../../store/tasks-data.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -61,6 +62,7 @@ export class LoginPage implements OnInit {
|
||||
public platform: Platform,
|
||||
private loadingCtrl: LoadingController,
|
||||
public marketDataService:MarketDataService,
|
||||
public tasksDataService:TasksDataService
|
||||
) {
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
// https://ionicframework.com/docs/angular/platform
|
||||
@@ -173,6 +175,7 @@ getBlogData(){
|
||||
this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
this.marketDataService.getJobsData();
|
||||
this.getBlogData();
|
||||
this.tasksDataService.getJobsData();
|
||||
this.userWalletService.getWalletData();
|
||||
}
|
||||
onForgot() {
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Router } from '@angular/router';
|
||||
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";
|
||||
|
||||
@Component({
|
||||
selector: 'app-mytasks',
|
||||
@@ -22,23 +23,25 @@ export class MytasksPage implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService
|
||||
private wrenchService: WrenchService,
|
||||
public tasksDataService:TasksDataService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
// debugger;
|
||||
this.refreshJobsData();
|
||||
this.getJobsData();
|
||||
// this.getPastDueJobsData();
|
||||
// this.getInReviewJobsData();
|
||||
}
|
||||
|
||||
onCall() {
|
||||
this.router.navigate(['call']);
|
||||
}
|
||||
|
||||
onMessage() {
|
||||
this.router.navigate(['message']);
|
||||
}
|
||||
// onCall() {
|
||||
// this.router.navigate(['call']);
|
||||
// }
|
||||
//
|
||||
// onMessage() {
|
||||
// this.router.navigate(['message']);
|
||||
// }
|
||||
activeSeleted(item) {
|
||||
this.router.navigate(['activetask'],{state: item});
|
||||
}
|
||||
@@ -54,42 +57,64 @@ export class MytasksPage implements OnInit {
|
||||
allstatus: number
|
||||
};
|
||||
|
||||
jobsTotalData:any;
|
||||
jobsData: [];
|
||||
getJobsData(){
|
||||
jobsTotalInReviewData:any;
|
||||
jobsInReviewData: [];
|
||||
|
||||
this.usrData = {
|
||||
action:11200,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
limit:20,
|
||||
page:0,
|
||||
offset:0,
|
||||
job_mode: 'ACTIVE',
|
||||
allstatus: 100
|
||||
};
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
this.wrenchService.getMyActiveJobsData(this.usrData).subscribe(
|
||||
jobsTotalData => {
|
||||
this.jobsTotalData = jobsTotalData;
|
||||
console.log("getMyActiveJobsData RETURN->", this.jobsTotalData);
|
||||
this.session_image_server = this.jobsTotalData.session_image_server;
|
||||
jobsTotalPastDueData:any;
|
||||
jobsPastDueData: [];
|
||||
|
||||
let AllResult = this.jobsTotalData.result_list;;
|
||||
this.jobsData = AllResult.filter((item) => item.status_description == 'ACTIVE')
|
||||
this.jobsPastDueData =AllResult.filter((item) => item.status_description == 'PASTDUE')
|
||||
this.jobsInReviewData =AllResult.filter((item) => item.status_description == 'REVIEW')
|
||||
this.active_job_count = this.jobsData.length;
|
||||
this.review_job_count = this.jobsInReviewData.length;
|
||||
this.pastdue_job_count = this.jobsPastDueData.length;
|
||||
// debugger;
|
||||
}
|
||||
);
|
||||
jobsTotalData:any;
|
||||
jobsData: [];
|
||||
|
||||
async refreshJobsData(){
|
||||
this.jobsData = this.tasksDataService.jobsData;
|
||||
this.jobsPastDueData = this.tasksDataService.jobsPastDueData;
|
||||
this.jobsInReviewData = this.tasksDataService.jobsInReviewData;
|
||||
this.session_image_server = this.tasksDataService.session_image_server;
|
||||
|
||||
this.active_job_count = this.tasksDataService.active_job_count;
|
||||
this.pastdue_job_count = this.tasksDataService.pastdue_job_count;
|
||||
this.review_job_count = this.tasksDataService.review_job_count;
|
||||
|
||||
}
|
||||
async getJobsData(){
|
||||
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
var interval = setInterval( ()=> {
|
||||
this.refreshJobsData();
|
||||
}, 5000);
|
||||
|
||||
// this.usrData = {
|
||||
// action:11200,
|
||||
// member_id: this.sessionDataProviderService.member_id,
|
||||
// uid: this.sessionDataProviderService.member_uid,
|
||||
// sessionid: this.sessionDataProviderService.session ,
|
||||
// limit:20,
|
||||
// page:0,
|
||||
// offset:0,
|
||||
// job_mode: 'ACTIVE',
|
||||
// allstatus: 100
|
||||
// };
|
||||
// this.curr_session = this.sessionDataProviderService.session;
|
||||
// this.wrenchService.getMyActiveJobsData(this.usrData).subscribe(
|
||||
// jobsTotalData => {
|
||||
// this.jobsTotalData = jobsTotalData;
|
||||
// console.log("getMyActiveJobsData RETURN->", this.jobsTotalData);
|
||||
// this.session_image_server = this.jobsTotalData.session_image_server;
|
||||
//
|
||||
// let AllResult = this.jobsTotalData.result_list;;
|
||||
// this.jobsData = AllResult.filter((item) => item.status_description == 'ACTIVE')
|
||||
// this.jobsPastDueData =AllResult.filter((item) => item.status_description == 'PASTDUE')
|
||||
// this.jobsInReviewData =AllResult.filter((item) => item.status_description == 'REVIEW')
|
||||
// this.active_job_count = this.jobsData.length;
|
||||
// this.review_job_count = this.jobsInReviewData.length;
|
||||
// this.pastdue_job_count = this.jobsPastDueData.length;
|
||||
// // debugger;
|
||||
// }
|
||||
// );
|
||||
}
|
||||
|
||||
jobsTotalPastDueData:any;
|
||||
jobsPastDueData: [];
|
||||
|
||||
// getPastDueJobsData(){
|
||||
//
|
||||
// this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid,
|
||||
@@ -107,8 +132,7 @@ export class MytasksPage implements OnInit {
|
||||
//
|
||||
// }
|
||||
|
||||
jobsTotalInReviewData:any;
|
||||
jobsInReviewData: [];
|
||||
|
||||
// getInReviewJobsData(){
|
||||
//
|
||||
// this.usrData = {action:11200,
|
||||
|
||||
Reference in New Issue
Block a user