link change
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<!-- Share row — always visible, enabled once amount is known -->
|
<!-- Share row — always visible, enabled once amount is known -->
|
||||||
<div class="share-row">
|
<div class="share-row">
|
||||||
<button type="button" class="share-btn share-btn--email" (click)="shareByEmail()"
|
<!-- <button type="button" class="share-btn share-btn--email" (click)="shareByEmail()"
|
||||||
[disabled]="fastcheckAmount() === null || amountLoading()"
|
[disabled]="fastcheckAmount() === null || amountLoading()"
|
||||||
[title]="'fastcheck.share_email' | translate">
|
[title]="'fastcheck.share_email' | translate">
|
||||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
<path d="M2 7l10 7 10-7"/>
|
<path d="M2 7l10 7 10-7"/>
|
||||||
</svg>
|
</svg>
|
||||||
{{ 'fastcheck.share_email' | translate }}
|
{{ 'fastcheck.share_email' | translate }}
|
||||||
</button>
|
</button> -->
|
||||||
<button type="button" class="share-btn share-btn--tg" (click)="shareByTelegram()"
|
<button type="button" class="share-btn share-btn--tg" (click)="shareByTelegram()"
|
||||||
[disabled]="fastcheckAmount() === null || amountLoading()"
|
[disabled]="fastcheckAmount() === null || amountLoading()"
|
||||||
[title]="'fastcheck.share_tg' | translate">
|
[title]="'fastcheck.share_tg' | translate">
|
||||||
|
|||||||
@@ -53,7 +53,18 @@
|
|||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="pay-btn" type="button" (click)="pay()" [disabled]="loading()">
|
@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()">
|
||||||
<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">
|
||||||
|
|||||||
@@ -35,6 +35,27 @@
|
|||||||
&__name { font-size: 13px; color: #64748b; margin-left: auto; }
|
&__name { font-size: 13px; color: #64748b; margin-left: auto; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.qr-pay {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-radius: 12px;
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__hint {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #64748b;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.note-input {
|
.note-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 2px solid #e2e8f0;
|
border: 2px solid #e2e8f0;
|
||||||
|
|||||||
@@ -36,9 +36,13 @@ 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>('');
|
||||||
|
|
||||||
paymentId = signal<string>('');
|
paymentId = signal<string>('');
|
||||||
|
|
||||||
|
readonly isMobile: boolean = typeof navigator !== 'undefined'
|
||||||
|
&& /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();
|
||||||
@@ -82,7 +86,11 @@ export class LegacyPayPage {
|
|||||||
next: (res) => {
|
next: (res) => {
|
||||||
this.loading.set(false);
|
this.loading.set(false);
|
||||||
if (res?.payload) {
|
if (res?.payload) {
|
||||||
window.location.href = res.payload;
|
if (this.isMobile) {
|
||||||
|
window.location.href = res.payload;
|
||||||
|
} else {
|
||||||
|
this.qrPayUrl.set(res.payload);
|
||||||
|
}
|
||||||
} 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