Added working snippets and placeholder pie chart
This commit is contained in:
parent
6eb6425fb8
commit
32bebd7c24
9 changed files with 142 additions and 41 deletions
|
@ -3,24 +3,24 @@
|
|||
<ul>
|
||||
<li class="hidden-sm-down">
|
||||
<div class="text-muted">My Points</div>
|
||||
<strong>{{ basicStats.user_sum / 10 | number:'1.0-0' }}</strong>
|
||||
<strong>{{ userSum / 10 | number:'1.0-0' }}</strong>
|
||||
</li>
|
||||
<li class="hidden-sm-down">
|
||||
<div class="text-muted">My Rank</div>
|
||||
<div *ngIf="basicStats.user_position == 0" class="statuscontent">
|
||||
<div *ngIf="userPosition == 0" class="statuscontent">
|
||||
<strong>Unranked</strong>
|
||||
</div>
|
||||
<div *ngIf="basicStats.user_position != 0" class="statuscontent">
|
||||
<strong>{{ basicStats.user_position }}</strong>
|
||||
<div *ngIf="userPosition != 0" class="statuscontent">
|
||||
<strong>{{ userPosition }}</strong>
|
||||
</div>
|
||||
</li>
|
||||
<li class="hidden-sm-down">
|
||||
<div class="text-muted">My Total Spend</div>
|
||||
<strong>{{ basicStats.user_sum | currency:'GBP':'symbol':'1.2-2' }}</strong>
|
||||
<strong>{{ userSum | currency:'GBP':'symbol':'1.2-2' }}</strong>
|
||||
</li>
|
||||
<li class="hidden-sm-down">
|
||||
<div class="text-muted">Value to Local Economy</div>
|
||||
<strong>{{ basicStats.user_sum * 2.3 | currency:'GBP':'symbol':'1.2-2' }}</strong>
|
||||
<strong>{{ userSum * 2.3 | currency:'GBP':'symbol':'1.2-2' }}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { OrgSnippetsService } from '../providers/org-snippets.service';
|
||||
import { CustSnippetsService } from '../providers/cust-snippets.service';
|
||||
|
||||
@Component({
|
||||
selector: 'snippet-bar-cust',
|
||||
|
@ -7,41 +7,19 @@ import { OrgSnippetsService } from '../providers/org-snippets.service';
|
|||
})
|
||||
export class CustBarSnippetComponent implements OnInit {
|
||||
|
||||
public thisMonthSalesCount = 0;
|
||||
public thisMonthSalesTotal = 0;
|
||||
public thisWeekSalesCount = 0;
|
||||
public thisWeekSalesTotal = 0;
|
||||
public todaySalesCount = 0;
|
||||
public todaySalesTotal = 0;
|
||||
|
||||
public thisMonthPurchasesCount = 0;
|
||||
public thisMonthPurchasesTotal = 0;
|
||||
public thisWeekPurchasesCount = 0;
|
||||
public thisWeekPurchasesTotal = 0;
|
||||
public todayPurchasesCount = 0;
|
||||
public todayPurchasesTotal = 0;
|
||||
public userSum = 0;
|
||||
public userPosition = 0;
|
||||
|
||||
constructor(
|
||||
private snippetsService: OrgSnippetsService,
|
||||
private snippetsService: CustSnippetsService,
|
||||
) { }
|
||||
|
||||
public ngOnInit(): void {
|
||||
this.snippetsService.getData()
|
||||
.subscribe(
|
||||
result => {
|
||||
this.thisMonthSalesCount = result.snippets.this_month_sales_count;
|
||||
this.thisMonthSalesTotal = result.snippets.this_month_sales_total;
|
||||
this.thisWeekSalesCount = result.snippets.this_week_sales_count;
|
||||
this.thisWeekSalesTotal = result.snippets.this_week_sales_total;
|
||||
this.todaySalesCount = result.snippets.today_sales_count;
|
||||
this.todaySalesTotal = result.snippets.today_sales_total;
|
||||
|
||||
this.thisMonthPurchasesCount = result.snippets.this_week_purchases_count;
|
||||
this.thisMonthPurchasesTotal = result.snippets.this_week_purchases_total;
|
||||
this.thisWeekPurchasesCount = result.snippets.this_month_purchases_count;
|
||||
this.thisWeekPurchasesTotal = result.snippets.this_month_purchases_total;
|
||||
this.todayPurchasesCount = result.snippets.today_purchases_count;
|
||||
this.todayPurchasesTotal = result.snippets.today_purchases_total;
|
||||
this.userSum = result.snippets.user_sum;
|
||||
this.userPosition = result.snippets.user_position;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Reference in a new issue