dev #14384 Правка ошибок отображения WPA КофеЛайк: fix last purchase
This commit is contained in:
parent
7fa882e423
commit
8ea4a41786
@ -6,7 +6,6 @@ import { MessageService } from 'primeng/api';
|
|||||||
import { MessagingService } from 'src/app/services/messaging.service';
|
import { MessagingService } from 'src/app/services/messaging.service';
|
||||||
import { DeviceType, getTypeDevice } from 'src/app/utils';
|
import { DeviceType, getTypeDevice } from 'src/app/utils';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
import { ResponseError } from 'src/app/interface/data';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-guest-card',
|
selector: 'app-guest-card',
|
||||||
@ -36,6 +35,8 @@ export class GuestCardComponent implements OnInit {
|
|||||||
this.negativeBalance = !Array.isArray(this.authService.userInfo?.walletBalances);
|
this.negativeBalance = !Array.isArray(this.authService.userInfo?.walletBalances);
|
||||||
this.showBack = getTypeDevice() === DeviceType.android;
|
this.showBack = getTypeDevice() === DeviceType.android;
|
||||||
|
|
||||||
|
this.authService.getLastPurchase();
|
||||||
|
|
||||||
this.requestPermission();
|
this.requestPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,7 @@ export class AuthService {
|
|||||||
});
|
});
|
||||||
} else if (value && value.customer_info) {
|
} else if (value && value.customer_info) {
|
||||||
this.userInfo = 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?.slice(2));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -244,12 +244,14 @@ export class AuthService {
|
|||||||
return this.userInfo && lvlPeriods[this.userInfo?.customer_level] || lvlPeriods[0];
|
return this.userInfo && lvlPeriods[this.userInfo?.customer_level] || lvlPeriods[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
getLastPurchase(userInfo: UserInfo) {
|
getLastPurchase() {
|
||||||
this.wpJsonService.getLastPurchase(environment.systemId, this.token!).subscribe({
|
if(this.userInfo) {
|
||||||
next: (res) => {
|
this.wpJsonService.getLastPurchase(environment.systemId, this.token!).subscribe({
|
||||||
this.purchaseData.lastPurchase = res[userInfo.id][0];
|
next: (res) => {
|
||||||
},
|
this.purchaseData.lastPurchase = res[this.userInfo!.id][0];
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getBalanceAmount(loyaltyPrograms: UserInfoWalletBalance[]) {
|
getBalanceAmount(loyaltyPrograms: UserInfoWalletBalance[]) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user