family clean up
This commit is contained in:
@@ -19,9 +19,15 @@ ionic generate page jobreview
|
||||
ionic generate page jobpastdue
|
||||
ionic generate page jobactive
|
||||
|
||||
|
||||
ionic generate page jobactive
|
||||
|
||||
|
||||
ionic generate component taskactivities
|
||||
ionic generate component suggestedlist
|
||||
|
||||
ionic generate component familysuggested
|
||||
|
||||
|
||||
ionic generate page addjob
|
||||
ionic generate page familyaddtask
|
||||
|
||||
@@ -379,13 +379,21 @@
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<ion-toolbar *ngIf="credit_confirmation=='';">
|
||||
<ion-button
|
||||
[disabled]="isProcessDisabled"
|
||||
(click)="processPayment(processor)"
|
||||
>Complete</ion-button
|
||||
>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar *ngIf="credit_confirmation!='';">
|
||||
<ion-button
|
||||
fill="solid"
|
||||
color="danger"
|
||||
(click)="setCloseModal()"
|
||||
>Close</ion-button
|
||||
>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
</ng-template>
|
||||
</ion-modal>
|
||||
|
||||
@@ -282,6 +282,11 @@ const routes: Routes = [
|
||||
path: 'familyaddtask',
|
||||
loadChildren: () => import('./pages/familyaddtask/familyaddtask.module').then(m => m.FamilyaddtaskPageModule)
|
||||
},
|
||||
{
|
||||
path: 'familysuggested',
|
||||
loadChildren: () => import('./pages-family/familysuggested/familysuggested.module').then(m => m.FamilysuggestedPageModule)
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ export class FamiliyDashComponent implements OnInit {
|
||||
pageToNavigate = 'invite';
|
||||
break;
|
||||
case 'mytask': // offers waiting to start
|
||||
case "my-active-jobs":
|
||||
pageToNavigate = 'joboffers';
|
||||
break;
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
<div class="lesson">
|
||||
|
||||
<!-- <ion-card>-->
|
||||
<!-- <img alt="Silhouette of mountains" src="https://ionicframework.com/docs/img/demos/card-media.png" />-->
|
||||
<!-- <ion-card-header>-->
|
||||
<!-- <ion-card-title>Card Title</ion-card-title>-->
|
||||
<!-- <ion-card-subtitle>Card Subtitle</ion-card-subtitle>-->
|
||||
<!-- </ion-card-header>-->
|
||||
|
||||
<!-- <ion-card-content>-->
|
||||
<!-- Here's a small text description for the card content. Nothing more, nothing less.-->
|
||||
<!-- </ion-card-content>-->
|
||||
<!-- </ion-card>-->
|
||||
|
||||
<div style="margin-bottom: 20px;">
|
||||
<div class="video" *ngFor="let item of familyBannerData | keyvalue" (click)="famBannerPage(item)">
|
||||
<div class="left">
|
||||
<div class="bg_image men_image" [style.backgroundImage]="'url('+item.value.banner.image+''"></div>
|
||||
|
||||
<div class="text">
|
||||
<ion-label class="bold_text">{{item.value.banner.text}}</ion-label>
|
||||
<ion-label class="grey_text">{{item.value.banner.description}}</ion-label>
|
||||
<!-- <ion-label *ngIf="item.remind !='' " class="remind_text"> Last Remind : {{ item.remind | date }}</ion-label>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<ion-icon name="chevron-forward-outline"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { FamilyhomeComponent } from './familyhome.component';
|
||||
|
||||
describe('FamilyhomeComponent', () => {
|
||||
let component: FamilyhomeComponent;
|
||||
let fixture: ComponentFixture<FamilyhomeComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FamilyhomeComponent ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FamilyhomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,67 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
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-familyhome",
|
||||
templateUrl: "./familyhome.component.html",
|
||||
styleUrls: ["./familyhome.component.scss"],
|
||||
})
|
||||
export class FamilyhomeComponent implements OnInit {
|
||||
constructor(
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
public bannersDataService: BannersDataService,
|
||||
private wrenchService: WrenchService
|
||||
) {
|
||||
this.refreshBanners().then(r => {
|
||||
console.log("startd family banners ");
|
||||
});
|
||||
}
|
||||
|
||||
familyBannerCount: number = 0;
|
||||
familyBannerResult: any;
|
||||
familyBannerData: [];
|
||||
ngOnInit() {
|
||||
this.familyBannerData = this.bannersDataService.familyBannerData;
|
||||
this.familyBannerCount = this.bannersDataService.familyBannerCount;
|
||||
}
|
||||
async refreshBanners() {
|
||||
|
||||
setInterval(()=>{
|
||||
this.familyBannerData = this.bannersDataService.familyBannerData;
|
||||
this.familyBannerCount = this.bannersDataService.familyBannerCount;
|
||||
console.log("this.familyBannerData ::: ",this.familyBannerData);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
famBannerPage(item){
|
||||
console.log(item.value.banner.action);
|
||||
var pageToNavigate = '';
|
||||
// debugger;
|
||||
switch (item.value.banner.action){
|
||||
|
||||
case "mytask":
|
||||
pageToNavigate = 'joboffers';
|
||||
break;
|
||||
case "pastdue":
|
||||
pageToNavigate = 'joboffers';
|
||||
break;
|
||||
case "pending":
|
||||
pageToNavigate = 'joboffers';
|
||||
break;
|
||||
case "familymarket":
|
||||
pageToNavigate='suggest';
|
||||
break;
|
||||
case "suggested":
|
||||
pageToNavigate ='familysuggested';
|
||||
break;
|
||||
}
|
||||
|
||||
if(pageToNavigate !=''){
|
||||
this.router.navigate([pageToNavigate],{state: item.value.banner});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ export class JobownerDashComponent implements OnInit {
|
||||
pageToNavigate = 'invite';
|
||||
break;
|
||||
case 'mytask': // offers waiting to start
|
||||
case "my-active-jobs":
|
||||
pageToNavigate = 'joboffers';
|
||||
break;
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ export class WorkersDashComponent implements OnInit {
|
||||
pageToNavigate = 'invite';
|
||||
break;
|
||||
case 'mytask': // offers waiting to start
|
||||
case "my-active-jobs":
|
||||
pageToNavigate = 'joboffers';
|
||||
break;
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { FamilysuggestedPage } from './familysuggested.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: FamilysuggestedPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class FamilysuggestedPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { FamilysuggestedPageRoutingModule } from './familysuggested-routing.module';
|
||||
|
||||
import { FamilysuggestedPage } from './familysuggested.page';
|
||||
import { SuggestedlistComponent } from "../../components/suggestedlist/suggestedlist.component";
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
FamilysuggestedPageRoutingModule
|
||||
],
|
||||
declarations: [FamilysuggestedPage,SuggestedlistComponent]
|
||||
})
|
||||
export class FamilysuggestedPageModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start" (click)="onBack()">
|
||||
<ion-button>
|
||||
<ion-icon name="arrow-back-outline"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<!-- <ion-button>-->
|
||||
<!-- <ion-icon name="ellipsis-horizontal-circle-outline"></ion-icon>-->
|
||||
<!-- </ion-button>-->
|
||||
</ion-buttons>
|
||||
<ion-title>Suggested Tasks & Chores</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
|
||||
<ion-content class="ion-padding">
|
||||
<app-suggestedlist></app-suggestedlist>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { FamilysuggestedPage } from './familysuggested.page';
|
||||
|
||||
describe('FamilysuggestedPage', () => {
|
||||
let component: FamilysuggestedPage;
|
||||
let fixture: ComponentFixture<FamilysuggestedPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FamilysuggestedPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FamilysuggestedPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {LoadingController, NavController} from "@ionic/angular";
|
||||
import {Router} from "@angular/router";
|
||||
import { WrenchService } from 'src/app/services/wrench.service';
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
@Component({
|
||||
selector: 'app-familysuggested',
|
||||
templateUrl: './familysuggested.page.html',
|
||||
styleUrls: ['./familysuggested.page.scss'],
|
||||
})
|
||||
export class FamilysuggestedPage implements OnInit {
|
||||
|
||||
constructor( private navctr: NavController,
|
||||
private router: Router,
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private loadingCtrl: LoadingController) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
onBack() {
|
||||
this.navctr.back();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,14 +15,14 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import {LatestMarketComponent} from "../../components/latest-market/latest-market.component";
|
||||
import {HelpListingComponent} from "../../components/help-listing/help-listing.component";
|
||||
import {FamiliyDashComponent} from "../../components/familiy-dash/familiy-dash.component";
|
||||
import { FamiliyNokidsComponent } from '../../components/familycards/familiy-nokids/familiy-nokids.component';
|
||||
import {FamiliyNokidsComponent } from '../../components/familycards/familiy-nokids/familiy-nokids.component';
|
||||
import {FamiliyNotaskComponent} from "../../components/familycards/familiy-notask/familiy-notask.component";
|
||||
import {FamiliyAddfamilyComponent} from "../../components/familycards/familiy-addfamily/familiy-addfamily.component";
|
||||
import {FamiliyAllowanceComponent} from "../../components/familycards/familiy-allowance/familiy-allowance.component";
|
||||
import {DashToptoolComponent} from "../../components/dash-toptool/dash-toptool.component";
|
||||
import {JobownerDashComponent} from "../../components/jobowner-dash/jobowner-dash.component";
|
||||
import {WorkersDashComponent} from "../../components/workers-dash/workers-dash.component";
|
||||
|
||||
import {FamilyhomeComponent} from "../../components/familyhome/familyhome.component";
|
||||
// @NgModule({
|
||||
// schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
// })
|
||||
@@ -43,7 +43,8 @@ import {WorkersDashComponent} from "../../components/workers-dash/workers-dash.c
|
||||
FamiliyAllowanceComponent,
|
||||
DashToptoolComponent,
|
||||
JobownerDashComponent,
|
||||
WorkersDashComponent
|
||||
WorkersDashComponent,
|
||||
FamilyhomeComponent
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
></ion-icon>
|
||||
<ion-icon
|
||||
name="help-circle-outline"
|
||||
size="medium"
|
||||
(click)="onHelp()"
|
||||
></ion-icon>
|
||||
</div>
|
||||
@@ -55,8 +54,9 @@
|
||||
<div class="boxed_contents" id="{{home_dash_type}}">
|
||||
<app-dash-toptool></app-dash-toptool>
|
||||
<div *ngIf="accountType == 'FAMILY'; else elseFulltag">
|
||||
<app-familyhome></app-familyhome>
|
||||
<app-familypending></app-familypending>
|
||||
<app-suggestedlist></app-suggestedlist>
|
||||
<!-- <app-suggestedlist></app-suggestedlist>-->
|
||||
<ion-grid class="fam1">
|
||||
<ion-row class="pend-row">
|
||||
<ion-col
|
||||
|
||||
+182
-176
@@ -1,37 +1,36 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { SessionDataProviderService } from 'src/app/store/session-data-provider.service';
|
||||
import { BlogDataService } from 'src/app/store/blog-data.service';
|
||||
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 { Component, OnInit } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
import { SessionDataProviderService } from "src/app/store/session-data-provider.service";
|
||||
import { BlogDataService } from "src/app/store/blog-data.service";
|
||||
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 {BannersDataService} from "../../store/banners-data.service";
|
||||
import {HelpDataService} from "../../store/help-data.service";
|
||||
import {FamilyDataService} from "../../store/family-data.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";
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.page.html',
|
||||
styleUrls: ['./home.page.scss'],
|
||||
selector: "app-home",
|
||||
templateUrl: "./home.page.html",
|
||||
styleUrls: ["./home.page.scss"],
|
||||
})
|
||||
export class HomePage implements OnInit {
|
||||
homebannerCount:number=0;
|
||||
firstname: string = '';
|
||||
active_job_count:number = 0;
|
||||
homebannerCount: number = 0;
|
||||
firstname: string = "";
|
||||
active_job_count: number = 0;
|
||||
blogData: [];
|
||||
accountType:string="";
|
||||
accountType: string = "";
|
||||
profilePicture = "https://www.wrenchboard.com/assets/images/profile.jpg";
|
||||
offerBanner = "https://www.wrenchboard.com/assets/images/apps/offer.jpg";
|
||||
walletDescription:string ="";
|
||||
walletData:any;
|
||||
enableTracking:number=0;
|
||||
etag:string='';
|
||||
home_dash_type:string = "DEFAULT_HOME_DASH";
|
||||
|
||||
walletDescription: string = "";
|
||||
walletData: any;
|
||||
enableTracking: number = 0;
|
||||
etag: string = "";
|
||||
home_dash_type: string = "DEFAULT_HOME_DASH";
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
@@ -40,63 +39,62 @@ export class HomePage implements OnInit {
|
||||
private onesignalService: OnesignalService,
|
||||
public blogDataService: BlogDataService,
|
||||
public userWalletService: UserWalletService,
|
||||
private locTrcService:LocTrcService,
|
||||
public marketDataService:MarketDataService,
|
||||
public bannersDataService:BannersDataService,
|
||||
public helpDataService:HelpDataService,
|
||||
public familyDataService:FamilyDataService
|
||||
private locTrcService: LocTrcService,
|
||||
public marketDataService: MarketDataService,
|
||||
public bannersDataService: BannersDataService,
|
||||
public helpDataService: HelpDataService,
|
||||
public familyDataService: FamilyDataService
|
||||
) {
|
||||
this.accountType = sessionDataProviderService.account_type;
|
||||
this.firstname = this.sessionDataProviderService.firstname;
|
||||
this.blogData = this.blogDataService.blogData;
|
||||
this.active_job_count = this.sessionDataProviderService.active_job_count;
|
||||
this.active_job_count = this.sessionDataProviderService.active_job_count;
|
||||
this.enableTracking = this.sessionDataProviderService.tracking;
|
||||
this.etag = '' + Date.now();
|
||||
addEventListener('dash_tool_myjobs', () => {
|
||||
this. myJobs(1);
|
||||
this.etag = "" + Date.now();
|
||||
addEventListener("dash_tool_myjobs", () => {
|
||||
this.myJobs(1);
|
||||
});
|
||||
|
||||
addEventListener('dash_tool_mywallet', () => {
|
||||
addEventListener("dash_tool_mywallet", () => {
|
||||
this.myWallet();
|
||||
});
|
||||
|
||||
addEventListener('force_profile_refresh', () => {
|
||||
addEventListener("force_profile_refresh", () => {
|
||||
this.forceProfileRefresh();
|
||||
});
|
||||
|
||||
this.home_dash_type = this.sessionDataProviderService.home_dash_type;
|
||||
//this.home_dash_type = 'FAMILY_PARENT_DASH';
|
||||
}
|
||||
|
||||
async forceProfileRefresh(){
|
||||
|
||||
this.usrData = {
|
||||
action:15030,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
'limit': 30,
|
||||
'offset': 0
|
||||
};
|
||||
this.wrenchService.getProfile(this.usrData).subscribe(
|
||||
profileResult => {
|
||||
console.log("profileResult RETURN DATA->", profileResult );
|
||||
if( profileResult != null){
|
||||
this.sessionDataProviderService.RefreshGlobalSessionData(profileResult);
|
||||
}
|
||||
}
|
||||
console.log(
|
||||
"**** HOME DASH TYPE AT START " +
|
||||
this.sessionDataProviderService.home_dash_type
|
||||
);
|
||||
|
||||
this.home_dash_type = this.sessionDataProviderService.home_dash_type;
|
||||
}
|
||||
allInitFunctions(){
|
||||
if ( this.sessionDataProviderService.member_uid != ''){
|
||||
this.onesignalService.Init(this.sessionDataProviderService.member_uid);
|
||||
|
||||
async forceProfileRefresh() {
|
||||
this.usrData = {
|
||||
action: 15030,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
limit: 30,
|
||||
offset: 0,
|
||||
};
|
||||
this.wrenchService.getProfile(this.usrData).subscribe((profileResult) => {
|
||||
console.log("profileResult RETURN DATA->", profileResult);
|
||||
if (profileResult != null) {
|
||||
this.sessionDataProviderService.RefreshGlobalSessionData(profileResult);
|
||||
}
|
||||
});
|
||||
}
|
||||
allInitFunctions() {
|
||||
if (this.sessionDataProviderService.member_uid != "") {
|
||||
//this.onesignalService.Init(this.sessionDataProviderService.member_uid);
|
||||
this.locTrcService.startTracking();
|
||||
if (this.accountType == 'FULL'){
|
||||
if (this.accountType == "FULL") {
|
||||
this.getBlogData([]);
|
||||
this.getBannersData();
|
||||
}
|
||||
if (this.accountType == 'FAMILY'){
|
||||
if (this.accountType == "FAMILY") {
|
||||
// no need moved to components this.getFamilySuggestList();
|
||||
}
|
||||
}
|
||||
@@ -104,74 +102,87 @@ export class HomePage implements OnInit {
|
||||
ngOnInit() {
|
||||
this.allInitFunctions();
|
||||
}
|
||||
setProfilePicture(){
|
||||
setProfilePicture() {
|
||||
this.accountType = this.sessionDataProviderService.account_type;
|
||||
this.etag = '' + Date.now();
|
||||
if (this.accountType == 'FULL'){
|
||||
this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.member_uid)+'?'+this.etag;
|
||||
this.etag = "" + Date.now();
|
||||
if (this.accountType == "FULL") {
|
||||
this.profilePicture =
|
||||
this.sessionDataProviderService.profilePicture(
|
||||
this.sessionDataProviderService.session,
|
||||
this.sessionDataProviderService.member_uid
|
||||
) +
|
||||
"?" +
|
||||
this.etag;
|
||||
}
|
||||
if (this.accountType == 'FAMILY'){
|
||||
this.profilePicture = this.sessionDataProviderService.profilePicture(this.sessionDataProviderService.session, this.sessionDataProviderService.family_uid)+'?'+this.etag;
|
||||
if (this.accountType == "FAMILY") {
|
||||
this.profilePicture =
|
||||
this.sessionDataProviderService.profilePicture(
|
||||
this.sessionDataProviderService.session,
|
||||
this.sessionDataProviderService.family_uid
|
||||
) +
|
||||
"?" +
|
||||
this.etag;
|
||||
}
|
||||
}
|
||||
ionViewWillEnter(){
|
||||
ionViewWillEnter() {
|
||||
this.allInitFunctions();
|
||||
}
|
||||
|
||||
goPlayground(){
|
||||
this.router.navigate(['playground']);
|
||||
goPlayground() {
|
||||
this.router.navigate(["playground"]);
|
||||
}
|
||||
ionViewDidEnter(){
|
||||
if (this.accountType == 'FULL'){
|
||||
ionViewDidEnter() {
|
||||
if (this.accountType == "FULL") {
|
||||
this.getBlogData([]);
|
||||
this.getBannersData();
|
||||
}
|
||||
if (this.accountType == 'FAMILY'){
|
||||
if (this.accountType == "FAMILY") {
|
||||
this.getFamilySuggestList();
|
||||
}
|
||||
this. setProfilePicture();
|
||||
this.setProfilePicture();
|
||||
}
|
||||
|
||||
blogResult:any;
|
||||
bannerResult:any;
|
||||
blogResult: any;
|
||||
bannerResult: any;
|
||||
bannerData: [];
|
||||
getBlogData(blogReq=[]){
|
||||
this.wrenchService.getBlogData(blogReq).subscribe(
|
||||
blogResult => {
|
||||
this.blogResult = blogResult;
|
||||
console.log("BLOG RETURN->", this.blogResult);
|
||||
this.blogData = this.blogResult.blogdata.slice(0, 2);
|
||||
// debugger;
|
||||
this.blogDataService.setBlogData(this.blogResult.blogdata);
|
||||
}
|
||||
);
|
||||
getBlogData(blogReq = []) {
|
||||
this.wrenchService.getBlogData(blogReq).subscribe((blogResult) => {
|
||||
this.blogResult = blogResult;
|
||||
console.log("BLOG RETURN->", this.blogResult);
|
||||
this.blogData = this.blogResult.blogdata.slice(0, 2);
|
||||
// debugger;
|
||||
this.blogDataService.setBlogData(this.blogResult.blogdata);
|
||||
});
|
||||
}
|
||||
|
||||
async refreshBannersData(){
|
||||
async refreshBannersData() {
|
||||
this.bannerData = this.bannersDataService.bannerData;
|
||||
this.homebannerCount = this.bannersDataService.homebannerCount;
|
||||
}
|
||||
|
||||
usrData: {
|
||||
action:number, member_id: number, uid: string,
|
||||
sessionid: string,
|
||||
'limit': 30,
|
||||
'offset': 0
|
||||
action: number;
|
||||
member_id: number;
|
||||
uid: string;
|
||||
sessionid: string;
|
||||
limit: 30;
|
||||
offset: 0;
|
||||
};
|
||||
async getBannersData(){
|
||||
async getBannersData() {
|
||||
this.refreshBannersData();
|
||||
|
||||
var interval = setInterval( ()=> {
|
||||
var interval = setInterval(() => {
|
||||
this.home_dash_type = this.sessionDataProviderService.home_dash_type;
|
||||
this.refreshBannersData();
|
||||
console.log("******* IN THE HOME " + this.home_dash_type);
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
familySuggestResult:any;
|
||||
familySuggestData:any;
|
||||
getFamilySuggestList(){
|
||||
familySuggestResult: any;
|
||||
familySuggestData: any;
|
||||
getFamilySuggestList() {
|
||||
this.familySuggestData = this.familyDataService.familySuggestData;
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
this.familySuggestData = this.familyDataService.familySuggestData; // just read no server reqyuest
|
||||
}, 5000);
|
||||
// this.usrData = {
|
||||
@@ -191,128 +202,123 @@ export class HomePage implements OnInit {
|
||||
// );
|
||||
}
|
||||
onDetails(item) {
|
||||
// var pageToNavigate = 'detail';
|
||||
var pageToNavigate = '';
|
||||
// alert(item.link_path);
|
||||
switch (item.link_path){
|
||||
case 'referral':
|
||||
pageToNavigate = 'invite';
|
||||
break;
|
||||
case 'mytask': // offers waiting to start
|
||||
pageToNavigate = 'joboffers';
|
||||
break;
|
||||
// var pageToNavigate = 'detail';
|
||||
var pageToNavigate = "";
|
||||
//alert(item.link_path);
|
||||
switch (item.link_path) {
|
||||
case "referral":
|
||||
pageToNavigate = "invite";
|
||||
break;
|
||||
case "mytask": // offers waiting to start
|
||||
//case "my-active-jobs":
|
||||
pageToNavigate = "joboffers";
|
||||
break;
|
||||
|
||||
case 'my-coupon':
|
||||
pageToNavigate = 'mycoupons';
|
||||
break;
|
||||
case 'blog-page':
|
||||
case "my-coupon":
|
||||
pageToNavigate = "mycoupons";
|
||||
break;
|
||||
case "blog-page":
|
||||
// this.blogDetails(this.getOneBlog(item));
|
||||
this.getOneBlog(item);
|
||||
break;
|
||||
this.getOneBlog(item);
|
||||
break;
|
||||
|
||||
case 'my-review-jobs':
|
||||
pageToNavigate = 'jobmanager';
|
||||
break
|
||||
case "my-review-jobs":
|
||||
pageToNavigate = "jobmanager";
|
||||
break;
|
||||
|
||||
case 'my-pastdue-jobs':
|
||||
pageToNavigate = 'jobmanager';
|
||||
break
|
||||
case "my-pastdue-jobs":
|
||||
pageToNavigate = "jobmanager";
|
||||
break;
|
||||
|
||||
case 'pend-interest':
|
||||
pageToNavigate ='pendinterest';
|
||||
break;
|
||||
case "pend-interest":
|
||||
pageToNavigate = "pendinterest";
|
||||
break;
|
||||
|
||||
case "offer-interest":
|
||||
pageToNavigate = "jobinterest";
|
||||
break;
|
||||
|
||||
|
||||
case 'offer-interest':
|
||||
pageToNavigate = 'jobinterest';
|
||||
break
|
||||
|
||||
case 'acc-family':
|
||||
pageToNavigate = 'family';
|
||||
break;
|
||||
|
||||
}
|
||||
if(pageToNavigate !=''){
|
||||
this.router.navigate([pageToNavigate],{state: item});
|
||||
}
|
||||
case "acc-family":
|
||||
pageToNavigate = "family";
|
||||
break;
|
||||
}
|
||||
if (pageToNavigate != "") {
|
||||
this.router.navigate([pageToNavigate], { state: item });
|
||||
}
|
||||
}
|
||||
|
||||
myWallet(){
|
||||
this.router.navigate(['tabs/tab4']);
|
||||
myWallet() {
|
||||
this.router.navigate(["tabs/tab4"]);
|
||||
}
|
||||
fabitem : {card_type: string};
|
||||
myJobs(num){
|
||||
|
||||
switch(num){
|
||||
fabitem: { card_type: string };
|
||||
myJobs(num) {
|
||||
switch (num) {
|
||||
case 1:
|
||||
this.fabitem = {card_type:'active'};
|
||||
this.fabitem = { card_type: "active" };
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this.fabitem = {card_type:'REVIEWJOB'};
|
||||
this.fabitem = { card_type: "REVIEWJOB" };
|
||||
break;
|
||||
|
||||
case 3:
|
||||
this.fabitem = {card_type:'PASTDUEJOB'};
|
||||
this.fabitem = { card_type: "PASTDUEJOB" };
|
||||
break;
|
||||
}
|
||||
this.router.navigate(['jobmanager'],{state: this.fabitem});
|
||||
this.router.navigate(["jobmanager"], { state: this.fabitem });
|
||||
}
|
||||
selBlogResult:any;
|
||||
getOneBlog(item){
|
||||
const bligTmF ={
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
blog_id: item.blog_id,
|
||||
limit: 1
|
||||
};
|
||||
selBlogResult: any;
|
||||
getOneBlog(item) {
|
||||
const bligTmF = {
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
blog_id: item.blog_id,
|
||||
limit: 1,
|
||||
};
|
||||
|
||||
this.wrenchService.getBlogData(bligTmF).subscribe(
|
||||
blogResult1 => {
|
||||
this.selBlogResult = blogResult1.blogdata[0];
|
||||
console.log("selBlogResult RETURN->", this.selBlogResult);
|
||||
this.blogDetails(this.selBlogResult );
|
||||
}
|
||||
);
|
||||
return this.selBlogResult;
|
||||
this.wrenchService.getBlogData(bligTmF).subscribe((blogResult1) => {
|
||||
this.selBlogResult = blogResult1.blogdata[0];
|
||||
console.log("selBlogResult RETURN->", this.selBlogResult);
|
||||
this.blogDetails(this.selBlogResult);
|
||||
});
|
||||
return this.selBlogResult;
|
||||
}
|
||||
blogDetails(item) {
|
||||
var pageToNavigate = 'blogdetail';
|
||||
this.router.navigate([pageToNavigate],{state: item} );
|
||||
var pageToNavigate = "blogdetail";
|
||||
this.router.navigate([pageToNavigate], { state: item });
|
||||
}
|
||||
|
||||
allBlog(){
|
||||
this.router.navigate(['allblog']);
|
||||
}
|
||||
allBlog() {
|
||||
this.router.navigate(["allblog"]);
|
||||
}
|
||||
|
||||
onNotification() {
|
||||
this.router.navigate(['notification']);
|
||||
this.router.navigate(["notification"]);
|
||||
}
|
||||
|
||||
isModalOpen:boolean=false;
|
||||
isModalOpen: boolean = false;
|
||||
onHelp() {
|
||||
this.helpDataService.getHelpData();
|
||||
this.helpDataService.getHelpData();
|
||||
|
||||
this.isModalOpen = true;
|
||||
this.isModalOpen = true;
|
||||
}
|
||||
|
||||
setCloseModal(){
|
||||
// debugger;
|
||||
setCloseModal() {
|
||||
// debugger;
|
||||
this.isModalOpen = false;
|
||||
}
|
||||
onTopMentors() {
|
||||
this.router.navigate(['top-mentors']);
|
||||
this.router.navigate(["top-mentors"]);
|
||||
}
|
||||
|
||||
onBookmark() {
|
||||
this.router.navigate(['bookmark']);
|
||||
this.router.navigate(["bookmark"]);
|
||||
}
|
||||
|
||||
onPopular() {
|
||||
this.router.navigate(['popular']);
|
||||
this.router.navigate(["popular"]);
|
||||
}
|
||||
|
||||
onSearch() {
|
||||
this.router.navigate(['search']);
|
||||
this.router.navigate(["search"]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header mode="ios" class="ion-no-border">
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start" (click)="onBack()">
|
||||
<ion-button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header mode="ios" class="ion-no-border">
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start" (click)="onBack()">
|
||||
<ion-button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header mode="ios" class="ion-no-border">
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start" (click)="onBack()">
|
||||
<ion-button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header mode="ios" class="ion-no-border">
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start" (click)="onBack()">
|
||||
<ion-button>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
ion-content {
|
||||
.back_image {
|
||||
width: 100%;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header mode="ios" class="ion-no-border">
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start" (click)="onBack()">
|
||||
<ion-button>
|
||||
|
||||
@@ -96,7 +96,8 @@ export class RegisterPage implements OnInit {
|
||||
|
||||
verReg(){
|
||||
if (this.username == null || this.username == '' || this.validateEmail(this.username) == false
|
||||
|| this.password == null || this.password == '' || this.password.length < 8
|
||||
|| this.password == null || this.password == ''
|
||||
|| this.password.length < 8
|
||||
|| this.firstname == null || this.firstname == ''
|
||||
|| this.lastname == null || this.lastname == ''
|
||||
|| this.country == null || this.country == ''
|
||||
@@ -109,6 +110,29 @@ export class RegisterPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
To check a password between 8 to 15 characters which contain
|
||||
at least one lowercase letter,
|
||||
one uppercase letter,
|
||||
one numeric digit,
|
||||
and one special character
|
||||
*/
|
||||
//https://www.w3resource.com/javascript/form/password-validation.php
|
||||
CheckPassword(inputtxt)
|
||||
{
|
||||
var decimal= /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
|
||||
if(inputtxt.value.match(decimal))
|
||||
{
|
||||
alert('Correct, try another...')
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Wrong...!')
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
verReg2(){
|
||||
this.isDisabled2= true;
|
||||
if (this.password != null && this.password != '' && this.password.length> 6
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
|
||||
<ion-header mode="ios" class="ion-no-border">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="end">
|
||||
<!-- <ion-button>-->
|
||||
<!-- <ion-icon name="search-outline"></ion-icon>-->
|
||||
<!-- </ion-button>-->
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="start" (click)="onBack()">
|
||||
<ion-button>
|
||||
<ion-icon name="arrow-back-outline"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end">
|
||||
<!-- <ion-button>-->
|
||||
<!-- <ion-icon name="ellipsis-horizontal-circle-outline"></ion-icon>-->
|
||||
<!-- </ion-button>-->
|
||||
</ion-buttons>
|
||||
<ion-title>Suggest Task(s)</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
@@ -167,6 +167,10 @@ export class WrenchService {
|
||||
return this.getPostData('homebanners',usrData);
|
||||
}
|
||||
|
||||
getFamilyBanners(usrData){
|
||||
return this.getPostData('familybanners',usrData);
|
||||
}
|
||||
|
||||
activeJobStatus(reqData){
|
||||
return this.getPostData("activejobstatus", reqData);
|
||||
}
|
||||
|
||||
@@ -1,64 +1,117 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import {SessionDataProviderService} from "./session-data-provider.service";
|
||||
import {WrenchService} from "../services/wrench.service";
|
||||
import {Router} from "@angular/router";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { SessionDataProviderService } from "./session-data-provider.service";
|
||||
import { WrenchService } from "../services/wrench.service";
|
||||
import { Router } from "@angular/router";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: "root",
|
||||
})
|
||||
export class BannersDataService {
|
||||
homebannerCount:number=0;
|
||||
bannerResult:any;
|
||||
homebannerCount: number = 0;
|
||||
bannerResult: any;
|
||||
bannerData: [];
|
||||
|
||||
constructor(
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private route:Router
|
||||
)
|
||||
{
|
||||
|
||||
}
|
||||
public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private route: Router
|
||||
) {}
|
||||
|
||||
usrData: {
|
||||
action:number,
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
limit: 30,
|
||||
offset: 0
|
||||
};
|
||||
action: number;
|
||||
member_id: number;
|
||||
uid: string;
|
||||
sessionid: string;
|
||||
limit: 30;
|
||||
offset: 0;
|
||||
};
|
||||
|
||||
async getBannersData(){
|
||||
if (this.sessionDataProviderService.account_type=='FAMILY'){
|
||||
await this.getFamilyBannersData();
|
||||
}
|
||||
else{
|
||||
await this.getHomeBannersData();
|
||||
}
|
||||
}
|
||||
async getHomeBannersData() {
|
||||
this.usrData = {
|
||||
action:11200,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
limit: 30,
|
||||
offset: 0
|
||||
action: 11200,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
limit: 30,
|
||||
offset: 0,
|
||||
};
|
||||
|
||||
this.wrenchService.getHomeBanners(this.usrData).subscribe(
|
||||
bannerResult => {
|
||||
this.bannerResult = bannerResult;
|
||||
this.wrenchService
|
||||
.getHomeBanners(this.usrData)
|
||||
.subscribe((bannerResult) => {
|
||||
this.bannerResult = bannerResult;
|
||||
|
||||
if ( this.bannerResult == undefined || this.bannerResult.internal_return == -9999){
|
||||
// force logout
|
||||
console.log("FORCE BANNER LOGOUT BANNERS RETURN->", this.bannerResult);
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
this.route.navigate(['logout']);
|
||||
}
|
||||
|
||||
console.log("BANNERS RETURN->", this.bannerResult);
|
||||
this.bannerData = this.bannerResult.result_list;
|
||||
if ( this.bannerResult.home_dash_type != ''){
|
||||
// debugger;
|
||||
this.sessionDataProviderService.home_dash_type = this.bannerResult.home_dash_type;
|
||||
}
|
||||
this.homebannerCount = this.bannerData?.length;
|
||||
if (
|
||||
this.bannerResult == undefined ||
|
||||
this.bannerResult.internal_return == -9999
|
||||
) {
|
||||
// force logout
|
||||
console.log(
|
||||
"FORCE BANNER LOGOUT BANNERS RETURN->",
|
||||
this.bannerResult
|
||||
);
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
this.route.navigate(["logout"]);
|
||||
}
|
||||
);
|
||||
|
||||
console.log("BANNERS RETURN->", this.bannerResult);
|
||||
this.bannerData = this.bannerResult.result_list;
|
||||
if (this.bannerResult.home_dash_type != "") {
|
||||
// debugger;
|
||||
this.sessionDataProviderService.home_dash_type =
|
||||
this.bannerResult.home_dash_type;
|
||||
}
|
||||
this.homebannerCount = this.bannerData?.length;
|
||||
});
|
||||
}
|
||||
|
||||
familyBannerCount: number = 0;
|
||||
familyBannerResult: any;
|
||||
familyBannerData: [];
|
||||
async getFamilyBannersData() {
|
||||
this.usrData = {
|
||||
action: 11200,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session,
|
||||
limit: 30,
|
||||
offset: 0,
|
||||
};
|
||||
|
||||
this.wrenchService
|
||||
.getFamilyBanners(this.usrData)
|
||||
.subscribe((familyBannerResult) => {
|
||||
this.familyBannerResult = familyBannerResult;
|
||||
|
||||
if (
|
||||
this.familyBannerResult == undefined ||
|
||||
this.familyBannerResult.internal_return == -9999
|
||||
) {
|
||||
// force logout
|
||||
console.log(
|
||||
"FORCE BANNER LOGOUT BANNERS RETURN->",
|
||||
this.familyBannerResult
|
||||
);
|
||||
this.sessionDataProviderService.DestroySessionOnLogout();
|
||||
this.route.navigate(["logout"]);
|
||||
}
|
||||
|
||||
console.log("BANNERS RETURN->", this.familyBannerResult);
|
||||
this.familyBannerData = this.familyBannerResult.result_list;
|
||||
if (this.bannerResult.home_dash_type != "") {
|
||||
// debugger;
|
||||
// this.sessionDataProviderService.home_dash_type =
|
||||
// this.bannerResult.home_dash_type;
|
||||
}
|
||||
this.familyBannerCount = this.familyBannerData?.length;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user