dev #14305 Изменение дизайна WPA Кофе-лайка: block user with no info

This commit is contained in:
nikolay 2023-05-17 11:42:50 +04:00
parent 2fa05b391e
commit c5e4f3c229
5 changed files with 19 additions and 16 deletions

View File

@ -1,10 +1,7 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MainComponent } from './pages/main/main.component';
import { GuestCardComponent } from './pages/guest-card/guest-card.component';
import { LoginComponent } from './pages/login/login.component';
import { AuthGuard } from './guards/auth-guard.guard';
import { LoyalityProgramComponent } from './pages/loyality-program/loyality-program.component';
const routes: Routes = [
{
@ -12,15 +9,7 @@ const routes: Routes = [
loadChildren: () => null as any,
// component: GuestCardComponent,
// canActivate: [AuthGuard]
},
{
path: 'login',
component: LoginComponent
},
{
path: 'loyality-program',
component: LoyalityProgramComponent,
}
},
// { path: '**', component: NotFoundComponent }
];

View File

@ -88,14 +88,19 @@
[lastOrder]="lastPurchase"
[loading]="loyaltyProgram.purchaseData.$loading"
></app-last-order>
<a class="guest-card__loyalty-program" routerLink="loyality-program"
<a class="guest-card__loyalty-program" routerLink="loyality-program"
>Подробнее о правилах <br />
Программы лояльности</a
>
</div>
<app-footer></app-footer>
</ng-container>
<ng-container *ngIf="this.loyaltyProgram.purchaseData.$loading || !customerInfo">
<ng-container *ngIf="!customerInfo && !loyaltyProgram.purchaseData.$loading">
<div class="not-found">
<p>Данные недоступны, попробуйте позже</p>
</div>
</ng-container>
<ng-container *ngIf="loyaltyProgram.purchaseData.$loading">
<ng-container
*ngTemplateOutlet="spinner; context: { $implicit: 85 }"
></ng-container>

View File

@ -206,6 +206,14 @@
.wrapper {
padding-top: 20px;
}
.not-found {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
}
}
app-accordion {

View File

@ -35,6 +35,7 @@ export class GuestCardComponent implements OnInit {
ngOnInit(): void {
const token = this.cookiesService.getItem('token');
this.loyaltyProgram.purchaseData.$loading = true;
this.wpJsonService
.getCustomerInfo(
environment.systemId,
@ -68,7 +69,7 @@ export class GuestCardComponent implements OnInit {
deleteToken(): void {
this.cookiesService.logout();
}
}
logout() {
const bottomSheet = this._bottomSheet.open(ExitComponent);

View File

@ -22,7 +22,7 @@ export class LoyaltyProgramService {
lastPeriod: [],
lastPurchases: [],
currentPurchases: [],
$loading: true,
$loading: false,
get currentAmount(): number {
const amount = this.currentPurchases.reduce(
(accumulator, currentValue) => {