diff --git a/src/app/components/familiy-dash/familiy-dash.component.html b/src/app/components/familiy-dash/familiy-dash.component.html index ed5a21b..4250b3d 100644 --- a/src/app/components/familiy-dash/familiy-dash.component.html +++ b/src/app/components/familiy-dash/familiy-dash.component.html @@ -1,36 +1,47 @@ -
- - - - - - +
+ + + + + +
+
-
+
-
+
- {{item.short_title}} - {{item.short_description}} + {{ item.short_title }} + {{ + item.short_description + }}
diff --git a/src/app/components/familiy-dash/familiy-dash.component.ts b/src/app/components/familiy-dash/familiy-dash.component.ts index d1fe834..1068994 100644 --- a/src/app/components/familiy-dash/familiy-dash.component.ts +++ b/src/app/components/familiy-dash/familiy-dash.component.ts @@ -1,118 +1,127 @@ -import {Component, Input, OnInit} from '@angular/core'; -import {NavController} from "@ionic/angular"; -import {Router} from "@angular/router"; -import {SessionDataProviderService} from "../../store/session-data-provider.service"; -import {WrenchService} from "../../services/wrench.service"; -import {BannersDataService} from "../../store/banners-data.service"; +import { Component, Input, OnInit } from "@angular/core"; +import { NavController } from "@ionic/angular"; +import { Router } from "@angular/router"; +import { SessionDataProviderService } from "../../store/session-data-provider.service"; +import { WrenchService } from "../../services/wrench.service"; +import { BannersDataService } from "../../store/banners-data.service"; @Component({ - selector: 'app-familiy-dash', - templateUrl: './familiy-dash.component.html', - styleUrls: ['./familiy-dash.component.scss'], + selector: "app-familiy-dash", + templateUrl: "./familiy-dash.component.html", + styleUrls: ["./familiy-dash.component.scss"], }) export class FamiliyDashComponent implements OnInit { - @Input('bannerData') bannerData:any; - homebannerCount:number=0; - family_action:string=""; - family_dash_show:number =10; + @Input("bannerData") bannerData: any; + homebannerCount: number = 0; + family_action: string = ""; + family_dash_show: number = 10; - pageItem:{ - page_name: number, - family_action: string - } - constructor(private navctr: NavController, - private router: Router, - public bannersDataService:BannersDataService, - public sessionDataProviderService: SessionDataProviderService, - private wrenchService: WrenchService) { - - addEventListener('app_fastreward_action', () => { - this.router.navigate(['family'],{state: {page_name: 0, family_action: 'FAMILY_ACTION_SEND_REWARD'}}); + pageItem: { + page_name: number; + family_action: string; + }; + constructor( + private navctr: NavController, + private router: Router, + public bannersDataService: BannersDataService, + public sessionDataProviderService: SessionDataProviderService, + private wrenchService: WrenchService + ) { + addEventListener("app_fastreward_action", () => { + this.router.navigate(["family"], { + state: { page_name: 0, family_action: "FAMILY_ACTION_SEND_REWARD" }, + }); }); - addEventListener('app_familiy_nokids_action', () => { - this.router.navigate(['addfamilykid'],{state: {page_name: 0, family_action: 'FAMILY_ACTION_NO_KIDS'}}); + addEventListener("app_familiy_nokids_action", () => { + this.router.navigate(["addfamilykid"], { + state: { page_name: 0, family_action: "FAMILY_ACTION_NO_KIDS" }, + }); }); - addEventListener('app_familiy_notask_action', () => { - this.router.navigate(['family'],{state: {page_name: 0, family_action: 'FAMILY_ACTION_NO_TASKS'}}); + addEventListener("app_familiy_notask_action", () => { + this.router.navigate(["family"], { + state: { page_name: 0, family_action: "FAMILY_ACTION_NO_TASKS" }, + }); }); - addEventListener('app_familiy_addfamily_action', () => { + addEventListener("app_familiy_addfamily_action", () => { this.pageItem.family_action = ""; - this.router.navigate(['family'],{state: {page_name: 0, family_action: ''}}); + this.router.navigate(["family"], { + state: { page_name: 0, family_action: "" }, + }); }); - addEventListener('app_familiy_allowance_action', () => { + addEventListener("app_familiy_allowance_action", () => { this.pageItem.family_action = ""; - this.router.navigate(['family'],{state: {page_name: 0, family_action: ''}}); + this.router.navigate(["family"], { + state: { page_name: 0, family_action: "" }, + }); }); -// - addEventListener('app_familiy_go_wallet', () => { - this.router.navigate(['tabs/tab4'],{state: {page_name: 0, family_action: ''}}); + // + addEventListener("app_familiy_go_wallet", () => { + this.router.navigate(["tabs/tab4"], { + state: { page_name: 0, family_action: "" }, + }); }); this.bannerData = this.bannersDataService.bannerData; this.homebannerCount = this.bannersDataService.homebannerCount; // let us keep refreshing - internal so serve call - var interval = setInterval( ()=> { - this.bannerData = this.bannersDataService.bannerData; - this.homebannerCount = this.bannersDataService.homebannerCount; - console.log("IM THE FAM HOME DASH ****** "); - }, 5000); + var interval = setInterval(() => { + this.bannerData = this.bannersDataService.bannerData; + this.homebannerCount = this.bannersDataService.homebannerCount; + console.log("IM THE FAM HOME DASH ****** "); + }, 5000); - this.family_action = this.sessionDataProviderService.family_action; + this.family_action = this.sessionDataProviderService.family_action; } onDetails(item) { // var pageToNavigate = 'detail'; - var pageToNavigate = ''; + var pageToNavigate = ""; // alert(item.link_path); - switch (item.link_path){ - case 'referral': - pageToNavigate = 'invite'; + switch (item.link_path) { + case "referral": + pageToNavigate = "invite"; break; - case 'mytask': // offers waiting to start + case "mytask": // offers waiting to start case "my-active-jobs": - pageToNavigate = 'joboffers'; + pageToNavigate = "joboffers"; break; - case 'my-coupon': - pageToNavigate = 'mycoupons'; + case "my-coupon": + pageToNavigate = "mycoupons"; break; - case 'blog-page': + case "blog-page": // this.blogDetails(this.getOneBlog(item)); - // this.getOneBlog(item); + // this.getOneBlog(item); break; - case 'my-review-jobs': - pageToNavigate = 'jobmanager'; - break - - case 'my-pastdue-jobs': - pageToNavigate = 'jobmanager'; - break - - case 'pend-interest': - pageToNavigate ='pendinterest'; + case "my-review-jobs": + pageToNavigate = "jobmanager"; break; - - - case 'offer-interest': - pageToNavigate = 'jobinterest'; - break - - case 'acc-family': - pageToNavigate = 'family'; + case "my-pastdue-jobs": + pageToNavigate = "jobmanager"; break; + case "pend-interest": + pageToNavigate = "pendinterest"; + break; + + case "offer-interest": + pageToNavigate = "jobinterest"; + break; + + case "acc-family": + pageToNavigate = "family"; + break; } - if(pageToNavigate !=''){ - this.router.navigate([pageToNavigate],{state: item}); + if (pageToNavigate != "") { + this.router.navigate([pageToNavigate], { state: item }); } } ngOnInit() {} - } diff --git a/src/app/components/family-connect/family-connect.component.html b/src/app/components/family-connect/family-connect.component.html index 5d5a71c..f8a0341 100644 --- a/src/app/components/family-connect/family-connect.component.html +++ b/src/app/components/family-connect/family-connect.component.html @@ -13,20 +13,53 @@

- - - Family Connect - - +
+ + + Family Connect + - - Share, play games, or create challenges with rewards - - Start Connect - - - + + Share, play games, or create challenges with rewards + + Start Connect + + + +
+
+
+
+
+ + +
+
+ +
+ +
+ {{ item.firstname }} {{ item.lastname }} + + +
+
+ +
+ +
\ No newline at end of file diff --git a/src/app/components/family-connect/family-connect.component.ts b/src/app/components/family-connect/family-connect.component.ts index 457e0fe..1cc7136 100644 --- a/src/app/components/family-connect/family-connect.component.ts +++ b/src/app/components/family-connect/family-connect.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import {WrenchService} from "../../services/wrench.service"; +import {SessionDataProviderService} from "../../store/session-data-provider.service"; @Component({ selector: 'app-family-connect', @@ -9,8 +11,48 @@ export class FamilyConnectComponent implements OnInit { show_invite:boolean = false; show_connect: boolean = false; - constructor() { } +connectStart : number = 0; - ngOnInit() {} + constructor( + public sessionDataProviderService: SessionDataProviderService, + private wrenchService: WrenchService + ) { + this.show_connect= true; + this.show_invite = true; + } + ngOnInit() { + this.getFamilyList(); + } + + startfamilyConnect(){ + // alert("start connect"); + this.connectStart = 100; + } + + reqData: { + action:number, + member_id: number, + family_uid: string, + sessionid: string + }; + familyResult:any; + familyData:[]; + getFamilyList(){ + + this.reqData ={ + action: 0, + member_id: this.sessionDataProviderService.member_id, + family_uid: this.sessionDataProviderService.family_uid, + sessionid: this.sessionDataProviderService.session + }; + this.wrenchService.connectMembers(this.reqData).subscribe( + familyResult => { + this.familyResult = familyResult; + console.log("familyResult RETURN->", this.familyResult); + this.familyData = this.familyResult.result_list; + + } + ); + } } diff --git a/src/app/pages/familylogin/familylogin.page.ts b/src/app/pages/familylogin/familylogin.page.ts index 09ca14a..c122f57 100644 --- a/src/app/pages/familylogin/familylogin.page.ts +++ b/src/app/pages/familylogin/familylogin.page.ts @@ -45,10 +45,9 @@ export class FamilyloginPage implements OnInit { public familyDataService:FamilyDataService, private loadingCtrl: LoadingController, public socketToolsService:SocketToolsService + ) { - ) { - - } + } ngOnInit() { const checkName = async () => { @@ -57,11 +56,15 @@ export class FamilyloginPage implements OnInit { }; } + childJoinRoom:string = ''; async joinLoginSockets(){ + this.childJoinRoom = "FAMILY-" + this.sessionDataProviderService.parent_uid; + // debugger; this.socketToolsService.stop(); setTimeout(()=>{ this.socketToolsService.setupSocket("NO-NEED-SEND"); this.socketToolsService.joinSocketRoom("full-markets-jobs" ); + this.socketToolsService.joinSocketRoom(this.childJoinRoom) }, 5000); } diff --git a/src/app/services/wrench.service.ts b/src/app/services/wrench.service.ts index 23bb627..2ee04a5 100644 --- a/src/app/services/wrench.service.ts +++ b/src/app/services/wrench.service.ts @@ -179,6 +179,10 @@ export class WrenchService { return this.getPostData("assigntask", reqData); } + connectMembers(reqData){ + return this.getPostData("connectmembers", reqData); + } + interestStats(reqData){ return this.getPostData("intereststats", reqData); } diff --git a/src/app/store/session-data-provider.service.ts b/src/app/store/session-data-provider.service.ts index ee4ce1b..9db122d 100644 --- a/src/app/store/session-data-provider.service.ts +++ b/src/app/store/session-data-provider.service.ts @@ -53,7 +53,7 @@ export class SessionDataProviderService { "internal_return": 100 */ max_card:number=4; - + parent_uid:string = ''; refresh:number=30000; account_country:string="NG"; account_type:string=""; @@ -217,6 +217,8 @@ export class SessionDataProviderService { this.account_pref = loginResult.account_pref; this.refer_link = loginResult.refer_link; + this.parent_uid = loginResult.parent_uid != undefined ? loginResult.parent_uid: ''; + } catch (error) { console.log("LOGIN STORAGE ERROR->" + error);