data refresh
This commit is contained in:
@@ -6,6 +6,7 @@ import { WrenchService } from 'src/app/services/wrench.service';
|
||||
import { OnesignalService } from 'src/app/services/onesignal.service';//
|
||||
import { UserWalletService } from 'src/app/store/user-wallet.service';
|
||||
import { LocTrcService } from "../../services/loc-trc.service";
|
||||
import {MarketDataService} from "../../store/market-data.service";
|
||||
|
||||
//import * as stream from "stream";
|
||||
|
||||
@@ -34,7 +35,8 @@ export class HomePage implements OnInit {
|
||||
private onesignalService: OnesignalService,
|
||||
public blogDataService: BlogDataService,
|
||||
public userWalletService: UserWalletService,
|
||||
private locTrcService:LocTrcService
|
||||
private locTrcService:LocTrcService,
|
||||
public marketDataService:MarketDataService,
|
||||
) {
|
||||
this.accountType = sessionDataProviderService.account_type;
|
||||
this.firstname = this.sessionDataProviderService.firstname;
|
||||
@@ -73,7 +75,7 @@ export class HomePage implements OnInit {
|
||||
console.log('Home page did enter - > ionViewWillEnter');
|
||||
this.allInitFunctions();
|
||||
}
|
||||
walletPresentation(){
|
||||
async walletPresentation(){
|
||||
this.walletData = this.userWalletService.getWallet();
|
||||
if( this.walletData?.length > 0 ) {
|
||||
var num = new Number(this.walletData[0].amount*0.01);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { WrenchService } from 'src/app/services/wrench.service';
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
import { BlogDataService } from 'src/app/store/blog-data.service';
|
||||
import { environment} from "../../../environments/environment";
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
import {AlertController, LoadingController, Platform} from '@ionic/angular';
|
||||
import { Preferences } from '@capacitor/preferences';
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import jwt_decode from "jwt-decode";
|
||||
@@ -18,6 +18,9 @@ import {
|
||||
FacebookLoginResponse,
|
||||
} from '@capacitor-community/facebook-login';
|
||||
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";
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -53,8 +56,13 @@ export class LoginPage implements OnInit {
|
||||
public sessionDataProviderService:SessionDataProviderService,
|
||||
public blogDataService:BlogDataService,
|
||||
private alertController: AlertController,
|
||||
public platform: Platform
|
||||
) {
|
||||
public userWalletService: UserWalletService,
|
||||
public intervalRefreshService: IntervalRefreshService,
|
||||
public platform: Platform,
|
||||
private loadingCtrl: LoadingController,
|
||||
public marketDataService:MarketDataService,
|
||||
) {
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
// https://ionicframework.com/docs/angular/platform
|
||||
this.ios = platform.is('ios');
|
||||
this.android = platform.is('android');
|
||||
@@ -111,11 +119,17 @@ getBlogData(){
|
||||
loginData: {
|
||||
username: string, password: string, sessionid: string
|
||||
};
|
||||
startLogin() {
|
||||
async startLogin() {
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Starting ... ',
|
||||
duration: 1500,
|
||||
});
|
||||
|
||||
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false || this.password == null || this.password == '') {
|
||||
this.showAlert('Invalid Login', 'Enter username(email) and password to login');
|
||||
return;
|
||||
}
|
||||
loading.present();
|
||||
this.loginData = { username: this.username, password: this.password, sessionid: 'DUMMY-APP-SESSION' }
|
||||
this.wrenchService.loginUser(this.loginData).subscribe(
|
||||
loginResult => {
|
||||
@@ -131,8 +145,12 @@ getBlogData(){
|
||||
};
|
||||
|
||||
|
||||
this.getBlogData();
|
||||
this.router.navigate(['tabs/tab1']);
|
||||
// this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
// this.marketDataService.getJobsData();
|
||||
// this.getBlogData();
|
||||
// this.userWalletService.getWallet();
|
||||
this.startUpCalls();
|
||||
this.router.navigate(['tabs/tab1']);
|
||||
}
|
||||
else{
|
||||
//debugger;
|
||||
@@ -151,6 +169,12 @@ getBlogData(){
|
||||
);
|
||||
}
|
||||
|
||||
async startUpCalls(){
|
||||
this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
this.marketDataService.getJobsData();
|
||||
this.getBlogData();
|
||||
this.userWalletService.getWalletData();
|
||||
}
|
||||
onForgot() {
|
||||
this.router.navigate(['forgot']);
|
||||
}
|
||||
@@ -254,8 +278,12 @@ getBlogData(){
|
||||
value: this.username,
|
||||
});
|
||||
};
|
||||
|
||||
this.getBlogData();
|
||||
|
||||
// this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
// this.marketDataService.getJobsData();
|
||||
// this.getBlogData();
|
||||
// this.userWalletService.getWallet();
|
||||
this.startUpCalls();
|
||||
this.router.navigate(['tabs/tab1']);
|
||||
}
|
||||
else{
|
||||
@@ -324,8 +352,12 @@ getBlogData(){
|
||||
value: this.username,
|
||||
});
|
||||
};
|
||||
|
||||
this.getBlogData();
|
||||
|
||||
// this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
// this.marketDataService.getJobsData();
|
||||
// this.getBlogData();
|
||||
// this.userWalletService.getWallet();
|
||||
this.startUpCalls();
|
||||
this.router.navigate(['tabs/tab1']);
|
||||
}
|
||||
else{
|
||||
@@ -458,9 +490,12 @@ getBlogData(){
|
||||
value: this.username,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.getBlogData();
|
||||
|
||||
// this.intervalRefreshService.startIntervalCalls(); // anything with interval call
|
||||
// this.marketDataService.getJobsData();
|
||||
// this.getBlogData();
|
||||
// this.userWalletService.getWallet();
|
||||
this.startUpCalls();
|
||||
this.router.navigate(['tabs/tab1']);
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
<div class="video" *ngFor="let item of jobsData;" (click)="viewMarketItem( item )">
|
||||
<div class="left">
|
||||
<div class="bg_image men_image" [style.backgroundImage]="'url('+session_image_server+'/'+curr_session+'/job/'+item.job_uid+')'"></div>
|
||||
<div class="bg_image men_image" [style.backgroundImage]="'url('+session_image_server+''+curr_session+'/job/'+item.job_uid+')'"></div>
|
||||
|
||||
<div class="text">
|
||||
<div class="bold_text" [innerHTML]="item.title"></div>
|
||||
|
||||
@@ -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 {WaitingInterestService} from "../../store/waiting-interest.service";
|
||||
import {MarketDataService} from "../../store/market-data.service";
|
||||
@Component({
|
||||
selector: 'app-my-course',
|
||||
templateUrl: './my-course.page.html',
|
||||
@@ -18,9 +19,16 @@ export class MyCoursePage implements OnInit {
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
public marketDataService:MarketDataService,
|
||||
private waitingInterestService:WaitingInterestService
|
||||
) { }
|
||||
) {
|
||||
this.marketDataService.getJobsData();
|
||||
}
|
||||
|
||||
ionViewWillEnter(){
|
||||
console.log('Home page did enter - > ionViewWillEnter');
|
||||
this.session_image_server = this.marketDataService.session_image_server;
|
||||
}
|
||||
ngOnInit() {
|
||||
this.getJobsData();
|
||||
}
|
||||
@@ -35,7 +43,8 @@ export class MyCoursePage implements OnInit {
|
||||
|
||||
ionViewDidEnter(){
|
||||
console.log('Home page did enter - > ionViewDidEnter ');
|
||||
this.getJobsData();
|
||||
this.session_image_server = this.marketDataService.session_image_server;
|
||||
this.jobsData = this.marketDataService.jobsData;
|
||||
}
|
||||
|
||||
usrData: {
|
||||
@@ -44,22 +53,28 @@ export class MyCoursePage implements OnInit {
|
||||
|
||||
jobsTotalData:any;
|
||||
jobsData: [];
|
||||
getJobsData(){
|
||||
async getJobsData(){
|
||||
|
||||
this.curr_session = this.sessionDataProviderService.session;
|
||||
var interval = setInterval( ()=> {
|
||||
this.jobsData = this.marketDataService.jobsData;
|
||||
this.session_image_server = this.marketDataService.session_image_server;
|
||||
}, 5000);
|
||||
|
||||
this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , limit:20, page:1}
|
||||
this.wrenchService.getJobsData(this.usrData).subscribe(
|
||||
jobsTotalData => {
|
||||
this.jobsTotalData = jobsTotalData;
|
||||
console.log("PAH HX RETURN->", this.jobsTotalData);
|
||||
this.jobsData = this.jobsTotalData.result_list;
|
||||
this.session_image_server = this.jobsTotalData.session_image_server;
|
||||
|
||||
// debugger;
|
||||
console.log("JOBS RETURN DATA->", this.jobsData);
|
||||
// this.blogDataService.setBlogData(this.blogResult.blog_data);
|
||||
}
|
||||
);
|
||||
// this.usrData = {action:11200, member_id: this.sessionDataProviderService.member_id, uid: this.sessionDataProviderService.member_uid, sessionid: this.sessionDataProviderService.session , limit:20, page:1}
|
||||
// this.wrenchService.getJobsData(this.usrData).subscribe(
|
||||
// jobsTotalData => {
|
||||
// this.jobsTotalData = jobsTotalData;
|
||||
// console.log("PAH HX RETURN->", this.jobsTotalData);
|
||||
// this.jobsData = this.jobsTotalData.result_list;
|
||||
// this.session_image_server = this.jobsTotalData.session_image_server;
|
||||
//
|
||||
// // debugger;
|
||||
// console.log("JOBS RETURN DATA->", this.jobsData);
|
||||
// // this.blogDataService.setBlogData(this.blogResult.blog_data);
|
||||
// }
|
||||
// );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user