suggest
This commit is contained in:
@@ -12,6 +12,7 @@ import {TasksDataService} from "../../store/tasks-data.service";
|
||||
import {BannersDataService} from "../../store/banners-data.service";
|
||||
import {UserWalletService} from "../../store/user-wallet.service";
|
||||
import {IntervalRefreshService} from "../../store/interval-refresh.service";
|
||||
import {FamilyDataService} from "../../store/family-data.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-familylogin',
|
||||
@@ -39,7 +40,8 @@ export class FamilyloginPage implements OnInit {
|
||||
public tasksDataService:TasksDataService,
|
||||
public bannersDataService:BannersDataService,
|
||||
public userWalletService: UserWalletService,
|
||||
public intervalRefreshService: IntervalRefreshService
|
||||
public intervalRefreshService: IntervalRefreshService,
|
||||
public familyDataService:FamilyDataService
|
||||
) {
|
||||
|
||||
}
|
||||
@@ -100,6 +102,7 @@ this.startUpCalls();
|
||||
this.tasksDataService.getJobsData();
|
||||
this.userWalletService.getWalletData();
|
||||
this.bannersDataService.getBannersData();
|
||||
this.familyDataService.familySuggestData();
|
||||
}
|
||||
|
||||
async showAlert(mtitle: string, amessage: string) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import { LocTrcService } from "../../services/loc-trc.service";
|
||||
import {MarketDataService} from "../../store/market-data.service";
|
||||
import {BannersDataService} from "../../store/banners-data.service";
|
||||
import {HelpDataService} from "../../store/help-data.service";
|
||||
import {FamilyDataService} from "../../store/family-data.service";
|
||||
|
||||
//import * as stream from "stream";
|
||||
|
||||
@@ -40,7 +41,8 @@ export class HomePage implements OnInit {
|
||||
private locTrcService:LocTrcService,
|
||||
public marketDataService:MarketDataService,
|
||||
public bannersDataService:BannersDataService,
|
||||
public helpDataService:HelpDataService
|
||||
public helpDataService:HelpDataService,
|
||||
public familyDataService:FamilyDataService
|
||||
) {
|
||||
this.accountType = sessionDataProviderService.account_type;
|
||||
this.firstname = this.sessionDataProviderService.firstname;
|
||||
@@ -164,21 +166,25 @@ export class HomePage implements OnInit {
|
||||
familySuggestResult:any;
|
||||
familySuggestData:any;
|
||||
getFamilySuggestList(){
|
||||
this.usrData = {
|
||||
action:13010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
'limit': 30,
|
||||
'offset': 0
|
||||
};
|
||||
this.wrenchService.familySuggestList(this.usrData).subscribe(
|
||||
familySuggestResult => {
|
||||
this.familySuggestResult = familySuggestResult;
|
||||
console.log("familySuggestResult RETURN->", this.familySuggestResult);
|
||||
this.familySuggestData = this.familySuggestResult.result_list;
|
||||
}
|
||||
);
|
||||
this.familySuggestData = this.familyDataService.familySuggestData;
|
||||
setTimeout(()=>{
|
||||
this.familySuggestData = this.familyDataService.familySuggestData; // just read no server reqyuest
|
||||
}, 5000);
|
||||
// this.usrData = {
|
||||
// action:13010,
|
||||
// member_id: this.sessionDataProviderService.member_id,
|
||||
// uid: this.sessionDataProviderService.member_uid,
|
||||
// sessionid: this.sessionDataProviderService.session,
|
||||
// 'limit': 30,
|
||||
// 'offset': 0
|
||||
// };
|
||||
// this.wrenchService.familySuggestList(this.usrData).subscribe(
|
||||
// familySuggestResult => {
|
||||
// this.familySuggestResult = familySuggestResult;
|
||||
// console.log("familySuggestResult RETURN->", this.familySuggestResult);
|
||||
// this.familySuggestData = this.familySuggestResult.result_list;
|
||||
// }
|
||||
// );
|
||||
}
|
||||
onDetails(item) {
|
||||
// var pageToNavigate = 'detail';
|
||||
|
||||
@@ -1,9 +1,42 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {SessionDataProviderService} from "./session-data-provider.service";
|
||||
import {WrenchService} from "../services/wrench.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FamilyDataService {
|
||||
constructor(
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService
|
||||
) { }
|
||||
|
||||
constructor() { }
|
||||
usrData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
'limit': 30,
|
||||
'offset': 0
|
||||
};
|
||||
|
||||
familySuggestResult:any;
|
||||
familySuggestData:any;
|
||||
async getFamilySuggestList(){
|
||||
this.usrData = {
|
||||
action:13010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
'limit': 30,
|
||||
'offset': 0
|
||||
};
|
||||
this.wrenchService.familySuggestList(this.usrData).subscribe(
|
||||
familySuggestResult => {
|
||||
this.familySuggestResult = familySuggestResult;
|
||||
console.log("familySuggestResult RETURN->", this.familySuggestResult);
|
||||
this.familySuggestData = this.familySuggestResult.result_list;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import {MarketDataService} from "./market-data.service";
|
||||
import {TasksDataService} from "./tasks-data.service";
|
||||
import {BannersDataService} from "./banners-data.service";
|
||||
import {UsersoffersDataService} from "./usersoffers-data.service";
|
||||
import {FamilyDataService} from "./family-data.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -14,7 +15,9 @@ export class IntervalRefreshService {
|
||||
public marketDataService:MarketDataService,
|
||||
public tasksDataService:TasksDataService,
|
||||
public bannersDataService:BannersDataService,
|
||||
public usersoffersDataService:UsersoffersDataService) {
|
||||
public usersoffersDataService:UsersoffersDataService,
|
||||
public familyDataService: FamilyDataService
|
||||
) {
|
||||
this.marketDataService.getJobsData();
|
||||
}
|
||||
|
||||
@@ -31,6 +34,11 @@ export class IntervalRefreshService {
|
||||
this.tasksDataService.getJobsData();
|
||||
this.usersoffersDataService.getMyOffersData();
|
||||
|
||||
if ( this.sessionDataProviderService.account_type=='FAMILY'){
|
||||
this.familyDataService.familySuggestData();
|
||||
}
|
||||
|
||||
|
||||
}, this.sessionDataProviderService.refresh*2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user