сделал суммирование бонусов со всех бонусных программ
This commit is contained in:
gofnnp 2023-03-20 23:30:20 +04:00
parent 5e3b211778
commit 7bb05324a9
2 changed files with 5 additions and 1 deletions

View File

@ -26,7 +26,7 @@
</div>
<div *ngIf="accountData" class="row">
<span class="key">Баланс карты</span>
<span class="value">{{ accountData.Bonuses }}</span>
<span class="value">{{ bonuses }}</span>
</div>
</div>
<div class="card-container__barcode-container">

View File

@ -38,6 +38,7 @@ export class BonusProgramComponent implements OnInit {
public currentPage: Page = this.pageList[1];
public userName: string = '';
public deviceType: 'ios' | 'android' | null = null;
public bonuses: number = 0
constructor(
private jsonrpc: JsonrpcService,
@ -91,6 +92,9 @@ export class BonusProgramComponent implements OnInit {
);
this.accountData = getAccount && getAccount['Cards'][0];
this.bonuses = this.accountData.BonusProgramAccounts.reduce((previous, {Bonuses}) => {
return previous + Bonuses
}, 0)
this.loadingBonuses = false;
if (this.accountData) {
barcode('#barcode')