Merge branch 'coffee-like-test' of https://git.hlcompany.ru/git/usersite into coffee-like-test
This commit is contained in:
commit
04884bd0d9
@ -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 }
|
||||
];
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -206,6 +206,14 @@
|
||||
.wrapper {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.not-found {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
app-accordion {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -22,7 +22,7 @@ export class LoyaltyProgramService {
|
||||
lastPeriod: [],
|
||||
lastPurchases: [],
|
||||
currentPurchases: [],
|
||||
$loading: true,
|
||||
$loading: false,
|
||||
get currentAmount(): number {
|
||||
const amount = this.currentPurchases.reduce(
|
||||
(accumulator, currentValue) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user