More placeholder code for customer dashboard

This commit is contained in:
piratefinn 2017-12-12 15:10:44 +00:00
parent 7e69c111e7
commit 6eb6425fb8
9 changed files with 174 additions and 149 deletions

View file

@ -2,6 +2,8 @@ import { Directive, Component, OnInit } from '@angular/core';
import { ApiService } from '../providers/api-service';
import { Router } from '@angular/router';
import { GraphWidget } from '../widgets/graph-widget.component';
import { CustBarSnippetComponent } from '../snippets/cust-snippet-bar.component';
import { DataType } from '../shared/data-types.enum';
@Component({
templateUrl: 'dashboard-customer.component.html'
@ -20,32 +22,62 @@ export class DashboardCustomerComponent implements OnInit {
myRank: any;
username: any;
basicStats = {
today_sum: 0,
today_count: 0,
week_sum: 0,
week_count: 0,
month_sum: 0,
month_count: 0,
user_sum: 0,
user_count: 0,
global_sum: 0,
global_count: 0,
user_position: 0,
};
public widgetList = [
{
type: 'graph',
name: 'total_today',
title: 'Total Today',
dataType: DataType.currency,
},
{
type: 'graph',
name: 'avg_spend_today',
title: 'Avg. Spend Today',
dataType: DataType.currency,
},
{
type: 'graph',
name: 'total_last_week',
icon: 'icon-diamond',
title: 'Last Week Total',
dataType: DataType.currency,
},
{
type: 'graph',
name: 'avg_spend_last_week',
icon: 'icon-diamond',
title: 'Last Week Avg. Spend',
dataType: DataType.currency,
},
{
type: 'graph',
name: 'total_last_month',
title: 'Last Month Total',
dataType: DataType.currency,
},
{
type: 'graph',
name: 'avg_spend_last_month',
title: 'Last Month Avg. Spend',
dataType: DataType.currency,
},
{
type: 'graph',
name: 'total_user',
title: 'User Total',
dataType: DataType.currency,
},
{
type: 'graph',
name: 'avg_spend_user',
title: 'User Avg. Spend',
dataType: DataType.currency,
},
];
constructor(
private api: ApiService,
) {
this.api.basicStats().subscribe(
result => {
this.basicStats = result;
},
error => {
console.log('Retrieval Error');
console.log( error._body );
}
);
}
ngOnInit(): void {