Skip to content

Commit

Permalink
416. Index page (#247)
Browse files Browse the repository at this point in the history
* Update PaymentService.php

* Fix BelpostLabelService

* Format Oneami code

* Format Oneami code

* 416. Index page

* Format Oneami code

* #430 Internal movement: contact person

* Format Oneami code

---------

Co-authored-by: Oneami <Oneami@users.noreply.github.com>
  • Loading branch information
Oneami and Oneami authored Jun 16, 2024
1 parent 6d207ed commit 4462bb0
Show file tree
Hide file tree
Showing 16 changed files with 607 additions and 171 deletions.
5 changes: 5 additions & 0 deletions src/app/Admin/Controllers/StockController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ protected function grid()
$grid->column('groupChat.name', 'Групповой чат для уведомлений');
$grid->column('city.name', 'Город');
$grid->column('address', 'Адрес');
$grid->column('address_zip', 'Почтовый индекс')->hide();
$grid->column('worktime', 'Время работы');
$grid->column('phone', 'Телефон');
$grid->column('contact_person', 'Контактное лицо')->hide();

// $grid->column('geo_latitude', 'Координаты (широта)');
// $grid->column('geo_longitude', 'Координаты (долгота)');
$grid->column('check_availability', 'Сверка наличия')->switch();
Expand Down Expand Up @@ -109,8 +112,10 @@ protected function form()
$form->select('private_chat_id', 'Личный чат для отправки уведомлений')->options(TelegramChat::pluck('name', 'id'));
$form->select('group_chat_id', 'Групповой чат для отправки уведомлений')->options(TelegramChat::pluck('name', 'id'));
$form->text('address', 'Адрес');
$form->text('address_zip', 'Почтовый индекс');
$form->text('worktime', 'Время работы');
$form->phone('phone', 'Телефон');
$form->text('contact_person', 'Контактное лицо');
$form->text('geo_latitude', 'Координаты (широта)');
$form->text('geo_longitude', 'Координаты (долгота)');
$form->switch('check_availability', 'Сверка наличия');
Expand Down
18 changes: 16 additions & 2 deletions src/app/Services/Departures/BelpostLabelService.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,16 @@ public function createDisplacementLabel(Displacement $displacement): string
$sheet->setCellValue('BB6', 0);
$sheet->setCellValue('AN7', null);

$sheet->mergeCells('AS25:CL24');
$sheet->setCellValue('AS25', $displacement->directionToStock->address);
$addressCol = $displacement->directionToStock->address_zip . ', ' . $displacement->directionToStock->address;
$addressCol .= str_contains(mb_strtolower($displacement->directionToStock->internal_name), 'интернет магазин') ? '' : PHP_EOL . 'Салон обуви BAROCCO';
$sheet->mergeCells('AS25:CL27');
$sheet->getStyle('AS25')->applyFromArray([
'alignment' => [
'horizontal' => Alignment::HORIZONTAL_LEFT,
'vertical' => Alignment::VERTICAL_TOP,
],
]);
$sheet->setCellValue('AS25', $addressCol);

$sheet->setCellValue('AS28', null);
$sheet->setCellValue('BC28', null);
Expand All @@ -180,6 +188,7 @@ public function createDisplacementLabel(Displacement $displacement): string

$sheet->setCellValue('D20', null);
$sheet->setCellValue('D22', null);
$sheet->setCellValue('BK22', $displacement->directionToStock->contact_person);
$sheet->setCellValue('D25', null);
$sheet->setCellValue('D28', null);
$sheet->setCellValue('D31', null);
Expand Down Expand Up @@ -213,6 +222,11 @@ public function createDisplacementLabel(Displacement $displacement): string
],
]);

if ($displacement->directionToStock->phone) {
$sheet->setCellValue('BF35', substr(trim($displacement->directionToStock->phone), -9, -7));
$sheet->setCellValue('BJ35', preg_replace("/^(\d{3})(\d{2})(\d{2})$/", '$1 $2 $3', substr(trim($displacement->directionToStock->phone), -7)));
}

