From 2fa05b391e3eef96165545e96abeb99812b34183 Mon Sep 17 00:00:00 2001 From: nikolay Date: Tue, 16 May 2023 15:38:21 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#14305=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD?= =?UTF-8?q?=D0=B0=20WPA=20=D0=9A=D0=BE=D1=84=D0=B5-=D0=BB=D0=B0=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0:=20change=20loyality=20program=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loyality-program.component.html | 74 ++++++++++--------- .../loyality-program.component.ts | 14 +++- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.html b/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.html index ece677d..4c7ba49 100644 --- a/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.html +++ b/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.html @@ -1,17 +1,49 @@ +

- Расчет начисления бонусов - 10% от суммы покупок за период с 11.01.2023г. - по 31.03.2023 г. + Ваш текущий уровень {{ loyaltyProgram.currentLvl }}, + поэтому вам начисляется {{ loyaltyProgram.currentLvlPeriod.percent }}% от суммы покупки.

- За период с 11.01.2023г. по 31.03.2023 г. сумма ваших покупок составила - 3700 руб. -

-

Начисляемый бонус 10% от суммы покупок

+ Смена уровня произойдет в начале следующего квартала, + {{ loyaltyProgram.purchaseData.currentPeriod[1] + .locale("ru") + .format("DD.MM.YY") }}. +

+ +

+ Начисление Бонусных баллов происходит по дифференцированной шкале в + зависимости от уровня: +

+ + + +
    + Уровень {{ index + 1 }} +
  • + Сумма покупок за прошлый квартал {{ item.start }}-{{ item.end }} + руб. +
  • +
  • Начисляемый бонус {{ item.percent }}% от суммы покупки
  • +
+
+
+ +
    + Уровень {{ index + 1 }} +
  • Сумма покупок за прошлый квартал — от {{ item.start }} руб.
  • +
  • Начисляемый бонус, в % от суммы покупки - {{ item.percent }}%
  • +
+
+
+
+

Участник может использовать Бонусы для «оплаты» до 100% стоимости любой @@ -67,35 +99,7 @@ - -

- Начисление Бонусных баллов происходит по дифференцированной шкале в - зависимости от уровня: -

- - - -
    - Уровень {{ index + 1 }} -
  • - Сумма покупок за предыдущий период {{ item.start }}-{{ item.end }} - руб. -
  • -
  • Начисляемый бонус {{ item.percent }}% от суммы покупки
  • -
-
-
- -
    - Уровень {{ index + 1 }} -
  • Сумма покупок за предыдущий период — от {{ item.start }} руб.
  • -
  • Начисляемый бонус, в % от суммы покупки - {{ item.percent }}%
  • -
-
-
-
+
diff --git a/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.ts b/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.ts index cd19f75..be71ac8 100644 --- a/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.ts +++ b/angular/src/app/presentation-options/default-option/pages/loyality-program/loyality-program.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Location } from '@angular/common'; import { lvlPeriod } from 'src/app/interface/data'; import { lvlPeriods } from 'src/app/app.constants'; +import { LoyaltyProgramService } from 'src/app/services/loyalty-program.service'; @Component({ selector: 'loyality-program', @@ -9,13 +10,20 @@ import { lvlPeriods } from 'src/app/app.constants'; styleUrls: ['./loyality-program.component.scss'], }) export class LoyalityProgramComponent implements OnInit { - constructor(private _location: Location) {} - + constructor( + private _location: Location, + public loyaltyProgram: LoyaltyProgramService, + ) {} + public lvlPeriods: lvlPeriod[] = lvlPeriods; goBack() { this._location.back(); } - ngOnInit(): void {} + ngOnInit(): void { + if(this.loyaltyProgram.currentLvlPeriod == null) { + this._location.back(); + } + } }