parent
55486de524
commit
25a5db7337
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "fashion-logica",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --host 192.168.0.179",
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
<div class="woocommerce">
|
||||
<div
|
||||
*ngIf="currentPage.code !== PageCode.Auth"
|
||||
class="top-left-attribute"
|
||||
></div>
|
||||
<div [ngClass]="{
|
||||
woocommerce: true,
|
||||
'auth-page': currentPage.code === PageCode.Auth
|
||||
}">
|
||||
<div *ngIf="currentPage.code !== PageCode.Auth" class="top-left-attribute"></div>
|
||||
<div [ngSwitch]="currentPage.code" class="">
|
||||
<ng-container *ngSwitchCase="PageCode.Auth">
|
||||
<app-auth
|
||||
[handleHttpError]="handleHttpErrorFunc"
|
||||
(phoneConfirmed)="phoneConfirmed()"
|
||||
></app-auth>
|
||||
<app-auth [handleHttpError]="handleHttpErrorFunc" (phoneConfirmed)="phoneConfirmed()"></app-auth>
|
||||
</ng-container>
|
||||
<ng-container *ngSwitchCase="PageCode.Orders">
|
||||
<app-orders></app-orders>
|
||||
@ -23,26 +20,15 @@
|
||||
<app-ref-system></app-ref-system>
|
||||
</ng-container>
|
||||
</div>
|
||||
<nav
|
||||
*ngIf="currentPage.code !== PageCode.Auth"
|
||||
class="woocommerce-MyAccount-navigation"
|
||||
>
|
||||
<nav *ngIf="currentPage.code !== PageCode.Auth" class="woocommerce-MyAccount-navigation">
|
||||
<ul>
|
||||
<ng-container *ngFor="let page of pageList; let index = index">
|
||||
<li
|
||||
*ngIf="page.onSideBar"
|
||||
class="woocommerce-MyAccount-navigation-link"
|
||||
[ngClass]="{
|
||||
<li *ngIf="page.onSideBar" class="woocommerce-MyAccount-navigation-link" [ngClass]="{
|
||||
'is-active': page === currentPage,
|
||||
first: index === 1
|
||||
}"
|
||||
(click)="changePage($event, page)"
|
||||
>
|
||||
}" (click)="changePage($event, page)">
|
||||
<div class="container">
|
||||
<img
|
||||
src="{{ './assets/menu-icons/' + page.resName + '.png' }}"
|
||||
alt="Иконка меню"
|
||||
/>
|
||||
<img src="{{ './assets/menu-icons/' + page.resName + '.png' }}" alt="Иконка меню" />
|
||||
<div class="menu-item-info">
|
||||
<a href="#">{{ page.name }}</a>
|
||||
<p>{{ page.description }}</p>
|
||||
@ -50,10 +36,7 @@
|
||||
</div>
|
||||
</li>
|
||||
</ng-container>
|
||||
<li
|
||||
class="woocommerce-MyAccount-navigation-link"
|
||||
(click)="logout($event)"
|
||||
>
|
||||
<li class="woocommerce-MyAccount-navigation-link" (click)="logout($event)">
|
||||
<div class="container">
|
||||
<img src="./assets/menu-icons/exit.png" alt="Иконка меню" />
|
||||
<div class="menu-item-info">
|
||||
@ -63,13 +46,9 @@
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<span
|
||||
class="version"
|
||||
[ngClass]="{
|
||||
version: true,
|
||||
bottom: currentPage.code === PageCode.Auth
|
||||
}"
|
||||
>
|
||||
<span class="version" [ngClass]="{
|
||||
version: true
|
||||
}">
|
||||
v{{ version }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -2,11 +2,19 @@
|
||||
.woocommerce {
|
||||
min-height: calc(100vh - 39px);
|
||||
padding: 20px 18px;
|
||||
|
||||
&.auth-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
nav {
|
||||
margin-bottom: 24px;
|
||||
margin-top: 26px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
ul {
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
@ -14,6 +22,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
|
||||
li {
|
||||
padding: 12px;
|
||||
width: 100%;
|
||||
@ -25,20 +34,25 @@
|
||||
box-shadow: 0px 0px 5px rgb(0 0 0 / 15%);
|
||||
color: #000;
|
||||
border-radius: 15px;
|
||||
|
||||
&.is-active {
|
||||
border: solid #09467f 1px;
|
||||
// display: none;
|
||||
}
|
||||
|
||||
&.first {
|
||||
// border-radius: 7px 0 0 7px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
|
||||
.menu-item-info {
|
||||
margin-left: 16px;
|
||||
& > a {
|
||||
|
||||
&>a {
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
@ -48,7 +62,8 @@
|
||||
display: block;
|
||||
text-align-last: left;
|
||||
}
|
||||
& > p {
|
||||
|
||||
&>p {
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
@ -58,11 +73,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
li:nth-child(odd) {
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top-left-attribute {
|
||||
width: 10px;
|
||||
height: 5px;
|
||||
@ -71,12 +88,9 @@
|
||||
position: absolute;
|
||||
top: 69px;
|
||||
}
|
||||
|
||||
.version {
|
||||
opacity: 0.5;
|
||||
&.bottom {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,6 +9,7 @@ import { ExitComponent } from '../../components/exit/exit.component';
|
||||
import { DialogService, DynamicDialogRef } from 'primeng/dynamicdialog';
|
||||
import { JsonrpcService, RpcService } from 'src/app/services/jsonrpc.service';
|
||||
import { MessageService } from 'primeng/api';
|
||||
import { lastValueFrom } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-account',
|
||||
@ -70,10 +71,25 @@ export class AccountComponent implements OnInit {
|
||||
this.currentPage = this.pageList[1];
|
||||
}
|
||||
|
||||
refSystem() {
|
||||
async refSystem() {
|
||||
const additionalInfo = (await lastValueFrom(
|
||||
this.jsonRpcService.rpc({
|
||||
method: 'getAdditionalInfo',
|
||||
params: []
|
||||
}, RpcService.authService, true)
|
||||
)).data
|
||||
if (additionalInfo.refSystem?.code.length) {
|
||||
this.messageService.add({
|
||||
severity: 'custom',
|
||||
summary:
|
||||
'Вы уже зарегестрированы в реферальной программе!',
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.route.queryParams.subscribe((params) => {
|
||||
if (params['refCardNumber']) {
|
||||
this.refSystemId = params['refCardNumber'];
|
||||
console.log('####: ', params)
|
||||
if (params['refUserId']) {
|
||||
this.refSystemId = params['refUserId'];
|
||||
this.jsonRpcService
|
||||
.rpc(
|
||||
{
|
||||
@ -93,7 +109,7 @@ export class AccountComponent implements OnInit {
|
||||
next: () => {
|
||||
this.router.navigate([], {
|
||||
queryParams: {
|
||||
refCardNumber: null,
|
||||
refUserId: null,
|
||||
},
|
||||
queryParamsHandling: 'merge',
|
||||
});
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
img {
|
||||
height: 26px;
|
||||
}
|
||||
@ -25,6 +26,7 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import { environment } from 'src/environments/environment';
|
||||
styleUrls: ['./ref-system.component.scss']
|
||||
})
|
||||
export class RefSystemComponent implements OnInit {
|
||||
public refUrl: string = `${environment.defaultUrl}/?refCardNumber=`
|
||||
public refUrl: string = `${environment.defaultUrl}/?refUserId=`
|
||||
public loading: boolean = true;
|
||||
|
||||
constructor(
|
||||
@ -21,13 +21,19 @@ export class RefSystemComponent implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
const accountData = (await lastValueFrom(
|
||||
this.jsonrpc.rpc({
|
||||
method: 'GetAccounts',
|
||||
params: []
|
||||
},
|
||||
RpcService.bonusService
|
||||
)))['Cards'][0]
|
||||
this.refUrl += accountData.CardNumber
|
||||
this.jsonrpc
|
||||
.rpc(
|
||||
{
|
||||
method: 'getTokenData',
|
||||
params: [],
|
||||
},
|
||||
RpcService.authService,
|
||||
true
|
||||
)
|
||||
)).data
|
||||
console.log(accountData);
|
||||
|
||||
this.refUrl += accountData.user_id
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
@ -35,30 +41,30 @@ export class RefSystemComponent implements OnInit {
|
||||
if (navigator.share) {
|
||||
navigator.share({
|
||||
title: document.title,
|
||||
text: "Fashion Logica",
|
||||
text: "Fashionlogica",
|
||||
url: this.refUrl
|
||||
})
|
||||
.then(() => console.log('Successful share'))
|
||||
.catch((error) => {
|
||||
console.log('Error sharing:', error)
|
||||
});
|
||||
.then(() => console.log('Successful share'))
|
||||
.catch((error) => {
|
||||
console.log('Error sharing:', error)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
copyUrl() {
|
||||
navigator.clipboard.writeText(this.refUrl)
|
||||
.then(() => {
|
||||
this.messageService.add({
|
||||
severity: 'custom',
|
||||
summary: 'Ссылка скопирована!',
|
||||
.then(() => {
|
||||
this.messageService.add({
|
||||
severity: 'custom',
|
||||
summary: 'Ссылка скопирована!',
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: 'Произошла ошибка!',
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: 'Произошла ошибка!',
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user