top wallet
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<ion-toolbar class="top-tool" *ngIf="walletDescription !='' || active_job_count != 0">
|
||||
<ion-buttons slot="secondary">
|
||||
<ion-button
|
||||
*ngIf="walletDescription !='' "
|
||||
style="border-radius: 10px; font-weight: bolder;"
|
||||
fill="solid"
|
||||
color="primary"
|
||||
(click)="myWallet()">
|
||||
<ion-icon slot="end" name="wallet"></ion-icon>
|
||||
{{walletDescription}}
|
||||
</ion-button>
|
||||
<ion-button
|
||||
*ngIf="walletDescription =='' "
|
||||
style="border-radius: 10px; font-weight: bolder;"
|
||||
fill="solid"
|
||||
color="primary"
|
||||
(click)="myWallet()">
|
||||
<ion-icon slot="end" name="wallet"></ion-icon>
|
||||
Wallet
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="primary" *ngIf="active_job_count != 0">
|
||||
<ion-button
|
||||
style="border-radius: 15px;
|
||||
font-weight: bolder"
|
||||
fill="solid"
|
||||
color="primary" (click)="myJobs(1)">
|
||||
My Jobs
|
||||
<ion-icon slot="end" name="list"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<!-- <ion-title>{{walletDescription}}</ion-title>-->
|
||||
</ion-toolbar>
|
||||
@@ -0,0 +1,9 @@
|
||||
.top-tool{
|
||||
--background: #e9f1f1;
|
||||
border-radius: 10px;
|
||||
ion-buttons{
|
||||
ion-button{
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { DashToptoolComponent } from './dash-toptool.component';
|
||||
|
||||
describe('DashToptoolComponent', () => {
|
||||
let component: DashToptoolComponent;
|
||||
let fixture: ComponentFixture<DashToptoolComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DashToptoolComponent ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(DashToptoolComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {SessionDataProviderService} from "../../store/session-data-provider.service";
|
||||
import {WrenchService} from "../../services/wrench.service";
|
||||
import {OnesignalService} from "../../services/onesignal.service";
|
||||
import {BlogDataService} from "../../store/blog-data.service";
|
||||
import {UserWalletService} from "../../store/user-wallet.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-dash-toptool',
|
||||
templateUrl: './dash-toptool.component.html',
|
||||
styleUrls: ['./dash-toptool.component.scss'],
|
||||
})
|
||||
export class DashToptoolComponent implements OnInit {
|
||||
walletDescription:string ="";
|
||||
walletData:any;
|
||||
active_job_count:number=0;
|
||||
|
||||
constructor( public sessionDataProviderService: SessionDataProviderService,
|
||||
private wrenchService: WrenchService,
|
||||
private onesignalService: OnesignalService,
|
||||
public blogDataService: BlogDataService,
|
||||
public userWalletService: UserWalletService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.walletPresentation();
|
||||
this.active_job_count = this.sessionDataProviderService.active_job_count;
|
||||
setInterval(()=>{
|
||||
this.walletPresentation();
|
||||
this.active_job_count = this.sessionDataProviderService.active_job_count;
|
||||
}, 100000);
|
||||
}
|
||||
|
||||
async walletPresentation(){
|
||||
this.walletData = this.userWalletService.getWallet();
|
||||
if( this.walletData?.length > 0 ) {
|
||||
var num = new Number(this.walletData[0].amount*0.01);
|
||||
//this.fee_display = num.toFixed(2); //outputs 14
|
||||
this.walletDescription = num.toFixed(2) + ' ' + this.walletData[0].description;
|
||||
}
|
||||
}
|
||||
myJobs(jmode){
|
||||
dispatchEvent(new Event("dash_tool_myjobs"));
|
||||
}
|
||||
myWallet(){
|
||||
dispatchEvent(new Event("dash_tool_mywallet"));
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import { FamiliyNokidsComponent } from '../../components/familycards/familiy-nok
|
||||
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";
|
||||
|
||||
// @NgModule({
|
||||
// schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
@@ -37,7 +38,8 @@ import {FamiliyAllowanceComponent} from "../../components/familycards/familiy-al
|
||||
LatestMarketComponent,HelpListingComponent,
|
||||
FamiliyDashComponent,FamiliyNokidsComponent,
|
||||
FamiliyNotaskComponent,FamiliyAddfamilyComponent,
|
||||
FamiliyAllowanceComponent
|
||||
FamiliyAllowanceComponent,
|
||||
DashToptoolComponent
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</div>
|
||||
|
||||
<div *ngIf = "accountType == 'FULL';">
|
||||
<ion-toolbar>
|
||||
<div class="heading">
|
||||
@@ -38,7 +37,7 @@
|
||||
|
||||
<ion-content class="ion-padding">
|
||||
<div class="boxed_contents">
|
||||
|
||||
<app-dash-toptool></app-dash-toptool>
|
||||
<div *ngIf = "accountType == 'FAMILY'; else elseFulltag">
|
||||
<app-familypending></app-familypending>
|
||||
<app-suggestedlist></app-suggestedlist>
|
||||
@@ -56,22 +55,25 @@
|
||||
</ion-grid>
|
||||
</div>
|
||||
<ng-template #elseFulltag>
|
||||
<ion-toolbar class="top-tool" *ngIf="walletDescription !='' || active_job_count != 0">
|
||||
<ion-buttons slot="secondary" *ngIf="walletDescription !='' ">
|
||||
<ion-button shape="round" fill="solid" color="primary" (click)="myWallet()">
|
||||
<ion-icon slot="end" name="wallet"></ion-icon>
|
||||
{{walletDescription}}
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="primary" *ngIf="active_job_count != 0">
|
||||
<ion-button shape="round" fill="solid" color="primary" (click)="myJobs(1)">
|
||||
My Jobs
|
||||
<ion-icon slot="end" name="list"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<!-- <ion-title>{{walletDescription}}</ion-title>-->
|
||||
</ion-toolbar>
|
||||
<app-familiy-dash></app-familiy-dash>
|
||||
<!-- <ion-toolbar class="top-tool" *ngIf="walletDescription !='' || active_job_count != 0">-->
|
||||
<!-- <ion-buttons slot="secondary" *ngIf="walletDescription !='' ">-->
|
||||
<!-- <ion-button shape="round" fill="solid" color="primary" (click)="myWallet()">-->
|
||||
<!-- <ion-icon slot="end" name="wallet"></ion-icon>-->
|
||||
<!-- {{walletDescription}}-->
|
||||
<!-- </ion-button>-->
|
||||
<!-- </ion-buttons>-->
|
||||
<!-- <ion-buttons slot="primary" *ngIf="active_job_count != 0">-->
|
||||
<!-- <ion-button shape="round" fill="solid" color="primary" (click)="myJobs(1)">-->
|
||||
<!-- My Jobs-->
|
||||
<!-- <ion-icon slot="end" name="list"></ion-icon>-->
|
||||
<!-- </ion-button>-->
|
||||
<!-- </ion-buttons>-->
|
||||
<!-- <!– <ion-title>{{walletDescription}}</ion-title>–>-->
|
||||
<!-- </ion-toolbar>-->
|
||||
|
||||
|
||||
|
||||
<!-- <app-familiy-dash></app-familiy-dash>-->
|
||||
<app-latest-market></app-latest-market>
|
||||
<app-fastreward></app-fastreward>
|
||||
<!-- <app-tracking></app-tracking>-->
|
||||
@@ -87,11 +89,13 @@
|
||||
</ion-list>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
<div *ngIf = "homebannerCount <3;">
|
||||
<div class="offer">
|
||||
<div class="bg_image back_image" [style.backgroundImage]="'url('+offerBanner+')'"></div>
|
||||
</div>
|
||||
<!-- <div class="offer">-->
|
||||
<!-- <div class="bg_image back_image" [style.backgroundImage]="'url('+offerBanner+')'"></div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
<div *ngFor="let item of bannerData; let i = index" class="bg_white {{item.short_style}} {{item.card_type}} " (click)="onDetails(item)">
|
||||
<div class="list">
|
||||
<div *ngIf="item.banner_location === 'URL' ">
|
||||
|
||||
@@ -49,6 +49,15 @@ export class HomePage implements OnInit {
|
||||
this.blogData = this.blogDataService.blogData;
|
||||
this.active_job_count = this.sessionDataProviderService.active_job_count;
|
||||
this.enableTracking = this.sessionDataProviderService.tracking;
|
||||
|
||||
addEventListener('dash_tool_myjobs', () => {
|
||||
this. myJobs(1);
|
||||
});
|
||||
|
||||
addEventListener('dash_tool_mywallet', () => {
|
||||
this.myWallet();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
allInitFunctions(){
|
||||
@@ -69,7 +78,7 @@ export class HomePage implements OnInit {
|
||||
//debugger;
|
||||
|
||||
|
||||
this.walletPresentation();
|
||||
// this.walletPresentation();
|
||||
}
|
||||
ngOnInit() {
|
||||
this.allInitFunctions();
|
||||
@@ -81,14 +90,14 @@ export class HomePage implements OnInit {
|
||||
console.log('Home page did enter - > ionViewWillEnter');
|
||||
this.allInitFunctions();
|
||||
}
|
||||
async walletPresentation(){
|
||||
this.walletData = this.userWalletService.getWallet();
|
||||
if( this.walletData?.length > 0 ) {
|
||||
var num = new Number(this.walletData[0].amount*0.01);
|
||||
//this.fee_display = num.toFixed(2); //outputs 14
|
||||
this.walletDescription = num.toFixed(2) + ' ' + this.walletData[0].description;
|
||||
}
|
||||
}
|
||||
// async walletPresentation(){
|
||||
// this.walletData = this.userWalletService.getWallet();
|
||||
// if( this.walletData?.length > 0 ) {
|
||||
// var num = new Number(this.walletData[0].amount*0.01);
|
||||
// //this.fee_display = num.toFixed(2); //outputs 14
|
||||
// this.walletDescription = num.toFixed(2) + ' ' + this.walletData[0].description;
|
||||
// }
|
||||
// }
|
||||
goPlayground(){
|
||||
this.router.navigate(['playground']);
|
||||
}
|
||||
@@ -104,7 +113,7 @@ export class HomePage implements OnInit {
|
||||
this.getFamilySuggestList();
|
||||
}
|
||||
|
||||
this.walletPresentation();
|
||||
// this.walletPresentation();
|
||||
//debugger;
|
||||
}
|
||||
blogResult:any;
|
||||
|
||||
@@ -5,6 +5,7 @@ import {TasksDataService} from "./tasks-data.service";
|
||||
import {BannersDataService} from "./banners-data.service";
|
||||
import {UsersoffersDataService} from "./usersoffers-data.service";
|
||||
import {FamilyDataService} from "./family-data.service";
|
||||
import {UserWalletService} from "./user-wallet.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -16,7 +17,8 @@ export class IntervalRefreshService {
|
||||
public tasksDataService:TasksDataService,
|
||||
public bannersDataService:BannersDataService,
|
||||
public usersoffersDataService:UsersoffersDataService,
|
||||
public familyDataService: FamilyDataService
|
||||
public familyDataService: FamilyDataService,
|
||||
public userWalletService: UserWalletService
|
||||
) {
|
||||
this.marketDataService.getJobsData();
|
||||
}
|
||||
@@ -33,6 +35,7 @@ export class IntervalRefreshService {
|
||||
this.marketDataService.getJobsData();
|
||||
this.tasksDataService.getJobsData();
|
||||
this.usersoffersDataService.getMyOffersData();
|
||||
this.userWalletService.getWalletData();
|
||||
|
||||
if ( this.sessionDataProviderService.account_type=='FAMILY'){
|
||||
this.familyDataService.getFamilySuggestList();
|
||||
|
||||
@@ -25,8 +25,7 @@ export class UserWalletService {
|
||||
}
|
||||
|
||||
rawWallet:any;
|
||||
getWallet(){
|
||||
// this.rawWallet = this.getWalletData();
|
||||
async getWallet(){
|
||||
return this.walletData;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user