dev #14305 Изменение дизайна WPA Кофе-лайка: round bonuses count
This commit is contained in:
parent
e062f05f36
commit
6feeec80f2
@ -8,7 +8,7 @@
|
|||||||
<p id="level-percent">Кэшбек {{ loyaltyProgram.currentLvlPeriod.percent }}%</p>
|
<p id="level-percent">Кэшбек {{ loyaltyProgram.currentLvlPeriod.percent }}%</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="top-info__bonus">
|
<p class="top-info__bonus">
|
||||||
{{ loyaltyProgram.getBalanceAmount(customerInfo?.walletBalances) }}
|
{{ Math.floor(loyaltyProgram.getBalanceAmount(customerInfo?.walletBalances)) }}
|
||||||
бонусов
|
бонусов
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export class GuestCardComponent implements OnInit {
|
|||||||
public customerInfo!: any;
|
public customerInfo!: any;
|
||||||
public purchases!: Purchase[];
|
public purchases!: Purchase[];
|
||||||
public lastPurchase!: Purchase;
|
public lastPurchase!: Purchase;
|
||||||
|
public Math: Math = Math;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _bottomSheet: MatBottomSheet,
|
private _bottomSheet: MatBottomSheet,
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export class GuestCardComponent implements OnInit {
|
|||||||
private _bottomSheet: MatBottomSheet,
|
private _bottomSheet: MatBottomSheet,
|
||||||
private cookiesService: CookiesService,
|
private cookiesService: CookiesService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private wpJsonService: WpJsonService
|
private wpJsonService: WpJsonService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|||||||
@ -107,7 +107,7 @@ export class LoyaltyProgramService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getBalanceAmount(loyaltyPrograms: any[]) {
|
getBalanceAmount(loyaltyPrograms: any[]) {
|
||||||
return (loyaltyPrograms || []).reduce((accumulator, currentValue) => {
|
return (loyaltyPrograms || []).reduce((accumulator, currentValue) => {
|
||||||
return accumulator + currentValue.balance;
|
return accumulator + currentValue.balance;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user