@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
export interface FastcheckData {
|
export interface FastcheckData {
|
||||||
fastcheck: string;
|
fastcheck: string;
|
||||||
amount: number;
|
amount: number | null;
|
||||||
code: string;
|
code: string;
|
||||||
expiration?: string;
|
expiration?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export class CreatePage {
|
|||||||
minAmount = signal<number>(30);
|
minAmount = signal<number>(30);
|
||||||
maxAmount = signal<number>(200_000);
|
maxAmount = signal<number>(200_000);
|
||||||
|
|
||||||
amount = signal<number>(100);
|
amount = signal<number | null>(null);
|
||||||
note = signal<string>('');
|
note = signal<string>('');
|
||||||
error = signal<string>('');
|
error = signal<string>('');
|
||||||
loading = signal<boolean>(false);
|
loading = signal<boolean>(false);
|
||||||
@@ -122,11 +122,11 @@ export class CreatePage {
|
|||||||
|
|
||||||
createCheck(): void {
|
createCheck(): void {
|
||||||
const val = this.amount();
|
const val = this.amount();
|
||||||
if (!val || val < this.minAmount()) {
|
if (val !== null && val < this.minAmount()) {
|
||||||
this.error.set(`${this.t('errors.invalid_amount')} (мин. ${this.minAmount()} ₽)`);
|
this.error.set(`${this.t('errors.invalid_amount')} (мин. ${this.minAmount()} ₽)`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (val > this.maxAmount()) {
|
if (val !== null && val > this.maxAmount()) {
|
||||||
this.error.set(`${this.t('errors.invalid_amount')} (макс. ${this.maxAmount().toLocaleString('ru')} ₽)`);
|
this.error.set(`${this.t('errors.invalid_amount')} (макс. ${this.maxAmount().toLocaleString('ru')} ₽)`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ export class CreatePage {
|
|||||||
`${QR_VITANOVA_API}/qr`,
|
`${QR_VITANOVA_API}/qr`,
|
||||||
{
|
{
|
||||||
qrtype: 'QRDynamic',
|
qrtype: 'QRDynamic',
|
||||||
amount: val,
|
...(val !== null ? { amount: val } : {}),
|
||||||
currency: this.currency(),
|
currency: this.currency(),
|
||||||
partnerqrID,
|
partnerqrID,
|
||||||
qrDescription: this.note().trim(),
|
qrDescription: this.note().trim(),
|
||||||
@@ -225,7 +225,7 @@ export class CreatePage {
|
|||||||
this.store.setCreated({
|
this.store.setCreated({
|
||||||
fastcheck: res.fastcheck,
|
fastcheck: res.fastcheck,
|
||||||
code: res.code,
|
code: res.code,
|
||||||
amount: this.amount(),
|
amount: this.amount() ?? null,
|
||||||
expiration: res.expiration
|
expiration: res.expiration
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -235,9 +235,9 @@ export class CreatePage {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onAmountChange(value: number): void {
|
onAmountChange(value: number | null): void {
|
||||||
this.amount.set(value);
|
this.amount.set(value || null);
|
||||||
if (value > 0) this.error.set('');
|
if (value && value > 0) this.error.set('');
|
||||||
}
|
}
|
||||||
|
|
||||||
onNoteChange(value: string): void {
|
onNoteChange(value: string): void {
|
||||||
|
|||||||
@@ -55,27 +55,27 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Share row — shown once amount is known -->
|
<!-- Share row — always visible, enabled once amount is known -->
|
||||||
@if (fastcheckAmount() !== null && !amountLoading()) {
|
<div class="share-row">
|
||||||
<div class="share-row">
|
<button type="button" class="share-btn share-btn--email" (click)="shareByEmail()"
|
||||||
<button type="button" class="share-btn share-btn--email" (click)="shareByEmail()"
|
[disabled]="fastcheckAmount() === null || amountLoading()"
|
||||||
[title]="'fastcheck.share_email' | translate">
|
[title]="'fastcheck.share_email' | translate">
|
||||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
<rect x="2" y="4" width="20" height="16" rx="2"/>
|
<rect x="2" y="4" width="20" height="16" rx="2"/>
|
||||||
<path d="M2 7l10 7 10-7"/>
|
<path d="M2 7l10 7 10-7"/>
|
||||||
</svg>
|
</svg>
|
||||||
{{ 'fastcheck.share_email' | translate }}
|
{{ 'fastcheck.share_email' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="share-btn share-btn--tg" (click)="shareByTelegram()"
|
<button type="button" class="share-btn share-btn--tg" (click)="shareByTelegram()"
|
||||||
[title]="'fastcheck.share_tg' | translate">
|
[disabled]="fastcheckAmount() === null || amountLoading()"
|
||||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
[title]="'fastcheck.share_tg' | translate">
|
||||||
<path d="M9.04 15.65l-.36 4.06c.51 0 .73-.22.99-.48l2.38-2.27 4.93 3.6c.9.5 1.55.24 1.79-.83l3.24-15.18h.01c.29-1.34-.48-1.86-1.36-1.54L1.13 9.66c-1.32.5-1.3 1.23-.22 1.56l4.92 1.53L17.27 5.6c.54-.34 1.03-.15.62.19"/>
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
||||||
</svg>
|
<path d="M9.04 15.65l-.36 4.06c.51 0 .73-.22.99-.48l2.38-2.27 4.93 3.6c.9.5 1.55.24 1.79-.83l3.24-15.18h.01c.29-1.34-.48-1.86-1.36-1.54L1.13 9.66c-1.32.5-1.3 1.23-.22 1.56l4.92 1.53L17.27 5.6c.54-.34 1.03-.15.62.19"/>
|
||||||
{{ 'fastcheck.share_tg' | translate }}
|
</svg>
|
||||||
</button>
|
{{ 'fastcheck.share_tg' | translate }}
|
||||||
</div>
|
</button>
|
||||||
}
|
</div>
|
||||||
|
|
||||||
<!-- Code -->
|
<!-- Code -->
|
||||||
<div class="field">
|
<div class="field">
|
||||||
|
|||||||
@@ -40,6 +40,12 @@
|
|||||||
border-color: #bfdbfe;
|
border-color: #bfdbfe;
|
||||||
&:hover { background: #dbeafe; border-color: #93c5fd; }
|
&:hover { background: #dbeafe; border-color: #93c5fd; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
opacity: .4;
|
||||||
|
cursor: not-allowed;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
|
|||||||
Reference in New Issue
Block a user