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

178 lines
6.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-04-30 14:51:32 +04:00
<img class="card__brand" src="/logo_big.png"
alt="fastCHECK" width="220" height="60" />
<p class="card__subtitle">
2026-05-04 23:56:38 +04:00
{{ 'fastcheck.subtitle' | translate }}
2026-04-30 14:51:32 +04:00
</p>
2026-04-30 01:17:17 +04:00
</div>
<div class="card__body">
<!-- Fastcheck number + new -->
<div class="field">
2026-04-30 14:51:32 +04:00
<label class="field__label" for="fcNumber">
2026-05-04 23:56:38 +04:00
{{ 'fastcheck.number_label' | translate }}
2026-04-30 14:51:32 +04:00
</label>
2026-04-30 01:17:17 +04:00
<div class="row">
<input
id="fcNumber"
type="text"
class="input"
[ngModel]="fastcheckNumber()"
2026-04-30 15:00:24 +04:00
(ngModelChange)="onNumberChange($event)"
2026-05-04 23:56:38 +04:00
[placeholder]="'fastcheck.number_placeholder' | translate"
2026-04-30 01:17:17 +04:00
inputmode="numeric"
autocomplete="off"
2026-05-05 00:52:03 +04:00
maxlength="20"
2026-04-30 01:17:17 +04:00
/>
2026-05-04 23:56:38 +04:00
<a class="btn btn--ghost" routerLink="/new" aria-label="Создать новый fastCHECK">{{ 'fastcheck.number_new' | translate }}</a>
2026-04-30 01:17:17 +04:00
</div>
</div>
<!-- Amount -->
<div class="field">
2026-05-04 23:56:38 +04:00
<label class="field__label" for="fcAmount">{{ 'fastcheck.amount_label' | translate }}</label>
2026-04-30 01:17:17 +04:00
<div class="input-wrap">
<span class="input-wrap__prefix"></span>
<input
id="fcAmount"
type="number"
class="input-wrap__input"
[ngModel]="fastcheckAmount()"
(ngModelChange)="onAmountChange($event)"
min="1"
step="1"
inputmode="numeric"
placeholder="0"
2026-05-05 00:52:03 +04:00
[disabled]="true"
2026-04-30 01:17:17 +04:00
/>
</div>
2026-04-30 15:00:24 +04:00
@if (amountLoading()) {
2026-05-04 23:56:38 +04:00
<span class="field__hint">{{ 'fastcheck.amount_checking' | translate }}</span>
2026-04-30 15:00:24 +04:00
}
2026-04-30 01:17:17 +04:00
</div>
<!-- Share row — always visible, enabled once amount is known -->
<div class="share-row">
2026-05-06 13:17:54 +04:00
<!-- <button type="button" class="share-btn share-btn--email" (click)="shareByEmail()"
[disabled]="fastcheckAmount() === null || amountLoading()"
[title]="'fastcheck.share_email' | translate">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="4" width="20" height="16" rx="2"/>
<path d="M2 7l10 7 10-7"/>
</svg>
{{ 'fastcheck.share_email' | translate }}
2026-05-06 13:17:54 +04:00
</button> -->
<button type="button" class="share-btn share-btn--tg" (click)="shareByTelegram()"
[disabled]="fastcheckAmount() === null || amountLoading()"
[title]="'fastcheck.share_tg' | translate">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<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>
{{ 'fastcheck.share_tg' | translate }}
</button>
</div>
2026-05-05 00:52:03 +04:00
2026-04-30 01:17:17 +04:00
<!-- Code -->
<div class="field">
2026-05-04 23:56:38 +04:00
<label class="field__label" for="fcCode">{{ 'fastcheck.code_label' | translate }}</label>
2026-04-30 01:17:17 +04:00
<input
id="fcCode"
type="text"
class="input"
[ngModel]="fastcheckCode()"
2026-04-30 15:00:24 +04:00
(ngModelChange)="onCodeChange($event)"
2026-05-04 23:56:38 +04:00
[placeholder]="'fastcheck.code_placeholder' | translate"
2026-04-30 01:17:17 +04:00
inputmode="numeric"
2026-05-05 00:52:03 +04:00
maxlength="6"
2026-04-30 01:17:17 +04:00
autocomplete="one-time-code"
2026-05-05 00:52:03 +04:00
[disabled]="!codeEnabled()"
2026-04-30 01:17:17 +04:00
/>
@if (error()) {
<span class="field__error">{{ error() }}</span>
}
</div>
2026-04-30 15:00:24 +04:00
<button class="pay-btn" type="button" (click)="pay()" [disabled]="!canPay()">
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">
<rect x="1" y="4" width="22" height="16" rx="2" ry="2" />
<line x1="1" y1="10" x2="23" y2="10" />
</svg>
</span>
2026-05-04 23:56:38 +04:00
{{ 'fastcheck.pay_btn' | translate }}
2026-04-30 01:17:17 +04:00
</button>
</div>
<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>
<!-- Telegram sign-in popup -->
@if (popupOpen()) {
<div class="modal" (click)="closePopup()">
<div class="modal__card" (click)="$event.stopPropagation()">
<button class="modal__close" type="button" (click)="closePopup()" aria-label="Закрыть">×</button>
@if (paid()) {
<div class="modal__success">
<svg width="56" height="56" viewBox="0 0 24 24" fill="none" stroke="#16a34a"
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 6L9 17l-5-5" />
</svg>
2026-05-04 23:56:38 +04:00
<h2 class="modal__title">{{ 'fastcheck.modal_paid_title' | translate }}</h2>
2026-04-30 14:51:32 +04:00
<p class="modal__sub">
<span class="brand"><span class="brand__fast">fast</span><span class="brand__check">CHECK</span></span>
2026-05-04 23:56:38 +04:00
{{ 'fastcheck.modal_paid_sub' | translate }}
2026-04-30 14:51:32 +04:00
</p>
2026-04-30 01:17:17 +04:00
</div>
} @else {
2026-04-30 14:51:32 +04:00
<img class="brand-logo brand-logo--small" src="/logo_small.png"
alt="fastCHECK" width="32" height="32" />
2026-05-04 23:56:38 +04:00
<h2 class="modal__title">{{ 'fastcheck.modal_title' | translate }}</h2>
<p class="modal__sub">{{ 'fastcheck.modal_sub' | translate }}</p>
2026-04-30 01:17:17 +04:00
<div class="qr">
@if (popupLoading() && !webSessionId()) {
2026-05-04 23:56:38 +04:00
<div class="qr__placeholder">{{ 'fastcheck.modal_loading' | translate }}</div>
2026-04-30 01:17:17 +04:00
} @else if (webSessionId()) {
<img [src]="qrUrl()" width="240" height="240" alt="QR Telegram" />
}
</div>
@if (webSessionId()) {
<a class="tg-link" [href]="telegramLink()" target="_blank" rel="noopener">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor">
<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>
2026-05-04 23:56:38 +04:00
{{ 'fastcheck.modal_open_tg' | translate }}
2026-04-30 01:17:17 +04:00
</a>
}
@if (popupLoading() && webSessionId()) {
2026-05-04 23:56:38 +04:00
<p class="modal__hint">{{ 'fastcheck.modal_confirming' | translate }}</p>
2026-04-30 01:17:17 +04:00
} @else if (webSessionId()) {
2026-05-04 23:56:38 +04:00
<p class="modal__hint">{{ 'fastcheck.modal_waiting' | translate }}</p>
2026-04-30 01:17:17 +04:00
}
@if (popupError()) {
<p class="modal__error">{{ popupError() }}</p>
}
}
</div>
</div>
}