$writer = new Xlsx($spreadsheet);
$writer->save(public_path($resultPath));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('stocks', function (Blueprint $table) {
$table->string('address_zip', 10)->nullable()->after('address')->comment('Индекс');
$table->string('contact_person')->nullable()->after('phone')->comment('Контактное лицо');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('stocks', function (Blueprint $table) {
$table->dropColumn(['address_zip', 'contact_person']);
});
}
};
Binary file added src/public/images/index/about.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/resources/js/components/swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const simpleSlider = function () {
new Swiper('.js-simpleSlider', {
slidesPerView: 1,
slidesPerGroup: 1,
spaceBetween: 15,
loop: true,
navigation: {
nextEl: ".js-simpleSlider-next",
Expand Down
18 changes: 15 additions & 3 deletions src/resources/sass/_styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ input.form-check-input:checked {
&~.additional-form-check-info {
display: inline-block;
}

&~div.additional-form-check-info {
display: block;
}
Expand Down Expand Up @@ -543,11 +544,16 @@ span {

// &.price { }
&.new_price {
color: #D22020;
font-weight: 400;
color: #373936;
font-size: 14px;
}

&.old_price {
font-weight: 400;
color: #B0B0B0;
text-decoration: line-through;
margin: 0 4px 0 0;
}
}

Expand Down Expand Up @@ -600,11 +606,17 @@ span {
}

&.product-label-sale {
background: $red;
background: transparent;
border: none;
color: #73383E;
font-weight: 600;
}

&.product-label-new {
background: $success
border: 1px solid #373936;
color: #373936;
font-weight: 600;
background: transparent;
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/resources/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@
@import '_swiper';

@import 'banners/banner-timer';
@import 'banners/index-main';

@import 'includes/header';
@import 'includes/feedbacks';
@import 'includes/footer';
@import 'includes/header';
@import 'includes/instagram-block';

@import 'dashboard/orders';
@import 'dashboard/order_list';
Expand All @@ -72,6 +75,7 @@

// Specific page's styles
@import 'pages/cart';
@import 'pages/index';

@import 'static/template';
// Components
Expand Down
8 changes: 8 additions & 0 deletions src/resources/sass/banners/index-main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.banners_index {
margin: 0 -10px;

&__min {
display: flex;
gap: 12px;
}
}
88 changes: 88 additions & 0 deletions src/resources/sass/includes/footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
.inc-footer {
padding: 22px 0 31px;
font-size: 14px;

&__main {
margin: 0 0 12px;
}

&__logo {
display: block;
width: 133px;
margin-bottom: 18px;

img {
width: 100%;
}
}

&__info {

&-title {
font-size: 16px;
text-transform: uppercase;
display: inline-flex;
align-items: center;
flex-wrap: wrap;

&.collapsed:after {
transform: rotate(135deg) translateY(4px);
}

&:after {
margin: 0 0 0 12px;
display: inline-block;
width: 8px;
height: 8px;
border-right: 1px solid #000;
border-top: 1px solid #000;
transform: rotate(315deg) translateY(4px);
transition: border-color 0.2s;
content: "";
}
}

&-text {
padding: 14px 0;
font-size: 14px;

ul,
ol {
display: flex;
flex-direction: column;
gap: 5px;
list-style: none;
padding: 0;

li:hover {
text-decoration: underline;
}
}
}
}
}

@include media-breakpoint-up(md) {
.inc-footer {
padding: 51px 0 33px;

&__logo {
width: 156px;
}

&__info {

&-title {
pointer-events: none;

&:after {
display: none;
}
}

&-text:not(.show) {
display: block;
}
}
}
}
69 changes: 69 additions & 0 deletions src/resources/sass/includes/instagram-block.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.inc-instagram {
margin-bottom: 40px;

&__info {
padding-top: 15px;

&-title {
font-size: 26px;
font-weight: 500;
line-height: 120%;
text-transform: uppercase;
margin: 0 0 12px;
}
}

&__posts {
display: grid;
gap: 10px 5px;
grid-template-columns: 1fr 1fr 1fr;

&-item {
aspect-ratio: 1;
display: flex;
overflow: hidden;

img {
width: 100%;
object-fit: cover;
}
}
}

&__btn {
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid #50524F;
border-radius: 10px;
height: 48px;
width: 275px;
}
}

@include media-breakpoint-up(md) {
.inc-instagram {

&__info {
padding-right: 10px;

&-title {
font-size: 38px;
margin: 0 0 24px;
}
}
}
}

@include media-breakpoint-up(xl) {
.inc-instagram {

&__info {
padding-right: 85px;

&-title {
font-size: 50px;
}
}
}
}
Loading

0 comments on commit 4462bb0

Please sign in to comment.