dev #14384 Правка ошибок отображения WPA КофеЛайк: some fixes

This commit is contained in:
nikolay 2023-07-04 15:53:49 +04:00
parent 252433e197
commit 5f522bad47
3 changed files with 27 additions and 49 deletions

View File

@ -1,25 +1,20 @@
<h2>Ваш предыдущий заказ</h2> <h2>Ваш предыдущий заказ</h2>
<div class="info-order"> <div class="info-order">
<p class="flex"><span>Дата: </span> <ng-container *ngIf="lastOrder">
<span *ngIf="!loading">{{(lastOrder?.last_purchase_date) || 'Данные не найдены'}}</span> <p class="flex"><span>Дата: </span>
<ng-container *ngIf="loading"> <span *ngIf="!loading">{{lastOrder!.last_purchase_date}}</span>
<ng-container </p>
*ngTemplateOutlet="spinner; context: { $implicit: 24 }" <p class="flex"><span>На сумму: </span>
></ng-container> <span *ngIf="!loading">{{lastOrder?.last_purchase_sum}}</span>
</ng-container> </p>
</p> </ng-container>
<p class="flex"><span>На сумму: </span> <ng-container *ngIf="!lastOrder">
<span *ngIf="!loading">{{lastOrder ? lastOrder.last_purchase_sum + ' ₽' : 'Данные не найдены'}}</span> <p class="flex">
<ng-container *ngIf="loading"> <span>Данные не найдены</span>
<ng-container </p>
*ngTemplateOutlet="spinner; context: { $implicit: 24 }" </ng-container>
></ng-container>
</ng-container>
</p>
</div> </div>
<a href="https://promo.coffee-like.com/?utm_medium=prilozhenie"> <img src="./assets/970х250_3.png" alt="" width="100%" />
<img src="./assets/970х250_3.png" alt="" width="100%" />
</a>
<a href="https://yandex.ru/profile/151770398186" target="_blank"> <a href="https://yandex.ru/profile/151770398186" target="_blank">
<button class="evaluate-order">Оценить заказ</button> <button class="evaluate-order">Оценить заказ</button>
</a> </a>

View File

@ -20,28 +20,19 @@
></qr-code> ></qr-code>
</div> </div>
<div class="guest-card__user-description"> <div class="guest-card__user-description">
<p> <p>
<ng-container *ngIf="authService.currentLvlPeriod.end"> Осталось купить на сумму
Осталось купить на сумму <span class="price">{{
<span class="price">{{ authService.userInfo.next_level.sum_for_next_level
authService.userInfo.next_level.sum_for_next_level
}}</span> }}</span>
рублей, тогда кэшбек будет рублей, тогда кэшбек будет
<span class="percent" <span class="percent">{{ authService.userInfo.next_level.cashback }}%</span>
>{{ authService.getNextLevel().percent }}%</span с
> {{
с authService.currentPeriod[1]
{{ .locale("ru")
authService.currentPeriod[1] .format("D MMMM")
.locale("ru") }}
.format("D MMMM")
}}
</ng-container>
<ng-container *ngIf="!authService.currentLvlPeriod.end">
У Вас последний уровень бонусной программы. Процент начисляемых
бонусов:
{{ authService.currentLvlPeriod.percent }}%
</ng-container>
</p> </p>
</div> </div>
<span id="bonuses-condition"></span> <span id="bonuses-condition"></span>

View File

@ -60,7 +60,7 @@ export class AuthService {
) )
.subscribe({ .subscribe({
next: (value) => { next: (value) => {
if (value && value.customer_info && value.customer_info.errorCode === 'Customer_CustomerNotFound') { if (value && value.error && value.error.code === 11) {
this.wpJsonService.newCustomer( this.wpJsonService.newCustomer(
environment.systemId, environment.systemId,
token, 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[]) { getBalanceAmount(loyaltyPrograms: UserInfoWalletBalance[]) {
return (loyaltyPrograms || []).reduce((accumulator, currentValue) => { return (loyaltyPrograms || []).reduce((accumulator, currentValue) => {
if (currentValue.wallet.name !== 'Федеральная программа лояльности') { if (currentValue.wallet.name !== 'Федеральная программа лояльности') {