Files
qr_vitanova/src/app/pages/create-page/create-page.html

152 lines
5.9 KiB
HTML
Raw Normal View History

2026-04-30 01:17:17 +04:00
<div class="page">
<div class="card">
<div class="card__header">
2026-05-07 23:33:02 +04:00
<h1 class="card__title">Оплата через СБП</h1>
2026-05-04 23:56:38 +04:00
<p class="card__subtitle">{{ 'create.subtitle' | translate }}</p>
2026-04-30 01:17:17 +04:00
</div>
<div class="card__body">
<!-- Payment methods -->
<div class="field">
2026-05-04 23:56:38 +04:00
<span class="field__label">{{ 'create.payment_label' | translate }}</span>
2026-04-30 01:17:17 +04:00
<div class="methods">
<button type="button" class="method" [class.method--active]="payment() === 'sbp'"
(click)="selectPayment('sbp', true)" aria-label="СБП">
<img class="method__logo"
src="https://sbp.nspk.ru/storage/settings/common/logo/0645d335-8b62-43a1-9a33-0d4c9d1dc0e0.svg"
alt="СБП" />
</button>
<button type="button" class="method method--disabled" disabled aria-label="WeChat Pay">
<img class="method__logo" src="/wechat-pay.svg" alt="WeChat Pay" />
</button>
2026-05-05 00:52:03 +04:00
<button type="button" class="method method--disabled" disabled aria-label="Alipay">
<img class="method__logo" src="/alipay.svg" alt="Alipay" />
</button>
2026-04-30 01:17:17 +04:00
<button type="button" class="method method--disabled" disabled aria-label="Visa">
<img class="method__logo" src="/visa.svg" alt="Visa" />
</button>
<button type="button" class="method method--disabled" disabled aria-label="MasterCard">
<img class="method__logo" src="/mastercard.svg" alt="Mastercard" />
</button>
</div>
</div>
<!-- Currencies -->
<div class="field">
2026-05-04 23:56:38 +04:00
<span class="field__label">{{ 'create.currency_label' | translate }}</span>
2026-04-30 01:17:17 +04:00
<div class="currencies">
<button type="button" class="chip" [class.chip--active]="currency() === 'RUB'"
(click)="selectCurrency('RUB', true)">
<span class="chip__sign"></span>
<span class="chip__code">RUB</span>
</button>
<button type="button" class="chip chip--disabled" disabled>
<span class="chip__sign">¥</span>
<span class="chip__code">CNY</span>
</button>
<button type="button" class="chip chip--disabled" disabled>
<span class="chip__sign">$</span>
<span class="chip__code">USD</span>
</button>
<button type="button" class="chip chip--disabled" disabled>
<span class="chip__sign"></span>
<span class="chip__code">EUR</span>
</button>
<button type="button" class="chip chip--disabled" disabled>
<span class="chip__sign">֏</span>
<span class="chip__code">AMD</span>
</button>
</div>
</div>
<div class="field">
2026-05-04 23:56:38 +04:00
<label class="field__label" for="amount">{{ 'create.amount_label' | translate }}</label>
2026-04-30 01:17:17 +04:00
<div class="input-wrap" [class.input-wrap--error]="error()">
<span class="input-wrap__prefix"></span>
<input
id="amount"
type="number"
class="input-wrap__input"
[ngModel]="amount()"
(ngModelChange)="onAmountChange($event)"
2026-05-05 00:52:03 +04:00
[min]="minAmount()"
[max]="maxAmount()"
2026-04-30 01:17:17 +04:00
step="1"
inputmode="numeric"
placeholder="0"
autofocus
/>
</div>
2026-05-05 00:52:03 +04:00
<span class="field__hint">{{ 'create.amount_hint' | translate }} {{ minAmount() }}{{ maxAmount().toLocaleString('ru') }} ₽</span>
2026-04-30 01:17:17 +04:00
@if (error()) {
<span class="field__error">{{ error() }}</span>
}
</div>
<div class="field">
2026-05-04 23:56:38 +04:00
<label class="field__label" for="note">{{ 'create.note_label' | translate }}</label>
2026-04-30 01:17:17 +04:00
<textarea
id="note"
class="note-input"
[ngModel]="note()"
(ngModelChange)="onNoteChange($event)"
2026-05-04 23:56:38 +04:00
[placeholder]="'create.note_placeholder' | translate"
2026-05-07 00:13:45 +04:00
rows="2"
2026-04-30 01:17:17 +04:00
maxlength="500"
></textarea>
</div>
2026-05-05 00:52:03 +04:00
<button class="pay-btn" type="button" (click)="createCheck()" [disabled]="loading() || qrImageUrl() !== null">
2026-04-30 01:17:17 +04:00
<span class="pay-btn__icon">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 5v14M5 12h14" />
</svg>
</span>
2026-04-30 14:51:32 +04:00
@if (loading()) {
2026-05-04 23:56:38 +04:00
{{ 'create.creating' | translate }}
2026-04-30 14:51:32 +04:00
} @else {
2026-05-07 23:33:02 +04:00
{{ 'create.create_btn' | translate }}
2026-04-30 14:51:32 +04:00
}
2026-04-30 01:17:17 +04:00
</button>
2026-05-05 00:52:03 +04:00
<!-- QR popup overlay -->
2026-06-01 15:33:23 +04:00
@if (qrImageUrl()) {
<div class="qr-overlay" (click)="closeQr()">
<div class="qr-modal" (click)="$event.stopPropagation()">
<button class="qr-modal__close" type="button" (click)="closeQr()" aria-label="Close">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 6L6 18M6 6l12 12"/>
</svg>
</button>
<p class="qr-modal__label">{{ 'create.qr_label' | translate }}</p>
<img class="qr-modal__img" [src]="qrImageUrl()!" width="260" height="260" alt="QR" />
2026-05-05 11:53:52 +04:00
@if (qrStatus()) {
<span class="qr-modal__status">{{ qrStatus() }}</span>
}
@if (qrPolling()) {
<p class="qr-modal__hint">{{ 'create.qr_waiting' | translate }}</p>
2026-05-05 00:52:03 +04:00
}
2026-05-07 00:13:45 +04:00
@if (paymentDone()) {
<p class="qr-modal__hint qr-modal__hint--done">{{ 'create.payment_done' | translate }}</p>
}
2026-04-30 01:17:17 +04:00
</div>
</div>
}
</div>
2026-04-30 01:17:17 +04:00
<div class="card__footer">
<span class="secure-badge">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
</svg>
2026-05-04 23:56:38 +04:00
{{ 'common.secure' | translate }}
2026-04-30 01:17:17 +04:00
</span>
</div>
</div>
</div>