From 7c3a4168c4db2b43a832446543bb35173a524598 Mon Sep 17 00:00:00 2001 From: gofnnp Date: Wed, 10 May 2023 02:39:33 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#13995=20=D0=BF=D0=BE=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=8F=D0=BB=20=D1=84=D0=B0=D0=B2=D0=B8=D0=BA=D0=BE=D0=BD=20?= =?UTF-8?q?=D0=B8=20=D0=B4=D1=80=D1=83=D0=B3=D0=B8=D0=B5=20=D0=B4=D0=BE?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invite-friends.component.html | 14 +++++- .../invite-friends.component.ts | 47 ++++++++++++++++-- .../last-order/last-order.component.html | 26 ++++++++-- .../last-order/last-order.component.scss | 6 +++ .../last-order/last-order.component.ts | 9 ++-- .../components/navbar/navbar.component.html | 2 +- .../bonus-program/bonus-program.component.ts | 1 + .../src/app/pages/login/login.component.ts | 1 - angular/src/favicon.ico | Bin 1150 -> 15086 bytes 9 files changed, 92 insertions(+), 14 deletions(-) diff --git a/angular/src/app/components/invite-friends/invite-friends.component.html b/angular/src/app/components/invite-friends/invite-friends.component.html index 5a52e20..5543fb8 100644 --- a/angular/src/app/components/invite-friends/invite-friends.component.html +++ b/angular/src/app/components/invite-friends/invite-friends.component.html @@ -4,12 +4,22 @@ Пригласи друзей зарегистрироваться в приложении по твоему уникальному коду и получи бонусы, когда они совершат первую покупку.

- + + + + diff --git a/angular/src/app/components/invite-friends/invite-friends.component.ts b/angular/src/app/components/invite-friends/invite-friends.component.ts index 8f48f3d..b05b189 100644 --- a/angular/src/app/components/invite-friends/invite-friends.component.ts +++ b/angular/src/app/components/invite-friends/invite-friends.component.ts @@ -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) + }); + } + } } diff --git a/angular/src/app/components/last-order/last-order.component.html b/angular/src/app/components/last-order/last-order.component.html index deb5430..f12cbb5 100644 --- a/angular/src/app/components/last-order/last-order.component.html +++ b/angular/src/app/components/last-order/last-order.component.html @@ -1,11 +1,31 @@

Ваш предыдущий заказ

-

Дата: 25 марта 2023 года

-

На сумму: 230 ₽

+

Дата: + {{lastOrder.transactionCreateDate | date:'dd.MM.yyyyг.'}} + + + +

+

На сумму: + {{lastOrder.orderSum}} ₽ + + + +

- + + +

Списание бонусов возможно на любые категории. Бонусами можно оплатить 100% суммы покупки. Бонусы начисляются только на напитки с учётом добавок. Неиспользованные бонусы сгорают в течение 90 дней.

+ + + + \ No newline at end of file diff --git a/angular/src/app/components/last-order/last-order.component.scss b/angular/src/app/components/last-order/last-order.component.scss index 0184346..4c5a2c0 100644 --- a/angular/src/app/components/last-order/last-order.component.scss +++ b/angular/src/app/components/last-order/last-order.component.scss @@ -17,6 +17,12 @@ span { color: #828282; } + .flex { + display: flex; + align-items: center; + flex-direction: row; + gap: 8px; + } } .evaluate-order { diff --git a/angular/src/app/components/last-order/last-order.component.ts b/angular/src/app/components/last-order/last-order.component.ts index d5746d2..0117951 100644 --- a/angular/src/app/components/last-order/last-order.component.ts +++ b/angular/src/app/components/last-order/last-order.component.ts @@ -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 { diff --git a/angular/src/app/components/navbar/navbar.component.html b/angular/src/app/components/navbar/navbar.component.html index 6717b43..e3df091 100644 --- a/angular/src/app/components/navbar/navbar.component.html +++ b/angular/src/app/components/navbar/navbar.component.html @@ -1,5 +1,5 @@
- +

{{title}}

diff --git a/angular/src/app/pages/account/bonus-program/bonus-program.component.ts b/angular/src/app/pages/account/bonus-program/bonus-program.component.ts index eed0adb..09983ac 100644 --- a/angular/src/app/pages/account/bonus-program/bonus-program.component.ts +++ b/angular/src/app/pages/account/bonus-program/bonus-program.component.ts @@ -155,6 +155,7 @@ export class BonusProgramComponent implements OnInit { PurchaseDate: transaction.Date, Transactions: [transaction], IsSingleTransaction: true, + transactionSum: 0 }); } }); diff --git a/angular/src/app/pages/login/login.component.ts b/angular/src/app/pages/login/login.component.ts index 0e31c2a..1da638e 100644 --- a/angular/src/app/pages/login/login.component.ts +++ b/angular/src/app/pages/login/login.component.ts @@ -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', diff --git a/angular/src/favicon.ico b/angular/src/favicon.ico index 30744f907fa7b4bfe80a3f71098bd62a53e260d0..b8de112a66b13f8873d5536e3cea612afcd5f5f1 100644 GIT binary patch literal 15086 zcmc(l3vgA%8OQe~1k~Dyf<*X7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