parent
76f1799b22
commit
7c3a4168c4
@ -4,12 +4,22 @@
|
||||
Пригласи друзей зарегистрироваться в приложении по твоему уникальному коду и
|
||||
получи бонусы, когда они совершат первую покупку.
|
||||
</p>
|
||||
<button class="share">
|
||||
<button class="share" (click)="share()" [disabled]="loading">
|
||||
<ng-container *ngIf="loading">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="spinner; context: { $implicit: 24 }"
|
||||
></ng-container>
|
||||
</ng-container>
|
||||
<mat-icon
|
||||
*ngIf="!loading"
|
||||
aria-hidden="false"
|
||||
aria-label="Share"
|
||||
fontIcon="share"
|
||||
style="color: #fff;"
|
||||
style="color: #fff"
|
||||
></mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<ng-template #spinner let-diameter>
|
||||
<mat-spinner [strokeWidth]="3" [diameter]="diameter"></mat-spinner>
|
||||
</ng-template>
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MessageService } from 'primeng/api';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
import { JsonrpcService, RpcService } from 'src/app/services/jsonrpc.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-invite-friends',
|
||||
@ -6,10 +10,45 @@ import { Component, OnInit } from '@angular/core';
|
||||
styleUrls: ['./invite-friends.component.scss']
|
||||
})
|
||||
export class InviteFriendsComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
public refUrl: string = `${environment.defaultUrl}/?refUserId=`
|
||||
public loading: boolean = true;
|
||||
private shareData: ShareData = {
|
||||
title: ''
|
||||
}
|
||||
|
||||
constructor(
|
||||
private jsonrpc: JsonrpcService,
|
||||
private messageService: MessageService
|
||||
) { }
|
||||
|
||||
async ngOnInit() {
|
||||
const accountData = (await lastValueFrom(
|
||||
this.jsonrpc
|
||||
.rpc(
|
||||
{
|
||||
method: 'getTokenData',
|
||||
params: [],
|
||||
},
|
||||
RpcService.authService,
|
||||
true
|
||||
)
|
||||
)).data
|
||||
|
||||
this.refUrl += accountData.user_id
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
share() {
|
||||
if (navigator.share) {
|
||||
navigator.share({
|
||||
title: document.title,
|
||||
text: "Coffee Like",
|
||||
url: this.refUrl
|
||||
})
|
||||
.then(() => console.log('Successful share'))
|
||||
.catch((error) => {
|
||||
console.log('Error sharing:', error)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,31 @@
|
||||
<h2>Ваш предыдущий заказ</h2>
|
||||
<div class="info-order">
|
||||
<p><span>Дата: </span>25 марта 2023 года</p>
|
||||
<p><span>На сумму: </span>230 ₽</p>
|
||||
<p class="flex"><span>Дата: </span>
|
||||
<span *ngIf="!loading">{{lastOrder.transactionCreateDate | date:'dd.MM.yyyyг.'}}</span>
|
||||
<ng-container *ngIf="loading">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="spinner; context: { $implicit: 24 }"
|
||||
></ng-container>
|
||||
</ng-container>
|
||||
</p>
|
||||
<p class="flex"><span>На сумму: </span>
|
||||
<span *ngIf="!loading">{{lastOrder.orderSum}} ₽</span>
|
||||
<ng-container *ngIf="loading">
|
||||
<ng-container
|
||||
*ngTemplateOutlet="spinner; context: { $implicit: 24 }"
|
||||
></ng-container>
|
||||
</ng-container>
|
||||
</p>
|
||||
</div>
|
||||
<button class="evaluate-order">Оценить заказ</button>
|
||||
<a href="https://yandex.ru/profile/151770398186" target="_blank">
|
||||
<button class="evaluate-order">Оценить заказ</button>
|
||||
</a>
|
||||
<p class="info">
|
||||
Списание бонусов возможно на любые категории. Бонусами можно оплатить 100%
|
||||
суммы покупки. Бонусы начисляются только на напитки с учётом добавок.
|
||||
Неиспользованные бонусы сгорают в течение 90 дней.
|
||||
</p>
|
||||
|
||||
<ng-template #spinner let-diameter>
|
||||
<mat-spinner [strokeWidth]="3" [diameter]="diameter"></mat-spinner>
|
||||
</ng-template>
|
||||
@ -17,6 +17,12 @@
|
||||
span {
|
||||
color: #828282;
|
||||
}
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.evaluate-order {
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Purchase } from 'src/app/interface/data';
|
||||
|
||||
@Component({
|
||||
selector: 'app-last-order',
|
||||
selector: 'app-last-order[lastOrder]',
|
||||
templateUrl: './last-order.component.html',
|
||||
styleUrls: ['./last-order.component.scss']
|
||||
})
|
||||
export class LastOrderComponent implements OnInit {
|
||||
|
||||
@Input() lastOrder!: Purchase;
|
||||
@Input() loading!: boolean;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div class="container">
|
||||
<mat-icon aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon>
|
||||
<mat-icon style="cursor: pointer;" aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon>
|
||||
<h1 class="title">{{title}}</h1>
|
||||
<div class="plug"></div>
|
||||
</div>
|
||||
|
||||
@ -155,6 +155,7 @@ export class BonusProgramComponent implements OnInit {
|
||||
PurchaseDate: transaction.Date,
|
||||
Transactions: [transaction],
|
||||
IsSingleTransaction: true,
|
||||
transactionSum: 0
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -80,7 +80,6 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
||||
|
||||
submitNumber() {
|
||||
const data = this.phoneForm.value;
|
||||
console.log(data);
|
||||
this.isShowNumber = false;
|
||||
this.jsonrpc.rpc({
|
||||
method: 'sendVerifyByPhone',
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 15 KiB |
Loading…
Reference in New Issue
Block a user