Compare commits
2 Commits
c0b7ac08fb
...
98423be0c3
| Author | SHA1 | Date | |
|---|---|---|---|
| 98423be0c3 | |||
| 1d19ddd47c |
@@ -145,13 +145,13 @@
|
|||||||
<h2 class="modal__title">{{ 'fastcheck.modal_title' | translate }}</h2>
|
<h2 class="modal__title">{{ 'fastcheck.modal_title' | translate }}</h2>
|
||||||
<p class="modal__sub">{{ 'fastcheck.modal_sub' | translate }}</p>
|
<p class="modal__sub">{{ 'fastcheck.modal_sub' | translate }}</p>
|
||||||
|
|
||||||
<div class="qr">
|
|
||||||
@if (popupLoading() && !webSessionId()) {
|
@if (popupLoading() && !webSessionId()) {
|
||||||
<div class="qr__placeholder">{{ 'fastcheck.modal_loading' | translate }}</div>
|
<div class="qr__placeholder">{{ 'fastcheck.modal_loading' | translate }}</div>
|
||||||
} @else if (webSessionId()) {
|
|
||||||
<img [src]="qrUrl()" width="240" height="240" alt="QR Telegram" />
|
|
||||||
}
|
}
|
||||||
</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()) {
|
@if (webSessionId()) {
|
||||||
<a class="tg-link" [href]="telegramLink()" target="_blank" rel="noopener">
|
<a class="tg-link" [href]="telegramLink()" target="_blank" rel="noopener">
|
||||||
|
|||||||
@@ -78,6 +78,10 @@ export class FastcheckPage {
|
|||||||
return `https://api.qrserver.com/v1/create-qr-code/?size=240x240&margin=8&data=${encodeURIComponent(link)}`;
|
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() {
|
constructor() {
|
||||||
// Pull autofill data: prefer router navigation state, fall back to service.
|
// Pull autofill data: prefer router navigation state, fall back to service.
|
||||||
const navState = typeof window !== 'undefined' ? (window.history?.state ?? {}) : {};
|
const navState = typeof window !== 'undefined' ? (window.history?.state ?? {}) : {};
|
||||||
@@ -122,7 +126,11 @@ export class FastcheckPage {
|
|||||||
next: (res) => {
|
next: (res) => {
|
||||||
this.popupLoading.set(false);
|
this.popupLoading.set(false);
|
||||||
this.webSessionId.set(res.sessionId);
|
this.webSessionId.set(res.sessionId);
|
||||||
|
if (this.isMobile) {
|
||||||
|
window.location.href = `https://t.me/${this.telegramBot}?start=${encodeURIComponent(res.sessionId)}`;
|
||||||
|
} else {
|
||||||
this.startPolling(res.sessionId);
|
this.startPolling(res.sessionId);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: () => {
|
error: () => {
|
||||||
this.popupLoading.set(false);
|
this.popupLoading.set(false);
|
||||||
|
|||||||
@@ -53,10 +53,10 @@
|
|||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (qrPayUrl()) {
|
@if (nspkUrl()) {
|
||||||
<div class="qr-pay">
|
<div class="qr-pay">
|
||||||
<img
|
<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"
|
width="240" height="240"
|
||||||
alt="SBP QR"
|
alt="SBP QR"
|
||||||
/>
|
/>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</div>
|
</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">
|
<span class="pay-btn__icon">
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
|||||||
@@ -38,14 +38,14 @@ export class LegacyPayPage {
|
|||||||
note = signal<string>('');
|
note = signal<string>('');
|
||||||
error = signal<string>('');
|
error = signal<string>('');
|
||||||
loading = signal<boolean>(false);
|
loading = signal<boolean>(false);
|
||||||
qrPayUrl = signal<string>('');
|
nspkUrl = signal<string>('');
|
||||||
|
|
||||||
|
get isMobile(): boolean {
|
||||||
|
return window.innerWidth < 768;
|
||||||
|
}
|
||||||
|
|
||||||
paymentId = signal<string>('');
|
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(() => {
|
canPay = computed(() => {
|
||||||
const a = this.amount();
|
const a = this.amount();
|
||||||
return !!this.paymentId() && a !== null && a > 0 && !this.loading();
|
return !!this.paymentId() && a !== null && a > 0 && !this.loading();
|
||||||
@@ -92,7 +92,7 @@ export class LegacyPayPage {
|
|||||||
if (this.isMobile) {
|
if (this.isMobile) {
|
||||||
window.location.href = res.nspkurl;
|
window.location.href = res.nspkurl;
|
||||||
} else {
|
} else {
|
||||||
this.qrPayUrl.set(res.nspkurl);
|
this.nspkUrl.set(res.nspkurl);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.error.set(this.t('errors.payment_failed'));
|
this.error.set(this.t('errors.payment_failed'));
|
||||||
|
|||||||
Reference in New Issue
Block a user