Правки
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"> <div class="footer-buttons-container">
<!-- *ngIf="deferredPrompt && token?.length" --> <!-- *ngIf="deferredPrompt && token?.length" -->
<button <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) { @media (display-mode: standalone) {
.download { .download {
display: none; display: none;

View File

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

View File

@ -40,7 +40,7 @@
></p-progressSpinner> ></p-progressSpinner>
</button> </button>
</p> </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> </form>
</ng-container> </ng-container>
<ng-template #confirmPhoneField> <ng-template #confirmPhoneField>
@ -89,6 +89,6 @@
<p style="color: red; margin: 0" *ngIf="errorConfirmCode"> <p style="color: red; margin: 0" *ngIf="errorConfirmCode">
Пароль введен неверно Пароль введен неверно
</p> </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> </form>
</ng-template> </ng-template>

View File

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

View File

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

View File

@ -21,6 +21,7 @@ export class BonusProgramComponent implements OnInit {
readonly moment = moment; readonly moment = moment;
readonly pageList = environment.hasBonusProgram ? PageListWithBonus : PageList; readonly pageList = environment.hasBonusProgram ? PageListWithBonus : PageList;
public currentPage: Page = this.pageList[1]; public currentPage: Page = this.pageList[1];
public userName: string = '';
constructor( constructor(
private jsonrpc: JsonrpcService, private jsonrpc: JsonrpcService,
@ -32,6 +33,19 @@ export class BonusProgramComponent implements OnInit {
async getAccountData(): Promise<void>{ async getAccountData(): Promise<void>{
this.loadingBonuses = true; 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.accountData = (await lastValueFrom(
this.jsonrpc.rpc({ this.jsonrpc.rpc({
method: 'GetAccounts', method: 'GetAccounts',

View File

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

View File

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

View File

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

View File

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

View File

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