Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-05-06 17:27:18 +04:00
parent c0b7ac08fb
commit 1d19ddd47c
2 changed files with 2 additions and 22 deletions

View File

@@ -53,18 +53,7 @@
></textarea>
</div>
@if (qrPayUrl()) {
<div class="qr-pay">
<img
[src]="'https://api.qrserver.com/v1/create-qr-code/?size=240x240&margin=8&data=' + qrPayUrl()"
width="240" height="240"
alt="SBP QR"
/>
<p class="qr-pay__hint">Отсканируйте QR-код в приложении вашего банка</p>
</div>
}
<button class="pay-btn" type="button" (click)="pay()" [disabled]="loading() || !!qrPayUrl()">
<button class="pay-btn" type="button" (click)="pay()" [disabled]="loading()">
<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,9 @@ export class LegacyPayPage {
note = signal<string>('');
error = signal<string>('');
loading = signal<boolean>(false);
qrPayUrl = 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(() => {
const a = this.amount();
return !!this.paymentId() && a !== null && a > 0 && !this.loading();
@@ -89,11 +84,7 @@ export class LegacyPayPage {
next: (res) => {
this.loading.set(false);
if (res?.nspkurl) {
if (this.isMobile) {
window.location.href = res.nspkurl;
} else {
this.qrPayUrl.set(res.nspkurl);
}
window.location.href = res.nspkurl;
} else {
this.error.set(this.t('errors.payment_failed'));
}