dev #14607 Море. Правки по сайту: fix notification and auth new_customer

This commit is contained in:
nikolay 2023-06-29 15:35:34 +04:00
parent 7808270bb4
commit e640539d96
6 changed files with 26 additions and 31 deletions

View File

@ -7,7 +7,7 @@
<div *ngIf="showDropdown" class="backdrop" (click)="closeMenu()"></div>
<div *ngIf="showMenu" class="menu">
<button mat-button (click)="toggleMenu()">
<span class="material-icons" style="color: var(--background-color)">
<span class="material-icons" style="color: var(--text-color)">
more_horiz
</span>
</button>
@ -15,7 +15,7 @@
<div class="menu__dropdown" *ngIf="showDropdown">
<ul>
<menu-item [handler]="handler(aboutApp)">
<span class="material-icons icon" style="color: var(--background-color)">
<span class="material-icons icon" style="color: var(--main-color)">
info
</span>
<span class="item_title">О приложении</span>

View File

@ -4,14 +4,6 @@
<div class="logo">
<img src="./assets/LOGO3.svg" alt=""/>
</div>
<div *ngIf="authService.userInfo?.name" class="owner">
<span>Владелец карты</span>
<span class="name">{{authService.userInfo.name}}</span>
</div>
<div class="bonuses">
<span>Бонусы</span>
<span>{{authService.getBalanceAmount($any(authService.userInfo?.walletBalances))}}</span>
</div>
<div class="guest-card__qr" (click)="qrCodeClick()">
<qr-code
[value]="authService.userInfo?.phone?.substr(1) || 'Данные не найдены'"
@ -23,6 +15,14 @@
></qr-code>
<span class="qr-value">{{authService.userInfo?.phone}}</span>
</div>
<div *ngIf="authService.userInfo?.name" class="owner">
<span>Владелец карты</span>
<span class="name">{{authService.userInfo.name}}</span>
</div>
<div class="bonuses">
<span>Бонусы</span>
<span>{{authService.getBalanceAmount($any(authService.userInfo?.walletBalances))}}</span>
</div>
</div>
</ng-container>

View File

@ -229,9 +229,7 @@
font-style: italic;
}
.logo {
margin-bottom: 200px;
.logo {
img {
width: 40%;
}

View File

@ -69,18 +69,7 @@ export class AuthService {
)
.subscribe({
next: (value) => {
if (value && value.customer_info && value.customer_info.errorCode === 'Customer_CustomerNotFound') {
this.wpJsonService.newCustomer(
environment.systemId,
token,
environment.icardProxy,
)
.subscribe({
next: () => {
this.getUserInfo();
}
})
} else if (value && value.error && value.error.code > 1) {
if (value && value.error && value.error.code > 1) {
this.messageService.clear();
this.messageService.add({
severity: 'error',
@ -186,7 +175,17 @@ export class AuthService {
).subscribe({
next: () => {
this.router.navigate(['/']);
this.getUserInfo();
this.wpJsonService.newCustomer(
environment.systemId,
result?.data?.token,
environment.icardProxy,
)
.subscribe({
next: () => {
this.getUserInfo();
}
})
},
error: (err) => {
console.error(err);

View File

@ -1,6 +1,6 @@
{
"name": "Coffee Like More",
"short_name": "Coffee Like More",
"name": "More",
"short_name": "More",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",

View File

@ -245,14 +245,12 @@ input::-webkit-date-and-time-value {
text-align: left;
}
.p-toast-message-custom {
background-color: var(--background-color);
border: solid var(--main-color);
border-width: 0 0 0 6px;
color: var(--text-color);
.p-toast-icon-close {
.p-toast-icon-close {
color: var(--main-color);
}
}