parent
76f1799b22
commit
7c3a4168c4
@ -4,12 +4,22 @@
|
|||||||
Пригласи друзей зарегистрироваться в приложении по твоему уникальному коду и
|
Пригласи друзей зарегистрироваться в приложении по твоему уникальному коду и
|
||||||
получи бонусы, когда они совершат первую покупку.
|
получи бонусы, когда они совершат первую покупку.
|
||||||
</p>
|
</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
|
<mat-icon
|
||||||
|
*ngIf="!loading"
|
||||||
aria-hidden="false"
|
aria-hidden="false"
|
||||||
aria-label="Share"
|
aria-label="Share"
|
||||||
fontIcon="share"
|
fontIcon="share"
|
||||||
style="color: #fff;"
|
style="color: #fff"
|
||||||
></mat-icon>
|
></mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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 { 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({
|
@Component({
|
||||||
selector: 'app-invite-friends',
|
selector: 'app-invite-friends',
|
||||||
@ -6,10 +10,45 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
styleUrls: ['./invite-friends.component.scss']
|
styleUrls: ['./invite-friends.component.scss']
|
||||||
})
|
})
|
||||||
export class InviteFriendsComponent implements OnInit {
|
export class InviteFriendsComponent implements OnInit {
|
||||||
|
public refUrl: string = `${environment.defaultUrl}/?refUserId=`
|
||||||
constructor() { }
|
public loading: boolean = true;
|
||||||
|
private shareData: ShareData = {
|
||||||
ngOnInit(): void {
|
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>
|
<h2>Ваш предыдущий заказ</h2>
|
||||||
<div class="info-order">
|
<div class="info-order">
|
||||||
<p><span>Дата: </span>25 марта 2023 года</p>
|
<p class="flex"><span>Дата: </span>
|
||||||
<p><span>На сумму: </span>230 ₽</p>
|
<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>
|
</div>
|
||||||
<button class="evaluate-order">Оценить заказ</button>
|
<a href="https://yandex.ru/profile/151770398186" target="_blank">
|
||||||
|
<button class="evaluate-order">Оценить заказ</button>
|
||||||
|
</a>
|
||||||
<p class="info">
|
<p class="info">
|
||||||
Списание бонусов возможно на любые категории. Бонусами можно оплатить 100%
|
Списание бонусов возможно на любые категории. Бонусами можно оплатить 100%
|
||||||
суммы покупки. Бонусы начисляются только на напитки с учётом добавок.
|
суммы покупки. Бонусы начисляются только на напитки с учётом добавок.
|
||||||
Неиспользованные бонусы сгорают в течение 90 дней.
|
Неиспользованные бонусы сгорают в течение 90 дней.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<ng-template #spinner let-diameter>
|
||||||
|
<mat-spinner [strokeWidth]="3" [diameter]="diameter"></mat-spinner>
|
||||||
|
</ng-template>
|
||||||
@ -17,6 +17,12 @@
|
|||||||
span {
|
span {
|
||||||
color: #828282;
|
color: #828282;
|
||||||
}
|
}
|
||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.evaluate-order {
|
.evaluate-order {
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { Purchase } from 'src/app/interface/data';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-last-order',
|
selector: 'app-last-order[lastOrder]',
|
||||||
templateUrl: './last-order.component.html',
|
templateUrl: './last-order.component.html',
|
||||||
styleUrls: ['./last-order.component.scss']
|
styleUrls: ['./last-order.component.scss']
|
||||||
})
|
})
|
||||||
export class LastOrderComponent implements OnInit {
|
export class LastOrderComponent implements OnInit {
|
||||||
|
@Input() lastOrder!: Purchase;
|
||||||
|
@Input() loading!: boolean;
|
||||||
|
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<div class="container">
|
<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>
|
<h1 class="title">{{title}}</h1>
|
||||||
<div class="plug"></div>
|
<div class="plug"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -155,6 +155,7 @@ export class BonusProgramComponent implements OnInit {
|
|||||||
PurchaseDate: transaction.Date,
|
PurchaseDate: transaction.Date,
|
||||||
Transactions: [transaction],
|
Transactions: [transaction],
|
||||||
IsSingleTransaction: true,
|
IsSingleTransaction: true,
|
||||||
|
transactionSum: 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -80,7 +80,6 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
|||||||
|
|
||||||
submitNumber() {
|
submitNumber() {
|
||||||
const data = this.phoneForm.value;
|
const data = this.phoneForm.value;
|
||||||
console.log(data);
|
|
||||||
this.isShowNumber = false;
|
this.isShowNumber = false;
|
||||||
this.jsonrpc.rpc({
|
this.jsonrpc.rpc({
|
||||||
method: 'sendVerifyByPhone',
|
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