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 0122aa8..0256b05 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,6 +1,6 @@ -

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

+

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

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

@@ -10,7 +10,7 @@

- Данные не найдены + Покупок за последние пол года не было

diff --git a/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss b/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss index d63ac59..17a71b3 100644 --- a/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss +++ b/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss @@ -1,51 +1,50 @@ :host { - padding: 24px 16px 0px; + padding: 24px 16px 0px; - & > h2 { - font-style: normal; - font-weight: 700; - font-size: 15px; - line-height: 20px; - letter-spacing: -0.24px; - } - - & > .info-order { - font-style: normal; - font-weight: 400; - font-size: 12px; - line-height: 16px; - span { - color: var(--text-color_1); + & > .info-order { + font-style: normal; + font-weight: 400; + font-size: 12px; + line-height: 16px; + h2 { + font-style: normal; + font-weight: 700; + font-size: 15px; + line-height: 20px; + letter-spacing: -0.24px; + } + span { + color: var(--text-color_1); + } + .flex { + display: flex; + align-items: center; + flex-direction: row; + gap: 8px; + } } - .flex { - display: flex; - align-items: center; - flex-direction: row; - gap: 8px; + + .evaluate-order { + margin: 24px 0; + width: 100%; + padding: 12px; + text-align: center; + border: 2px solid var(--button-color); + border-radius: 6px; + font-style: normal; + font-weight: 700; + font-size: 17px; + line-height: 22px; + letter-spacing: -0.408px; + background-color: transparent; + color: var(--button-color); } - } - .evaluate-order { - margin: 24px 0; - width: 100%; - padding: 12px; - text-align: center; - border: 2px solid var(--button-color); - border-radius: 6px; - font-style: normal; - font-weight: 700; - font-size: 17px; - line-height: 22px; - letter-spacing: -0.408px; - background-color: transparent; - color: var(--button-color); - } - - .info { - font-style: normal; - font-weight: 400; - font-size: 12px; - line-height: 16px; - color: var(--text-color_1); - } + .info { + font-style: normal; + font-weight: 400; + font-size: 12px; + line-height: 16px; + color: var(--text-color_1); + } } 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 e593ae2..c893901 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 @@ -3,17 +3,24 @@
-

Уровень {{ authService.userInfo.current_level_and_cashback?.current_level ?? '--' }}

-

Кэшбек {{ authService.currentLvlPeriod.percent }}%

+

Уровень {{ authService.error ? '--' : authService.userInfo.current_level_and_cashback?.current_level }}

+

Кэшбек {{ authService.error ? '--' : authService.currentLvlPeriod.percent }}%

-

- {{ Math.floor(authService.userInfo.walletBalances) }} - бонусов -

+ +

+ Отрицательный баланс бонусов, свяжитесь с техподдержкой +

+
+ +

+ {{ authService.error ? '--' : Math.floor(authService.userInfo.walletBalances) }} + бонусов +

+
Осталось купить на сумму {{ - authService.userInfo.next_level.sum_for_next_level + authService.error ? '--' : authService.userInfo.next_level.sum_for_next_level }} рублей, тогда кэшбек будет - {{ authService.userInfo.next_level.cashback }}% + {{ authService.error ? '--' : authService.userInfo.next_level.cashback}}% с {{ authService.currentPeriod[1] @@ -35,15 +42,28 @@ }}

- - - Подробнее о правилах
- Программы лояльности
+ + + + + + Подробнее о правилах +
+ Программы лояльности +
+
+ + +

+ Упс, что-то пошло не так.. + Мы уже работаем над этой проблемой. + Попробуйте обновить страницу или зайти попозже. + Приносим извинения за неудобства. +

+
diff --git a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts index 9f34845..ee3ac2b 100644 --- a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts +++ b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts @@ -17,6 +17,7 @@ export class GuestCardComponent implements OnInit { private isQrCodeClicked: boolean = false; public Math: Math = Math; public showBack: boolean = false; + public phone?: string; constructor( private _bottomSheet: MatBottomSheet, @@ -29,6 +30,8 @@ export class GuestCardComponent implements OnInit { ngOnInit(): void { this.showBack = getTypeDevice() === DeviceType.android; + this.phone = this.cookiesService.getItem('phone-number') || this.authService.userInfo?.phone; + this.requestPermission(); } diff --git a/angular/src/app/services/auth.service.ts b/angular/src/app/services/auth.service.ts index 71e2c28..389418e 100644 --- a/angular/src/app/services/auth.service.ts +++ b/angular/src/app/services/auth.service.ts @@ -17,7 +17,7 @@ export class AuthService { currentPeriod: Moment[] = []; userInfo?: UserInfo; loading: boolean = false; - error: any; + error?: any; timeLeft: number = 0; get currentLvlPeriod(): lvlPeriod { @@ -50,6 +50,7 @@ export class AuthService { return; } + this.error = null; this.loading = true; this.wpJsonService @@ -60,6 +61,7 @@ export class AuthService { ) .subscribe({ next: (value) => { + this.userInfo = value.customer_info; if (value && value.error && value.error.code === 11) { this.wpJsonService.newCustomer( environment.systemId, @@ -72,15 +74,14 @@ export class AuthService { } }) } else if (value && value.error && value.error.code > 1) { + this.error = value.error; this.messageService.clear(); this.messageService.add({ severity: 'error', summary: 'Произошла ошибка! Попробуйте позже', }); } else if (value && value.customer_info) { - this.userInfo = value.customer_info; - - this.cookiesService.setCookie('phone-number', this.userInfo!.phone?.slice(2)); + this.cookiesService.setCookie('phone-number', this.userInfo!.phone); } }, error: (e) => { diff --git a/angular/src/assets/broken.jpg b/angular/src/assets/broken.jpg new file mode 100644 index 0000000..7f835e5 Binary files /dev/null and b/angular/src/assets/broken.jpg differ