Правки
This commit is contained in:
Kataev Denis 2022-09-23 10:49:23 +04:00
parent 534fdda325
commit baf5300439
12 changed files with 55 additions and 12 deletions

View File

@ -1,3 +1,7 @@
<span class="version">
v{{version}}
</span>
<div class="footer-buttons-container">
<!-- *ngIf="deferredPrompt && token?.length" -->
<button

View File

@ -31,6 +31,18 @@
}
}
.version {
position: fixed;
bottom: 16px;
left: 8px;
background: #09467f;
padding: 6px;
color: #fff;
border-radius: 4px;
font-weight: 100;
font-size: 12px;
}
@media (display-mode: standalone) {
.download {
display: none;

View File

@ -1,5 +1,6 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MessageService } from 'primeng/api';
import { environment } from 'src/environments/environment';
@Component({
selector: 'app-footer-buttons',
@ -13,6 +14,7 @@ export class FooterButtonsComponent implements OnInit {
@Output() downloadingPWA = new EventEmitter<null>();
@Output() requestingPermission = new EventEmitter<null>();
public deviceType: 'ios' | 'android' | null = null;
public version: string = environment.version;
constructor(
private messageService: MessageService,
@ -32,7 +34,8 @@ export class FooterButtonsComponent implements OnInit {
if (this.deviceType === 'ios') {
this.messageService.add({
severity: 'custom',
summary: "Для установки нажмите на кнопку поделиться в Вашем браузере и выберите пункт 'Добавить на главный экран'",
summary: `Для установки нажмите на кнопку поделиться в Вашем браузере и выберите пункт 'На экран «Домой»'`,
sticky: true
});
return
}

View File

@ -40,7 +40,7 @@
></p-progressSpinner>
</button>
</p>
<div class="decoration-pattern" style="background: url('./assets/card-decorative-pattern.png') repeat-x;"></div>
<div class="decoration-pattern" style="background: url('./assets/card-decorative-pattern.png') no-repeat;"></div>
</form>
</ng-container>
<ng-template #confirmPhoneField>
@ -89,6 +89,6 @@
<p style="color: red; margin: 0" *ngIf="errorConfirmCode">
Пароль введен неверно
</p>
<div class="decoration-pattern" style="background: url('./assets/card-decorative-pattern.png') repeat-x;"></div>
<div class="decoration-pattern" style="background: url('./assets/card-decorative-pattern.png') no-repeat;"></div>
</form>
</ng-template>

View File

@ -89,7 +89,7 @@
}
}
.decoration-pattern {
width: 100%;
width: calc(100% - 24px);
height: 34px;
}
}

View File

@ -17,10 +17,10 @@
<div class="info">
<div *ngIf="accountData" class="row">
<span class="key">Имя</span>
<span class="value" *ngIf="accountData.BonusProgramName">{{
accountData.BonusProgramName
<span class="value" *ngIf="userName.length">{{
userName
}}</span>
<span class="value" *ngIf="!accountData.BonusProgramName"
<span class="value" *ngIf="!userName.length"
>Не задано</span
>
</div>

View File

@ -21,6 +21,7 @@ export class BonusProgramComponent implements OnInit {
readonly moment = moment;
readonly pageList = environment.hasBonusProgram ? PageListWithBonus : PageList;
public currentPage: Page = this.pageList[1];
public userName: string = '';
constructor(
private jsonrpc: JsonrpcService,
@ -32,6 +33,19 @@ export class BonusProgramComponent implements OnInit {
async getAccountData(): Promise<void>{
this.loadingBonuses = true;
this.jsonrpc.rpc({
method: 'getAdditionalInfo',
params: []
}, RpcService.authService, true).subscribe({
next: (res) => {
this.userName = res.data.first_name
},
error: (err) => {
console.error('Error: ', err)
}
});
this.accountData = (await lastValueFrom(
this.jsonrpc.rpc({
method: 'GetAccounts',

View File

@ -1,3 +1,5 @@
import packageJson from '../../package.json';
export const environment = {
production: true,
appAuthEndpoint: 'https://testauth.crm4retail.ru/tnt',
@ -13,5 +15,6 @@ export const environment = {
storageBucket: "push-notification-test2-56dac.appspot.com",
messagingSenderId: "1004369687552",
appId: "1:1004369687552:web:a6cc20625e05520a37d4e5"
}
},
version: packageJson.version,
}

View File

@ -1,3 +1,5 @@
import packageJson from '../../package.json';
export const environment = {
production: false,
appAuthEndpoint: 'https://testauth.crm4retail.ru/tnt',
@ -13,5 +15,6 @@ export const environment = {
storageBucket: "push-notification-test2-56dac.appspot.com",
messagingSenderId: "1004369687552",
appId: "1:1004369687552:web:a6cc20625e05520a37d4e5"
}
},
version: packageJson.version,
};

View File

@ -40,7 +40,7 @@ button {
background-color: #fff;
border: solid #09467F;
border-width: 0 0 0 6px;
color: #09467F;
color: #000;
.p-toast-icon-close {
color: #09467F;
}

View File

@ -3,7 +3,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
"types": [],
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
},
"files": [
"src/main.ts",

View File

@ -21,7 +21,9 @@
"lib": [
"es2020",
"dom"
]
],
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,