правки
This commit is contained in:
Kataev Denis 2023-02-08 15:29:47 +04:00
parent ce61d8b9aa
commit 624d121006
8 changed files with 29 additions and 17 deletions

View File

@ -100,7 +100,9 @@ const routes: Routes = [
imports: [ imports: [
BrowserModule, BrowserModule,
AppRoutingModule, AppRoutingModule,
RouterModule.forRoot(routes), RouterModule.forRoot(routes, {
scrollPositionRestoration: 'enabled'
}),
InputMaskModule, InputMaskModule,
ProgressSpinnerModule, ProgressSpinnerModule,
FormsModule, FormsModule,

View File

@ -25,8 +25,8 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
gap: 4px; gap: 0px;
font-size: 14px; font-size: 12px;
font-weight: 600; font-weight: 600;
letter-spacing: 2px; letter-spacing: 2px;
color: #b5b5b9; color: #b5b5b9;
@ -43,10 +43,9 @@
&:hover { &:hover {
color: #252525; color: #252525;
a { a {
border-bottom: 2px solid #e16f38; border-bottom: 2px solid #e16f38;
} }
} }
a { a {
@ -97,9 +96,10 @@
left: 0; left: 0;
margin: 0; margin: 0;
z-index: 777; z-index: 777;
height: 57px;
border-top: solid 1px #dfdfdf; border-top: solid 1px #dfdfdf;
background-color: #fff; background-color: #fff;
padding-bottom: 16px;
padding-top: 8px;
ul { ul {
li { li {

View File

@ -10,8 +10,8 @@
img { img {
width: 100%; width: 100%;
border-radius: 1.125rem; border-radius: 1.125rem;
height: fit-content; object-fit: contain;
object-fit: cover; max-height: 50vh;
} }
} }

View File

@ -54,8 +54,7 @@
class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide" class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"
> >
<label for="code"> <label for="code">
Введите 4 последних цифры позвонившего вам номера телефона. На звонок Введите код из смс, которое пришло на Ваш номер телефона
отвечать не нужно.
</label> </label>
<input <input
pInputText pInputText

View File

@ -53,7 +53,7 @@
> >
<div class="header"> <div class="header">
<h2>{{ group.label }}</h2> <h2>{{ group.label }}</h2>
<button (click)="changeGroup(group)">Перейти в категорию</button> <button (click)="changeGroup(group)">В категорию</button>
</div> </div>
<div class="products-container__items"> <div class="products-container__items">
<div <div
@ -72,8 +72,7 @@
<p>{{ product.name }}</p> <p>{{ product.name }}</p>
</div> </div>
<p class="products-container__product-composition"> <p class="products-container__product-composition">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Odio {{product.description}}
consequuntur voluptates est.
</p> </p>
<div class="products-container__item-footer"> <div class="products-container__item-footer">
<span>{{ product.price }}₽</span> <span>{{ product.price }}₽</span>

View File

@ -4,7 +4,7 @@
max-width: 1208px; max-width: 1208px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 0 auto 16px; margin: 0 auto 64px;
&__category-name-container { &__category-name-container {
margin-bottom: 16px; margin-bottom: 16px;
@ -49,7 +49,7 @@
&__categories-container { &__categories-container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: flex-start;
font-size: 14px; font-size: 14px;
align-items: center; align-items: center;
overflow-x: auto; overflow-x: auto;

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core'; import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { Group, Modifier, ModifiersGroup, Product } from "../../interface/data"; import { Group, Modifier, ModifiersGroup, Product } from "../../interface/data";
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { DialogService } from 'primeng/dynamicdialog'; import { DialogService } from 'primeng/dynamicdialog';
@ -57,6 +57,13 @@ export class ProductsComponent implements OnInit {
this.wpJsonService.getTerminalList() this.wpJsonService.getTerminalList()
)) ))
this.terminalList = this.toTreeJson(this.keyValue(terminalList), terminalList) this.terminalList = this.toTreeJson(this.keyValue(terminalList), terminalList)
const terminalFromCookie = JSON.parse(this.cookiesService.getItem('selectedTerminal') || 'null')
const conditionDelete = this.terminalList.find((terminal: any) => JSON.stringify(terminal) === JSON.stringify(terminalFromCookie))
if (!conditionDelete) {
this.cookiesService.deleteCookie('selectedTerminal')
}
this.selectedTerminal = JSON.parse(this.cookiesService.getItem('selectedTerminal') || 'null') || this.terminalList[0] this.selectedTerminal = JSON.parse(this.cookiesService.getItem('selectedTerminal') || 'null') || this.terminalList[0]
this.cartService.changeTerminal(this.selectedTerminal) this.cartService.changeTerminal(this.selectedTerminal)
} }
@ -201,7 +208,7 @@ export class ProductsComponent implements OnInit {
return Object.keys(obj) return Object.keys(obj)
} }
toTreeJson(array: Array<string>, terminalList: any) { toTreeJson(array: Array<string>, terminalList: any): Array<any> {
let treeJson: Object[] = [] let treeJson: Object[] = []
for (const key of array) { for (const key of array) {
treeJson.push( treeJson.push(

View File

@ -244,6 +244,11 @@ p-toast[key="c"] .p-toast {
cursor: pointer; cursor: pointer;
} }
} }
.mat-tab-label-content {
color: #000;
}
html, body { height: 100%; } html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; background: #f9f9f9; } body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; background: #f9f9f9; }