dev #14384 Правка ошибок отображения WPA КофеЛайк: show info when wallet balance is negative
This commit is contained in:
parent
3ff34525ed
commit
03771d2012
@ -206,5 +206,10 @@ export interface UserInfo {
|
|||||||
id: string;
|
id: string;
|
||||||
name: string | null;
|
name: string | null;
|
||||||
phone: string;
|
phone: string;
|
||||||
walletBalances: UserInfoWalletBalance[];
|
walletBalances: UserInfoWalletBalance[] | { error: ResponseError };
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResponseError {
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,13 @@
|
|||||||
<p id="level-percent">Кэшбек {{ authService.currentLvlPeriod.percent }}%</p>
|
<p id="level-percent">Кэшбек {{ authService.currentLvlPeriod.percent }}%</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="top-info__bonus">
|
<p class="top-info__bonus">
|
||||||
{{ Math.floor(authService.getBalanceAmount(authService.userInfo.walletBalances)) }}
|
<ng-container *nfIf="!isNegativebalance">
|
||||||
бонусов
|
{{ Math.floor(authService.getBalanceAmount($any(authService.userInfo.walletBalances))) }}
|
||||||
|
бонусов
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="isNegativeBalance">
|
||||||
|
Ошибка! Отрицательный баланс бонусов
|
||||||
|
</ng-container>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="guest-card__qr" (click)="qrCodeClick()">
|
<div class="guest-card__qr" (click)="qrCodeClick()">
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { MessageService } from 'primeng/api';
|
|||||||
import { MessagingService } from 'src/app/services/messaging.service';
|
import { MessagingService } from 'src/app/services/messaging.service';
|
||||||
import { DeviceType, getTypeDevice } from 'src/app/utils';
|
import { DeviceType, getTypeDevice } from 'src/app/utils';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { ResponseError } from 'src/app/interface/data';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-guest-card',
|
selector: 'app-guest-card',
|
||||||
@ -17,6 +18,11 @@ export class GuestCardComponent implements OnInit {
|
|||||||
private isQrCodeClicked: boolean = false;
|
private isQrCodeClicked: boolean = false;
|
||||||
public Math: Math = Math;
|
public Math: Math = Math;
|
||||||
public showBack: boolean = false;
|
public showBack: boolean = false;
|
||||||
|
public negativeBalance: boolean = false;
|
||||||
|
|
||||||
|
get isNegativeBalance(): boolean {
|
||||||
|
return !Array.isArray(this.authService.userInfo?.walletBalances);
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private _bottomSheet: MatBottomSheet,
|
private _bottomSheet: MatBottomSheet,
|
||||||
@ -27,6 +33,7 @@ export class GuestCardComponent implements OnInit {
|
|||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.negativeBalance = !Array.isArray(this.authService.userInfo?.walletBalances);
|
||||||
this.showBack = getTypeDevice() === DeviceType.android;
|
this.showBack = getTypeDevice() === DeviceType.android;
|
||||||
|
|
||||||
this.requestPermission();
|
this.requestPermission();
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
nikolay@arch.6700:1687496762
|
|
||||||
@ -4,7 +4,7 @@ import { WpJsonService } from './wp-json.service';
|
|||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { JsonrpcService, RpcService } from './jsonrpc.service';
|
import { JsonrpcService, RpcService } from './jsonrpc.service';
|
||||||
import { MessageService } from 'primeng/api';
|
import { MessageService } from 'primeng/api';
|
||||||
import { UserInfo, Purchase, lvlPeriod, UserInfoWalletBalance } from '../interface/data';
|
import { UserInfo, Purchase, lvlPeriod, UserInfoWalletBalance, ResponseError } from '../interface/data';
|
||||||
import { lvlPeriods } from 'src/app/app.constants';
|
import { lvlPeriods } from 'src/app/app.constants';
|
||||||
import moment, { Moment } from 'moment-timezone';
|
import moment, { Moment } from 'moment-timezone';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user