From 7a9f9fc8724fbeebafd6e4558b7b7cfcf829ca6c Mon Sep 17 00:00:00 2001 From: gofnnp Date: Thu, 30 Mar 2023 12:43:42 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#13951=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?=D1=83=20=D0=BD=D0=BE=D0=B2=D1=8B=D1=85=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus-program.component.html | 7 +- .../bonus-program/bonus-program.component.ts | 4 +- .../account/orders/orders.component.html | 1 + .../account/orders/orders.component.scss | 132 +++++++++--------- .../account/user-data/user-data.component.ts | 4 + 5 files changed, 78 insertions(+), 70 deletions(-) diff --git a/angular/src/app/pages/account/bonus-program/bonus-program.component.html b/angular/src/app/pages/account/bonus-program/bonus-program.component.html index 47fd786..1029867 100644 --- a/angular/src/app/pages/account/bonus-program/bonus-program.component.html +++ b/angular/src/app/pages/account/bonus-program/bonus-program.component.html @@ -17,12 +17,9 @@
Имя - {{ - userName + {{ + userName && userName.length ? userName : 'Не задано' }} - Не задано
Баланс карты diff --git a/angular/src/app/pages/account/bonus-program/bonus-program.component.ts b/angular/src/app/pages/account/bonus-program/bonus-program.component.ts index 3036daa..eed0adb 100644 --- a/angular/src/app/pages/account/bonus-program/bonus-program.component.ts +++ b/angular/src/app/pages/account/bonus-program/bonus-program.component.ts @@ -92,9 +92,9 @@ export class BonusProgramComponent implements OnInit { ); this.accountData = getAccount && getAccount['Cards'][0]; - this.bonuses = this.accountData.BonusProgramAccounts.reduce((previous, {Bonuses}) => { + this.bonuses = this.accountData.BonusProgramAccounts?.reduce((previous, {Bonuses}) => { return previous + Bonuses - }, 0) + }, 0) || this.accountData.Bonuses this.loadingBonuses = false; if (this.accountData) { barcode('#barcode') diff --git a/angular/src/app/pages/account/orders/orders.component.html b/angular/src/app/pages/account/orders/orders.component.html index 5bbef58..723eba1 100644 --- a/angular/src/app/pages/account/orders/orders.component.html +++ b/angular/src/app/pages/account/orders/orders.component.html @@ -81,6 +81,7 @@ >

Нет заказов diff --git a/angular/src/app/pages/account/orders/orders.component.scss b/angular/src/app/pages/account/orders/orders.component.scss index a2b302f..1ec3c11 100644 --- a/angular/src/app/pages/account/orders/orders.component.scss +++ b/angular/src/app/pages/account/orders/orders.component.scss @@ -1,70 +1,76 @@ .show-more-orders { - text-align: center; - cursor: pointer; - color: #09467f; - margin-top: 16px; + text-align: center; + cursor: pointer; + color: #09467f; + margin-top: 16px; } .woocommerce-MyAccount-content { - max-width: 400px; - margin-left: calc(50vw - 200px); + max-width: 400px; + margin-left: calc(50vw - 200px); } .woocommerce-orders-table { - border: 2px solid #dee2e6; - border-bottom: 0; - border-radius: 0.25rem; - border-collapse: separate; - text-align: left; - margin-top: 8px; + border: 2px solid #dee2e6; + border-bottom: 0; + border-radius: 0.25rem; + border-collapse: separate; + text-align: left; + margin-top: 8px; + width: 100%; + max-width: 400px; + margin-left: auto; + margin-right: auto; + thead { + display: none; + } + .woocommerce-orders-table { + &__cell { + padding: 0.7rem 1.5rem; + border-bottom: 2px solid #dee2e6; + text-align: right !important; + display: block; + &::before { + content: attr(data-title) ": "; + font-weight: 700; + float: left; + } + } + &__row { + display: block; + &:nth-child(even) { + background: #ebebeb; + } + } + // &__cell-order-actions::before { + // display: none; + // } + &__cell-order-actions { + &.red-color { + color: #ed0000; + } + &.green-color { + color: #00a700; + } + } + &__cell-order-number a { + text-decoration: none; + color: #009688; + } + } + + .woocommerce-button { + display: inline-block; + color: #ffffff; + background-color: #009688; + padding: 13px; + border-radius: 4px; + text-decoration: none; width: 100%; - max-width: 400px; - margin-left: auto; - margin-right: auto; - thead { - display: none; - } - .woocommerce-orders-table { - &__cell { - padding: 0.7rem 1.5rem; - border-bottom: 2px solid #dee2e6; - text-align: right!important; - display: block; - &::before { - content: attr(data-title) ": "; - font-weight: 700; - float: left; - } - } - &__row { - display: block; - &:nth-child(even) { - background: #ebebeb; - } - } - // &__cell-order-actions::before { - // display: none; - // } - &__cell-order-actions { - &.red-color { - color: #ed0000; - } - &.green-color { - color: #00a700 - } - } - &__cell-order-number a { - text-decoration: none; - color: #009688; - } - } - - .woocommerce-button { - display: inline-block; - color: #ffffff; - background-color: #009688; - padding: 13px; - border-radius: 4px; - text-decoration: none; - width: 100%; - text-align: center; - } + text-align: center; + } +} + +.no-orders { + width: 100%; + text-align: center; + margin-top: 16px; } \ No newline at end of file diff --git a/angular/src/app/pages/account/user-data/user-data.component.ts b/angular/src/app/pages/account/user-data/user-data.component.ts index 5998486..34282d0 100644 --- a/angular/src/app/pages/account/user-data/user-data.component.ts +++ b/angular/src/app/pages/account/user-data/user-data.component.ts @@ -34,6 +34,10 @@ export class UserDataComponent implements OnInit { params: [] }, RpcService.authService, true).subscribe({ next: (res) => { + if (res.code === 45) { + this.messageService.add({severity:'warn', summary:'Данные не найдены, заполните их на этой странице'}); + return + } if (!res.data) { this.messageService.add({severity:'error', summary:'Произошла ошибка, попробуйте позже'}); return