Compare commits

..

2 Commits

Author SHA1 Message Date
98423be0c3 link
Co-authored-by: Copilot <copilot@github.com>
2026-05-06 17:37:55 +04:00
1d19ddd47c link
Co-authored-by: Copilot <copilot@github.com>
2026-05-06 17:27:18 +04:00
4 changed files with 25 additions and 17 deletions

View File

@@ -145,13 +145,13 @@
<h2 class="modal__title">{{ 'fastcheck.modal_title' | translate }}</h2>
<p class="modal__sub">{{ 'fastcheck.modal_sub' | translate }}</p>
<div class="qr">
@if (popupLoading() && !webSessionId()) {
<div class="qr__placeholder">{{ 'fastcheck.modal_loading' | translate }}</div>
} @else if (webSessionId()) {
<img [src]="qrUrl()" width="240" height="240" alt="QR Telegram" />
}
</div>
@if (popupLoading() && !webSessionId()) {
<div class="qr__placeholder">{{ 'fastcheck.modal_loading' | translate }}</div>
}
@if (webSessionId() && !isMobile) {
<img [src]="qrUrl()" width="240" height="240" alt="QR Telegram" style="border-radius:12px;display:block;margin:0 auto 12px;" />
}
@if (webSessionId()) {
<a class="tg-link" [href]="telegramLink()" target="_blank" rel="noopener">

View File

@@ -78,6 +78,10 @@ export class FastcheckPage {
return `https://api.qrserver.com/v1/create-qr-code/?size=240x240&margin=8&data=${encodeURIComponent(link)}`;
});
get isMobile(): boolean {
return typeof window !== 'undefined' && window.innerWidth < 768;
}
constructor() {
// Pull autofill data: prefer router navigation state, fall back to service.
const navState = typeof window !== 'undefined' ? (window.history?.state ?? {}) : {};
@@ -122,7 +126,11 @@ export class FastcheckPage {
next: (res) => {
this.popupLoading.set(false);
this.webSessionId.set(res.sessionId);
this.startPolling(res.sessionId);
if (this.isMobile) {
window.location.href = `https://t.me/${this.telegramBot}?start=${encodeURIComponent(res.sessionId)}`;
} else {
this.startPolling(res.sessionId);
}
},
error: () => {
this.popupLoading.set(false);

View File

@@ -53,10 +53,10 @@
></textarea>
</div>
@if (qrPayUrl()) {
@if (nspkUrl()) {
<div class="qr-pay">
<img
[src]="'https://api.qrserver.com/v1/create-qr-code/?size=240x240&margin=8&data=' + qrPayUrl()"
[src]="'https://api.qrserver.com/v1/create-qr-code/?size=240x240&margin=8&data=' + nspkUrl()"
width="240" height="240"
alt="SBP QR"
/>
@@ -64,7 +64,7 @@
</div>
}
<button class="pay-btn" type="button" (click)="pay()" [disabled]="loading() || !!qrPayUrl()">
<button class="pay-btn" type="button" (click)="pay()" [disabled]="loading() || !!nspkUrl()">
<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">

View File

@@ -38,14 +38,14 @@ export class LegacyPayPage {
note = signal<string>('');
error = signal<string>('');
loading = signal<boolean>(false);
qrPayUrl = signal<string>('');
nspkUrl = signal<string>('');
get isMobile(): boolean {
return window.innerWidth < 768;
}
paymentId = signal<string>('');
readonly isMobile: boolean = typeof window !== 'undefined'
&& (navigator.maxTouchPoints > 0 || 'ontouchstart' in window
|| /android|iphone|ipad|ipod|mobile/i.test(navigator.userAgent));
canPay = computed(() => {
const a = this.amount();
return !!this.paymentId() && a !== null && a > 0 && !this.loading();
@@ -92,7 +92,7 @@ export class LegacyPayPage {
if (this.isMobile) {
window.location.href = res.nspkurl;
} else {
this.qrPayUrl.set(res.nspkurl);
this.nspkUrl.set(res.nspkurl);
}
} else {
this.error.set(this.t('errors.payment_failed'));