From 5f522bad47defc4bdf8214fba69a77cc116d8e8b Mon Sep 17 00:00:00 2001 From: nikolay Date: Tue, 4 Jul 2023 15:53:49 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#14384=20=D0=9F=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20WPA=20?= =?UTF-8?q?=D0=9A=D0=BE=D1=84=D0=B5=D0=9B=D0=B0=D0=B9=D0=BA:=20some=20fixe?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../last-order/last-order.component.html | 33 ++++++++----------- .../guest-card/guest-card.component.html | 33 +++++++------------ angular/src/app/services/auth.service.ts | 10 +----- 3 files changed, 27 insertions(+), 49 deletions(-) diff --git a/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.html b/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.html index ebf8614..76c943b 100644 --- a/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.html +++ b/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.html @@ -1,25 +1,20 @@

Ваш предыдущий заказ

-

Дата: - {{(lastOrder?.last_purchase_date) || 'Данные не найдены'}} - - - -

-

На сумму: - {{lastOrder ? lastOrder.last_purchase_sum + ' ₽' : 'Данные не найдены'}} - - - -

+ +

Дата: + {{lastOrder!.last_purchase_date}} +

+

На сумму: + {{lastOrder?.last_purchase_sum}} +

+
+ +

+ Данные не найдены +

+
- - - + diff --git a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.html b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.html index deb9226..e593ae2 100644 --- a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.html +++ b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.html @@ -20,28 +20,19 @@ >
-

- - Осталось купить на сумму - {{ - authService.userInfo.next_level.sum_for_next_level +

+ Осталось купить на сумму + {{ + authService.userInfo.next_level.sum_for_next_level }} - рублей, тогда кэшбек будет - {{ authService.getNextLevel().percent }}% - с - {{ - authService.currentPeriod[1] - .locale("ru") - .format("D MMMM") - }} - - - У Вас последний уровень бонусной программы. Процент начисляемых - бонусов: - {{ authService.currentLvlPeriod.percent }}% - + рублей, тогда кэшбек будет + {{ authService.userInfo.next_level.cashback }}% + с + {{ + authService.currentPeriod[1] + .locale("ru") + .format("D MMMM") + }}

diff --git a/angular/src/app/services/auth.service.ts b/angular/src/app/services/auth.service.ts index fb36b38..71e2c28 100644 --- a/angular/src/app/services/auth.service.ts +++ b/angular/src/app/services/auth.service.ts @@ -60,7 +60,7 @@ export class AuthService { ) .subscribe({ next: (value) => { - if (value && value.customer_info && value.customer_info.errorCode === 'Customer_CustomerNotFound') { + if (value && value.error && value.error.code === 11) { this.wpJsonService.newCustomer( environment.systemId, token, @@ -232,14 +232,6 @@ export class AuthService { } } - getNextLevel(): lvlPeriod { - if (this.userInfo?.next_level.next_level) { - return lvlPeriods[this.userInfo.next_level.next_level]; - } - - return lvlPeriods[0]; - } - getBalanceAmount(loyaltyPrograms: UserInfoWalletBalance[]) { return (loyaltyPrograms || []).reduce((accumulator, currentValue) => { if (currentValue.wallet.name !== 'Федеральная программа лояльности') {