Commit 0cbcbfbe0ee396561669179c3c6624283fa80522

Authored by Андрей Ларионов
1 parent c5f46e4d5f
Exists in master

Дополнительные картинки в админке у оборудования, меню категорий выпадающее

Showing 15 changed files with 547 additions and 160 deletions Side-by-side Diff

app/Http/Controllers/Admin/GoodController.php
... ... @@ -5,8 +5,12 @@ namespace App\Http\Controllers\Admin;
5 5 use App\Http\Controllers\Controller;
6 6 use App\Http\Requests\GoodsRequest;
7 7 use App\Models\Good;
  8 +use App\Models\Images;
  9 +use Illuminate\Database\Eloquent\Model;
8 10 use Illuminate\Http\Request;
  11 +use Illuminate\Support\Facades\Session;
9 12 use Illuminate\Support\Facades\Storage;
  13 +use Illuminate\Support\Facades\Validator;
10 14  
11 15 class GoodController extends Controller
12 16 {
... ... @@ -108,4 +112,46 @@ class GoodController extends Controller
108 112 $good->delete();
109 113 return redirect()->route('admin.goods.index');
110 114 }
  115 +
  116 + public function images_good(Good $good) {
  117 + return view('admin.goods.add_image', compact('good'));
  118 + }
  119 +
  120 + public function good_add_img(Good $good, Request $request) {
  121 + $rules = [
  122 + 'image' => 'required|min:3',
  123 + ];
  124 + $messages = [
  125 + 'required' => 'Укажите картинку!',
  126 + ];
  127 + $validator = Validator::make($request->all(), $rules, $messages);
  128 +
  129 + if ($validator->fails()) {
  130 + return redirect()->route('admin.img.good', ['good' => $good->id])
  131 + ->withErrors($validator);
  132 + } else {
  133 + $images = new Images();
  134 + $images->good_id = $good->id;
  135 + $images->image = $request->file('image')->store('goods', 'public');
  136 + $images->sample = $request->sample;
  137 + $images->save();
  138 +
  139 + return redirect()->route('admin.goods.edit', ['good' => $good->id]);
  140 + }
  141 + }
  142 +
  143 + public function good_del_img($id, Good $good) {
  144 + if (!empty($id)) {
  145 + $id = (int)$id;
  146 + $item = Images::find($id);
  147 + Storage::delete($item->image);
  148 + $item->delete();
  149 + Session::flash('message','Картинка была успешно удалена!');
  150 +
  151 + return redirect()->route('admin.goods.edit', ['good' => $good->id]);
  152 +
  153 + } else {
  154 + return redirect()->route('admin.goods.edit', ['good' => $good->id]);
  155 + }
  156 + }
111 157 }
app/Http/Controllers/MainController.php
... ... @@ -6,8 +6,12 @@ use App\Models\Banner;
6 6 use App\Models\Category;
7 7 use App\Models\Good;
8 8 use App\Models\Good_Look;
  9 +use App\Models\Images;
9 10 use App\Models\News;
  11 +use App\Models\Project;
  12 +use Illuminate\Database\Eloquent\Model;
10 13 use Illuminate\Http\Request;
  14 +use Illuminate\Support\Facades\Redirect;
11 15 use Symfony\Component\HttpFoundation\Session\Storage;
12 16  
13 17 class MainController extends Controller
... ... @@ -121,10 +125,36 @@ class MainController extends Controller
121 125 $looking->goods_id = $good->id;
122 126 $looking->save();
123 127  
124   - return view('good', compact('good'));
  128 + $lookin = Good_Look::query()->orderByDesc('id')->limit(4)->pluck('goods_id')
  129 + ->toArray();
  130 + $lookin_good = Good::query()->whereIn('id', $lookin)->get();
  131 +
  132 + $projects = Project::query()->orderByDesc('id')->paginate(10);
  133 +
  134 + $sample = Images::query()->where('sample', '=', '1')->where('good_id', '=', $good->id)->get();
  135 + $images = Images::query()->where('sample', '=', '0')->where('good_id', '=', $good->id)->get();
  136 +
  137 + $accessory = Good::query()->where('accessory_id', '=', $good->id)->limit(8)->get();
  138 + $tooling = Good::query()->where('tooling_id', '=', $good->id)->limit(8)->get();
  139 + $also_good = Good::query()->where('category_id', '=', $good->category_id)->limit(4)->get();
  140 +
  141 + return view('good', compact('good', 'accessory', 'tooling', 'also_good',
  142 + 'sample', 'images', 'lookin_good', 'projects'));
  143 + }
  144 +
  145 + public function simple_good(Good $good) {
  146 + $looking = new Good_Look();
  147 + $looking->goods_id = $good->id;
  148 + $looking->save();
  149 +
  150 + $lookin = Good_Look::query()->orderByDesc('id')->limit(4)->pluck('goods_id')
  151 + ->toArray();
  152 + $lookin_good = Good::query()->whereIn('id', $lookin)->get();
  153 +
  154 + return view('simple_good', compact('good', 'lookin_good'));
125 155 }
126 156  
127   - public function simple_good() {
128   - return view('simple_good');
  157 + public function online() {
  158 + return redirect()->back();
129 159 }
130 160 }
... ... @@ -19,4 +19,11 @@ class Good extends Model
19 19 public function category() {
20 20 return $this->belongsTo(Category::class, 'category_id');
21 21 }
  22 +
  23 + /*
  24 + * Связь объектов товаров с фотогалереей
  25 + */
  26 + public function images() {
  27 + return $this->hasMany(Images::class);
  28 + }
22 29 }
app/Models/Images.php
... ... @@ -8,4 +8,8 @@ use Illuminate\Database\Eloquent\Model;
8 8 class Images extends Model
9 9 {
10 10 use HasFactory;
  11 +
  12 + public function goods() {
  13 + return $this->belongsTo(Good::class);
  14 + }
11 15 }
app/Providers/ComposerServiceProvider.php
... ... @@ -23,6 +23,8 @@ class ComposerServiceProvider extends ServiceProvider
23 23 'admin.part.parents', //выбор родителя категории при редактировании
24 24 'admin.part.all-ctgs', //все категории в административной части
25 25 'admin.part.category_id',
  26 + 'layout.site',
  27 + 'layout.admin',
26 28 ];
27 29 View::composer($views,
28 30 function($view) {
resources/views/admin/goods/add_image.blade.php
... ... @@ -0,0 +1,26 @@
  1 +@extends('layout.admin', ['title' => 'Создание доп.картинки товара'])
  2 +
  3 +@section('content')
  4 + <div class="profile-block-wrapper">
  5 + <div class="profile-block">
  6 + <h2 class="modal-auth__title">
  7 + Название товара: {{ $good->title }} ID: ({{ $good->id }})
  8 + </h2>
  9 + <form method="post" enctype="multipart/form-data" class="modal-auth-form" action="{{ route('admin.img.add.good', ['good' => $good->id]) }}">
  10 + @csrf
  11 + <label for="image">Файл-картинка:</label>
  12 + <input type="file" class="form-control-file txt" name="image" id="image" accept="image/png, image/jpeg">
  13 + <br><br>
  14 + <label for="sample">Фото для образца-изделия</label><br>
  15 + <select name="sample" id="sample" class="form-control">
  16 + <option value="1">Да</option>
  17 + <option value="0">Нет</option>
  18 + </select>
  19 +
  20 + <br><br>
  21 + <button type="submit" class="parts-content-form-bottom__button">Сохранить</button>
  22 + </form>
  23 +
  24 + </div>
  25 + </div>
  26 +@endsection
resources/views/admin/goods/edit.blade.php
... ... @@ -9,6 +9,35 @@
9 9 <form method="post" enctype="multipart/form-data" class="modal-auth-form" action="{{ route('admin.goods.update', ['good' => $good->id]) }}">
10 10 @include('admin.goods.form')
11 11 </form>
  12 +
  13 + <h3>Дополнительные картинки</h3>
  14 + <a style="color:green" href="{{ route ('admin.img.good', ['good' => $good->id]) }}">Добавить картинку в галерею</a>
  15 + <table class="table" style="width: 100%">
  16 + <thead>
  17 + <tr>
  18 + <th>ID</th>
  19 + <th>Фото</th>
  20 + <th>Действия</th>
  21 + </tr>
  22 + </thead>
  23 + <tbody>
  24 + @if ($good->images->count())
  25 + @foreach($good->images as $img)
  26 + <tr>
  27 + <td><?=$img->id?></td>
  28 + <td><img src="<?=asset(Storage::url($img->image))?>" width="100px"/></td>
  29 + <td><a href="{{ route('admin.img.del.good', ['id'=> $img->id, 'good' => $good->id]) }}">Удалить</a></td>
  30 + </tr>
  31 + @endforeach
  32 + @else
  33 + <tr>
  34 + <td>-</td>
  35 + <td>-</td>
  36 + <td>-</td>
  37 + </tr>
  38 + @endif
  39 + </tbody>
  40 + </table>
12 41 </div>
13 42 </div>
14 43 @endsection
resources/views/admin/goods/form.blade.php
... ... @@ -225,9 +225,9 @@
225 225 <span class="auth-mail-error auth-mail-error--hidden">Ошибка</span>
226 226 </label><br>
227 227 <input type="file" class="form-input form-control-file " name="image" id="image" accept="image/png, image/jpeg">
228   -@isset($category->image)
  228 +@isset($good->image)
229 229 <div class="form-group form-check">
230   - <img src="<?=asset(Storage::url($category->image))?>" width="100px"/>
  230 + <img src="<?=asset(Storage::url($good->image))?>" width="100px"/>
231 231 </div>
232 232 @endisset
233 233  
resources/views/admin/goods/lookin.blade.php
... ... @@ -0,0 +1,66 @@
  1 +@extends('layout.admin', ['title' => 'Доп.картинки у товара'])
  2 +
  3 +@section('content')
  4 + <div class="profile-block-wrapper">
  5 + <div class="profile-block">
  6 + <h2 class="modal-auth__title_">
  7 + Товары
  8 + </h2><br>
  9 + <a href="{{ route('admin.goods.create') }}" class="btn banner-container__button" style="margin: 0px;">
  10 + Создать товар
  11 + </a><br><br>
  12 +
  13 + <table class="table" style="width: 100%">
  14 + <thead>
  15 + <tr>
  16 + <th>ID</th>
  17 + <th>Фото</th>
  18 + <th>Категория</th>
  19 + <th>Товар</th>
  20 + <th>Дата создания</th>
  21 + <th>Действия</th>
  22 + </tr>
  23 + </thead>
  24 + <tbody>
  25 + @if ($goods->count())
  26 + @foreach($goods as $good)
  27 + <tr>
  28 + <td>{{ $good->id }}</td>
  29 + <td><? if (empty($good->image)) {?>Нет фото<?} else {?>
  30 + <!--<img src="/storage/app/public/<?//=$area->foto_main; //=asset(Storage::url($area->foto_main))?>" width="100px"/>-->
  31 + <img src="<?=asset(Storage::url($good->image))?>" width="100px"/>
  32 + <?}?></td>
  33 + <td>{{ $good->category->name }}</td>
  34 + <td>{{ $good->title }}</td>
  35 + <td>{{ $good->created_at }}</td>
  36 + <td> <form action="{{ route('admin.goods.destroy', $good) }}" method="POST">
  37 + <a href="{{ route('admin.goods.edit', ['good' => $good->id]) }}">
  38 + Редактировать
  39 + </a> |
  40 + @csrf
  41 + @method('DELETE')
  42 + <input class=" btn-danger" type="submit" value="Удалить">
  43 + </form>
  44 + </td>
  45 + </tr>
  46 + @endforeach
  47 + @else
  48 + <tr>
  49 + <td>-</td>
  50 + <td>-</td>
  51 + <td>-</td>
  52 + <td>-</td>
  53 + <td>-</td>
  54 + <td>-</td>
  55 + </tr>
  56 + @endif
  57 +
  58 + </tbody>
  59 + </table>
  60 +
  61 + {{ $goods->onEachSide(1)->links('catalogs.paginate') }}
  62 +
  63 + </div>
  64 + </div>
  65 + <br><br>
  66 +@endsection
resources/views/good.blade.php
... ... @@ -434,12 +434,26 @@
434 434 <div class="swiper-product-container">
435 435 <div class="swiper gallery">
436 436 <div class="swiper-wrapper">
  437 + @empty($good->image)
  438 +
  439 + @else
437 440 <div class="swiper-slide">
438 441 <div class="swiper-zoom-container">
439   - <img src="./img/product/slider/main.png">
  442 + <img src="{{ asset(Storage::url($good->image )) }}">
440 443 </div>
441 444 </div>
442   - <div class="swiper-slide">
  445 + @endif
  446 +
  447 + @if ($images->count())
  448 + @foreach($images as $image)
  449 + <div class="swiper-slide">
  450 + <div class="swiper-zoom-container">
  451 + <img src="{{ asset(Storage::url($image->image )) }}">
  452 + </div>
  453 + </div>
  454 + @endforeach
  455 + @endif
  456 + <!--<div class="swiper-slide">
443 457 <div class="swiper-zoom-container">
444 458 <img src="./img/product/slider/2.png">
445 459 </div>
... ... @@ -453,17 +467,29 @@
453 467 <div class="swiper-zoom-container">
454 468 <img src="./img/product/slider/main.png">
455 469 </div>
456   - </div>
  470 + </div>-->
457 471 </div>
458 472 </div>
459 473  
460 474 <!-- thumbs -->
461 475 <nav class="swiper gallery-thumbs">
462 476 <div class="swiper-wrapper swiper-wrapper-thumbs">
  477 + @empty($good->image)
  478 +
  479 + @else
463 480 <div class="swiper-slide swiper-slide-thumbs">
464   - <img src="./img/product/slider/main.png">
  481 + <img src="{{ asset(Storage::url($good->image)) }}">
465 482 </div>
466   - <div class="swiper-slide swiper-slide-thumbs">
  483 + @endif
  484 +
  485 + @if ($images->count())
  486 + @foreach($images as $image)
  487 + <div class="swiper-slide swiper-slide-thumbs">
  488 + <img src="{{ asset(Storage::url($image->image)) }}">
  489 + </div>
  490 + @endforeach
  491 + @endif
  492 + <!--<div class="swiper-slide swiper-slide-thumbs">
467 493 <div class="swiper-zoom-container">
468 494 <img src="./img/product/slider/2.png">
469 495 </div>
... ... @@ -473,47 +499,39 @@
473 499 </div>
474 500 <div class="swiper-slide">
475 501 <img src="./img/product/slider/main.png">
476   - </div>
  502 + </div>-->
477 503 </div>
478 504 </nav>
479 505 </div>
480 506 <div class="cart__info">
481 507 <h1 class="cart__info-title">
482   - Установка лазерной
483   - резки GWEIKE,
484   - серия LF 6025GH
  508 + {{ $good->title }}
485 509 </h1>
486 510 <div class="cart__info-config">
487 511 <div class="cart__info-config-select">
488 512 <div class="select-size__wrapper">
489 513 <label class="label" for="select-size">Размер стола</label>
490 514 <select class="select select-size" id="select-size">
491   - <option value="1250x2500">1250x2500мм</option>
492   - <option value="1250x2500">1250x2500мм</option>
493   - <option value="1250x2500">1250x2500мм</option>
  515 + <option value="1250x2500">{{ $good->size }}мм</option>
494 516 </select>
495 517 </div>
496 518 <div class="select-power__wrapper">
497 519 <label class="label" for="select-power">Мощность</label>
498 520 <select class="select select-power" id="select-power">
499   - <option value="1500W">1500W</option>
500   - <option value="1500W">1500W</option>
501   - <option value="1500W">1500W</option>
  521 + <option value="1500W">{{ $good->power }}W</option>
502 522 </select>
503 523 </div>
504 524 <div class="select-source__wrapper">
505 525 <label class="label" for="select-source">Тип источника</label>
506 526 <select class="select select-source" id="select-source">
507   - <option value="Raycus">Для черной и нержавейки (Raycus)</option>
508   - <option value="Raycus">Для черной и нержавейки (Raycus)</option>
509   - <option value="Raycus">Для черной и нержавейки (Raycus)</option>
  527 + <option value="Raycus">{{ $good->type_good }}</option>
510 528 </select>
511 529 </div>
512 530 </div>
513 531 <div class="cart__info-config-country">
514 532 <p class="prod">Производитель</p>
515   - <img class="svg-country" src="./img/svg/country/germany.svg" alt="">
516   - <p class="name">Optimum</p>
  533 + <img class="svg-country" src="{{ asset('/img/main/catalog/country/'.$good->country.'.svg') }}" alt="">
  534 + <p class="name">{{ $good->manufacturer }}</p>
517 535 </div>
518 536 </div>
519 537 <div class="cart__info-links">
... ... @@ -521,10 +539,16 @@
521 539 <a href="#" class="cart__info-links-item js-cart__info-links-parts">Заказать запчасти</a>
522 540 </div>
523 541 <div class="cart__info-down">
524   - <span class="price-before price-before_active">250 990 ₽</span>
525   - <p class="cart__info-down__price">
526   - 250 999 ₽
527   - </p>
  542 + @if ((!empty($good->price_old)) && ($good->price_old > 0))
  543 + <span class="price-before price-before_active">{{$good->price_old}} ₽</span>
  544 + @endif
  545 +
  546 + @if ((!empty($good->price)) && ($good->price > 0))
  547 + <p class="cart__info-down__price">
  548 + {{ $good->price }} ₽
  549 + </p>
  550 + @endif
  551 +
528 552 </div>
529 553 <div class="cart__info-buttons">
530 554 <a class="cart__button buy js_buy" href="#">Купить</ф>
... ... @@ -554,7 +578,13 @@
554 578 <!-- таб описание товара -->
555 579 <div class="specification__tabs-item specification__tabs-item_active spec__tab-1">
556 580 <div class="description">
557   - <h2 class="description__title">Назначение</h2>
  581 + <h2 class="spec__tab-3__title">Описание</h2><br>
  582 + @if (!empty($good->description))
  583 + {!! $good->description !!}
  584 + @else
  585 + <p>Здесь ничего нет</p>
  586 + @endif
  587 + <!--<h2 class="description__title">Назначение</h2>
558 588 <p class="description__par description__par-1">Данные станки с высокой скоростью и точностью
559 589 предназначены для получистовой и чистовой обработки различного вида
560 590 деталей типа: вал, диск, втулка. Станки обеспечивает высокую эффективность, большие объемы и
... ... @@ -601,13 +631,19 @@
601 631 <li class="par__item par-5_item">обработка дуг;</li>
602 632 <li class="par__item par-5_item">разворачивания отверстий;</li>
603 633 <li class="par__item par-5_item">скоростная обработка черных и цветных металлов.</li>
604   - </ul>
  634 + </ul>-->
605 635 </div>
606 636 </div>
607 637 <!-- таб характеристики -->
608 638 <div class="specification__tabs-item spec__tab-2">
  639 + <h2 class="spec__tab-3__title">Характеристики</h2>
609 640 <div class="spec-tab-2-table-container">
610   - <table class="spec-tab-2-table js_table_product">
  641 + @if (!empty($good->feature))
  642 + {!! $good->feature !!}
  643 + @else
  644 + <p>Здесь ничего нет</p>
  645 + @endif
  646 + <!--<table class="spec-tab-2-table js_table_product">
611 647 <thead>
612 648 <tr class="spec-table_line line-color js_tr">
613 649 <th class="spec-table__title title-main">Model</th>
... ... @@ -726,20 +762,26 @@
726 762 <td class="spec-table__info">288559</td>
727 763 </tr>
728 764 </tbody>
729   - </table>
  765 + </table>-->
730 766 </div>
731 767 </div>
732 768 <!-- таб образцы изделей -->
733 769 <div class="specification__tabs-item spec__tab-3">
734 770 <h2 class="spec__tab-3__title">Образцы изделий</h2>
735   - <p class="spec__tab-3__subtitle">Изготовлено на установке лазерной резки gweike (lf6025gh)</p>
  771 + <p class="spec__tab-3__subtitle">Материалы представлены для ознакомления с работой станка</p>
736 772 <div class="models-wrapper">
737 773 <div class="swiper swiper-models">
738 774 <div class="swiper-wrapper">
739   - <div class="swiper-slide swiper-slide-models">
740   - <img class="swiper-slide-models__img" src="./img/product/tabs/tab-3-models/m-1.png" alt="">
741   - </div>
742   - <div class="swiper-slide swiper-slide-models">
  775 + @if ($sample->count())
  776 + @foreach($sample as $image)
  777 + <div class="swiper-slide swiper-slide-models">
  778 + <img class="swiper-slide-models__img" src="{{ asset(Storage::url($image->image)) }}" alt="">
  779 + </div>
  780 + @endforeach
  781 + @else
  782 + <p>Здесь ничего нет</p>
  783 + @endif
  784 + <!--<div class="swiper-slide swiper-slide-models">
743 785 <img class="swiper-slide-models__img" src="./img/product/tabs/tab-3-models/m-2.png" alt="">
744 786 </div>
745 787 <div class="swiper-slide swiper-slide-models">
... ... @@ -747,18 +789,18 @@
747 789 </div>
748 790 <div class="swiper-slide swiper-slide-models">
749 791 <img class="swiper-slide-models__img" src="./img/product/tabs/tab-3-models/m-1.png" alt="">
750   - </div>
  792 + </div>-->
751 793 </div>
752 794 </div>
753 795 <div class="swiper-scrollbar spec-scrollbar"></div>
754 796 <div class="swiper-button-next swiper-button-next_models">
755 797 <svg class="svg-partners-next">
756   - <use xlink:href="./img/icons.svg#pr-next"></use>
  798 + <use xlink:href="{{ asset('/img/icons.svg#pr-next') }}"></use>
757 799 </svg>
758 800 </div>
759 801 <div class="swiper-button-prev swiper-button-prev_models">
760 802 <svg class="svg-partners-back">
761   - <use xlink:href="./img/icons.svg#pr-prev"></use>
  803 + <use xlink:href="{{ asset('/img/icons.svg#pr-prev') }}"></use>
762 804 </svg>
763 805 </div>
764 806 </div>
... ... @@ -769,7 +811,12 @@
769 811 <h3 class="spec__tab-4__title">
770 812 Комплектация
771 813 </h3>
772   - <div class="spec__tab-4__table-container">
  814 + @if (!empty($good->equipment))
  815 + {!! $good->equipment !!}
  816 + @else
  817 + <p>Здесь ничего нет.</p>
  818 + @endif
  819 + <!--<div class="spec__tab-4__table-container">
773 820 <table class="tab-4__table">
774 821 <tr class="tab-4__table-line">
775 822 <td>Ускорение</td>
... ... @@ -808,7 +855,7 @@
808 855 <td>2500 х 6000 мм</td>
809 856 </tr>
810 857 </table>
811   - </div>
  858 + </div>-->
812 859 </div>
813 860 <!-- таб акксессуары -->
814 861 <div class="specification__tabs-item spec__tab-5">
... ... @@ -818,31 +865,41 @@
818 865 <div class="swiper swiper-tab-5">
819 866 <div class="swiper-wrapper">
820 867 <div class="swiper-slide swiper-slide-tab-5">
  868 + @if ($accessory->count())
  869 + @foreach ($accessory as $acc)
821 870 <div class="viewed__item item-tab-5">
822 871 <div class="catalog__item">
823 872 <div class="swiper swiper-catalog-item">
824 873 <div class="swiper-wrapper">
  874 + @if (!empty($acc->image))
825 875 <div class="swiper-slide swiper-slide-catalog">
826   - <img class="swiper-slide-catalog-img" src="./img/product/viewed/v-1-min.png" alt="">
  876 + <img class="swiper-slide-catalog-img" src="{{ asset(Storage::url($acc->image)) }}" alt="">
827 877 </div>
828   - <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
  878 + @endif
  879 + <!--<div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
829 880 src="./img/product/viewed/v-1-min.png" alt=""></div>
830 881 <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
831 882 src="./img/product/viewed/v-1-min.png" alt=""></div>
  883 + -->
832 884 </div>
833 885 <div class="swiper-pagination"></div>
834 886 </div>
835 887 </div>
836 888 <div class="tab-5__item-info">
837   - <h4 class="tab-5__item-title">Установка лазерной
838   - резки GWEIKE</h4>
  889 + <h4 class="tab-5__item-title">{{ $acc->title }}</h4>
839 890 <div class="tab-5__item-bottom">
840   - <p class="tab-5__item-price">250 990 ₽</p>
841   - <button class="tab-5__item-btn">В каталог</button>
  891 + @if (!empty($acc->price))
  892 + <p class="tab-5__item-price">{{ $acc->price }} ₽</p>
  893 + @endif
  894 + <a class="tab-5__item-btn link-btn " href="{{ route('catalog_detail', ['category' => $acc->category_id]) }}">В каталог</a>
842 895 </div>
843 896 </div>
844 897 </div>
845   - <div class="viewed__item item-tab-5">
  898 + @endforeach
  899 + @else
  900 + <p>Здесь ничего нет</p>
  901 + @endif
  902 + <!--<div class="viewed__item item-tab-5">
846 903 <div class="catalog__item">
847 904 <div class="swiper swiper-catalog-item">
848 905 <div class="swiper-wrapper">
... ... @@ -1007,16 +1064,10 @@
1007 1064 <button class="tab-5__item-btn">В каталог</button>
1008 1065 </div>
1009 1066 </div>
1010   - </div>
1011   -
1012   -
1013   -
1014   -
1015   -
1016   -
  1067 + </div>-->
1017 1068  
1018 1069 </div>
1019   - <div class="swiper-slide swiper-slide-tab-5">
  1070 + <!--<div class="swiper-slide swiper-slide-tab-5">
1020 1071 <div class="viewed__item item-tab-5">
1021 1072 <div class="catalog__item">
1022 1073 <div class="swiper swiper-catalog-item">
... ... @@ -1207,18 +1258,18 @@
1207 1258 </div>
1208 1259 </div>
1209 1260 </div>
1210   - </div>
  1261 + </div>-->
1211 1262 </div>
1212 1263  
1213 1264 </div>
1214 1265 <div class="swiper-button-next swiper-button-next_tab-5">
1215 1266 <svg class="svg-partners-next">
1216   - <use xlink:href="./img/icons.svg#pr-next"></use>
  1267 + <use xlink:href="{{ asset('/img/icons.svg#pr-next') }}"></use>
1217 1268 </svg>
1218 1269 </div>
1219 1270 <div class="swiper-button-prev swiper-button-prev_tab-5">
1220 1271 <svg class="svg-partners-back">
1221   - <use xlink:href="./img/icons.svg#pr-prev"></use>
  1272 + <use xlink:href="{{ asset('/img/icons.svg#pr-prev') }}"></use>
1222 1273 </svg>
1223 1274 </div>
1224 1275 </div>
... ... @@ -1230,30 +1281,41 @@
1230 1281 <div class="swiper swiper-tab-6">
1231 1282 <div class="swiper-wrapper">
1232 1283 <div class="swiper-slide swiper-slide-tab-6">
1233   - <div class="viewed__item item-tab-6">
  1284 + @if ($tooling->count())
  1285 + @foreach ($tooling as $tool)
  1286 + <div class="viewed__item item-tab-6">
1234 1287 <div class="catalog__item">
1235 1288 <div class="swiper swiper-catalog-item">
1236 1289 <div class="swiper-wrapper">
  1290 + @if (!empty($tool->image))
1237 1291 <div class="swiper-slide swiper-slide-catalog">
1238   - <img class="swiper-slide-catalog-img" src="./img/product/viewed/v-1-min.png" alt="">
  1292 + <img class="swiper-slide-catalog-img" src="{{asset(Storage::url($tool->image))}}" alt="">
1239 1293 </div>
1240   - <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
  1294 + @endif
  1295 + <!--<div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
1241 1296 src="./img/product/viewed/v-1-min.png" alt=""></div>
1242 1297 <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
1243   - src="./img/product/viewed/v-1-min.png" alt=""></div>
  1298 + src="./img/product/viewed/v-1-min.png" alt=""></div>-->
1244 1299 </div>
1245 1300 <div class="swiper-pagination"></div>
1246 1301 </div>
1247 1302 </div>
1248 1303 <div class="tab-6__item-info">
1249   - <h4 class="tab-6__item-title">Автоматический стол перемещения X</h4>
  1304 + <h4 class="tab-6__item-title">{{$tool->title}}</h4>
1250 1305 <div class="tab-6__item-bottom">
1251   - <p class="tab-6__item-price">250 990 ₽</p>
1252   - <button class="tab-6__item-btn">В каталог</button>
  1306 + @if (!empty($tool->price))
  1307 + <p class="tab-6__item-price">{{ $tool->price }} ₽</p>
  1308 + @endif
  1309 + <a class="tab-6__item-btn link-btn " href="{{ route('catalog_detail', ['category' => $tool->category_id]) }}">В каталог</a>
1253 1310 </div>
1254 1311 </div>
1255 1312 </div>
1256   - <div class="viewed__item item-tab-6">
  1313 + @endforeach
  1314 + @else
  1315 + <p>Здесь ничего нет</p>
  1316 + @endif
  1317 +
  1318 + <!--<div class="viewed__item item-tab-6">
1257 1319 <div class="catalog__item">
1258 1320 <div class="swiper swiper-catalog-item">
1259 1321 <div class="swiper-wrapper">
... ... @@ -1417,9 +1479,9 @@
1417 1479 <button class="tab-6__item-btn">В каталог</button>
1418 1480 </div>
1419 1481 </div>
1420   - </div>
  1482 + </div>-->
1421 1483 </div>
1422   - <div class="swiper-slide swiper-slide-tab-6">
  1484 + <!--<div class="swiper-slide swiper-slide-tab-6">
1423 1485 <div class="viewed__item item-tab-6">
1424 1486 <div class="catalog__item">
1425 1487 <div class="swiper swiper-catalog-item">
... ... @@ -1615,18 +1677,18 @@
1615 1677  
1616 1678  
1617 1679  
1618   - </div>
  1680 + </div>-->
1619 1681 </div>
1620 1682  
1621 1683 </div>
1622 1684 <div class="swiper-button-next swiper-button-next_tab-6">
1623 1685 <svg class="svg-partners-next">
1624   - <use xlink:href="./img/icons.svg#pr-next"></use>
  1686 + <use xlink:href="{{ asset('/img/icons.svg#pr-next') }}"></use>
1625 1687 </svg>
1626 1688 </div>
1627 1689 <div class="swiper-button-prev swiper-button-prev_tab-6">
1628 1690 <svg class="svg-partners-back">
1629   - <use xlink:href="./img/icons.svg#pr-prev"></use>
  1691 + <use xlink:href="{{ asset('/img/icons.svg#pr-prev') }}"></use>
1630 1692 </svg>
1631 1693 </div>
1632 1694 </div>
... ... @@ -1638,33 +1700,40 @@
1638 1700 </h3>
1639 1701 <div class="swiper swiper-tab-7">
1640 1702 <div class="swiper-wrapper">
  1703 + @if ($also_good->count())
  1704 + @foreach($also_good as $agood)
1641 1705 <div class="swiper-slide">
1642 1706 <div class="tab-7__item">
1643 1707 <div class="catalog__item">
1644 1708 <div class="swiper swiper-catalog-item">
1645 1709 <div class="swiper-wrapper">
  1710 + @if (!empty($agood->image))
1646 1711 <div class="swiper-slide swiper-slide-catalog">
1647   - <img class="swiper-slide-catalog-img" src="./img/product/viewed/v-1-min.png" alt="">
  1712 + <img class="swiper-slide-catalog-img" src="{{ asset(Storage::url($agood->image)) }}" alt="">
1648 1713 </div>
1649   - <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
  1714 + @endif
  1715 + <!--<div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
1650 1716 src="../img/product/viewed/v-1-min.png" alt=""></div>
1651 1717 <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
1652   - src="./img/product/viewed/v-1-min.png" alt=""></div>
  1718 + src="./img/product/viewed/v-1-min.png" alt=""></div>-->
1653 1719 </div>
1654 1720 <div class="swiper-pagination"></div>
1655 1721 </div>
1656 1722 </div>
1657 1723 <div class="tab-7__item-info">
1658   - <h4 class="tab-7__item-title">Установка лазерной
1659   - резки GWEIKE</h4>
  1724 + <h4 class="tab-7__item-title">{{ $agood->title }}</h4>
1660 1725 <div class="tab-7__item-bottom">
1661   - <p class="tab-7__item-price">250 990 ₽</p>
1662   - <button class="tab-7__item-btn">В каталог</button>
  1726 + <p class="tab-7__item-price">{{ $agood->price }} ₽</p>
  1727 + <a class="tab-7__item-btn link-btn " href="{{ route('catalog_detail', ['category' => $agood->category_id]) }}">В каталог</a>
1663 1728 </div>
1664 1729 </div>
1665 1730 </div>
1666 1731 </div>
1667   - <div class="swiper-slide">
  1732 + @endforeach
  1733 + @else
  1734 + <p>Здесь ничего нет</p>
  1735 + @endif
  1736 + <!--<div class="swiper-slide">
1668 1737 <div class="tab-7__item">
1669 1738 <div class="catalog__item">
1670 1739 <div class="swiper swiper-catalog-item">
... ... @@ -1767,18 +1836,18 @@
1767 1836 </div>
1768 1837 </div>
1769 1838 </div>
1770   - </div>
  1839 + </div>-->
1771 1840 </div>
1772 1841  
1773 1842 </div>
1774 1843 <div class="swiper-button-next swiper-button-next_tab-7">
1775 1844 <svg class="svg-partners-next">
1776   - <use xlink:href="./img/icons.svg#pr-next"></use>
  1845 + <use xlink:href="{{ asset('/img/icons.svg#pr-next') }}"></use>
1777 1846 </svg>
1778 1847 </div>
1779 1848 <div class="swiper-button-prev swiper-button-prev_tab-7">
1780 1849 <svg class="svg-partners-back">
1781   - <use xlink:href="./img/icons.svg#pr-prev"></use>
  1850 + <use xlink:href="{{ asset('/img/icons.svg#pr-prev') }}"></use>
1782 1851 </svg>
1783 1852 </div>
1784 1853 </div>
... ... @@ -1788,7 +1857,7 @@
1788 1857 </div>
1789 1858 </section>
1790 1859  
1791   - <section class="offer">
  1860 + <!--<section class="offer">
1792 1861 <div class="container offer-container">
1793 1862 <h2 class="offer__title">
1794 1863 Выгодное комплектное предложение
... ... @@ -1800,7 +1869,7 @@
1800 1869 <div class="swiper-icons">
1801 1870 <div class="swiper-icons-left icons-offer">
1802 1871 <svg class="swiper-icons-left__clock">
1803   - <use xlink:href="../img/icons.svg#clock"></use>
  1872 + <use xlink:href="<?php //asset('../img/icons.svg#clock')?>"></use>
1804 1873 </svg>
1805 1874 <p class="swiper-icons-left__text">Под заказ</p>
1806 1875 </div>
... ... @@ -1810,9 +1879,9 @@
1810 1879 </div>
1811 1880 </div>
1812 1881 <div class="swiper-wrapper">
1813   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-1.png" alt=""></div>
1814   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-1.png" alt=""></div>
1815   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-1.png" alt=""></div>
  1882 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-1.png') ?>" alt=""></div>
  1883 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-1.png') ?>" alt=""></div>
  1884 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-1.png') ?>" alt=""></div>
1816 1885 </div>
1817 1886 <div class="swiper-pagination"></div>
1818 1887 </div>
... ... @@ -1835,7 +1904,7 @@
1835 1904 <div class="swiper-icons">
1836 1905 <div class="swiper-icons-left icons-offer">
1837 1906 <svg class="swiper-icons-left__clock">
1838   - <use xlink:href="../img/icons.svg#clock"></use>
  1907 + <use xlink:href="<?php //asset('../img/icons.svg#clock')?>"></use>
1839 1908 </svg>
1840 1909 <p class="swiper-icons-left__text">Под заказ</p>
1841 1910 </div>
... ... @@ -1845,11 +1914,11 @@
1845 1914 </div>
1846 1915 </div>
1847 1916 <div class="swiper-wrapper">
1848   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-2.png"
  1917 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-2.png') ?>"
1849 1918 alt=""></div>
1850   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-2.png"
  1919 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-2.png') ?>"
1851 1920 alt=""></div>
1852   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-2.png"
  1921 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-2.png') ?>"
1853 1922 alt=""></div>
1854 1923 </div>
1855 1924 <div class="swiper-pagination"></div>
... ... @@ -1871,7 +1940,7 @@
1871 1940 <div class="swiper-icons">
1872 1941 <div class="swiper-icons-left icons-offer">
1873 1942 <svg class="swiper-icons-left__clock">
1874   - <use xlink:href="../img/icons.svg#clock"></use>
  1943 + <use xlink:href="<?php //asset('../img/icons.svg#clock') ?>"></use>
1875 1944 </svg>
1876 1945 <p class="swiper-icons-left__text">Под заказ</p>
1877 1946 </div>
... ... @@ -1881,11 +1950,12 @@
1881 1950 </div>
1882 1951 </div>
1883 1952 <div class="swiper-wrapper">
1884   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-3.png"
  1953 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-3.png') ?>"
1885 1954 alt=""></div>
1886   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-3.png"
  1955 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-3.png') ?>
  1956 +"
1887 1957 alt=""></div>
1888   - <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="./img/product/offer/offer-3.png"
  1958 + <div class="swiper-slide"><img class="swiper-slide-catalog-img" src="<?php //asset('/img/product/offer/offer-3.png') ?>"
1889 1959 alt=""></div>
1890 1960 </div>
1891 1961 <div class="swiper-pagination"></div>
... ... @@ -1903,31 +1973,34 @@
1903 1973 </div>
1904 1974 </div>
1905 1975 </div>
1906   - <a class="offer__btn">Получить рассчет</a>
  1976 + <a class="offer__btn">Получить расчет</a>
1907 1977 </div>
1908   - </section>
  1978 + </section>-->
1909 1979  
  1980 + @if ($projects->count())
1910 1981 <section class="projects">
1911 1982 <div class="container projects__container">
1912 1983 <h2 class="projects__title">Реализованные проекты</h2>
1913 1984  
1914 1985 <div class="swiper swiper-projects">
1915 1986 <div class="swiper-wrapper">
  1987 + @foreach ($projects as $project)
1916 1988 <div class="swiper-slide swiper-slide-projects">
1917   - <img class="slide-projects-img" src="./img/product/projects/pr-1.png" alt="">
1918   - <h3 class="slide-projects-title">Монтаж установки лазерной резки Gweike в Химках</h3>
  1989 + <img class="slide-projects-img" src="{{ asset(Storage::url($project->image)) }}" alt="">
  1990 + <h3 class="slide-projects-title">{{ $project->title }}</h3>
1919 1991 <div class="slide-projects_info">
1920 1992 <div class="info-1">
1921 1993 <p class="projects_info-main">Заказчик:</p>
1922   - <span class="projects_info-main info-name">Стройпромет</span>
  1994 + <span class="projects_info-main info-name">{{ $project->customer }}</span>
1923 1995 </div>
1924 1996 <div class="info-2">
1925 1997 <p class="projects_info-main">Дата сдачи проекта:</p>
1926   - <span class="projects_info-main">01.09.2020</span>
  1998 + <span class="projects_info-main">{{ $project->date_project }}</span>
1927 1999 </div>
1928 2000 </div>
1929 2001 </div>
1930   - <div class="swiper-slide swiper-slide-projects">
  2002 + @endforeach
  2003 + <!--<div class="swiper-slide swiper-slide-projects">
1931 2004 <img class="slide-projects-img" src="./img/product/projects/pr-2.png" alt="">
1932 2005 <h3 class="slide-projects-title projects-title-2">ППР лазерного маркиратора
1933 2006 GWEIKE</h3>
... ... @@ -1969,18 +2042,18 @@
1969 2042 <span class="projects_info-main">01.09.2020</span>
1970 2043 </div>
1971 2044 </div>
1972   - </div>
  2045 + </div>-->
1973 2046 </div>
1974 2047  
1975 2048 </div>
1976 2049 <div class="swiper-button-next swiper-button-next_projects">
1977 2050 <svg class="svg-partners-next">
1978   - <use xlink:href="./img/icons.svg#pr-next"></use>
  2051 + <use xlink:href="{{ asset('/img/icons.svg#pr-next') }}"></use>
1979 2052 </svg>
1980 2053 </div>
1981 2054 <div class="swiper-button-prev swiper-button-prev_projects">
1982 2055 <svg class="svg-partners-back">
1983   - <use xlink:href="./img/icons.svg#pr-prev"></use>
  2056 + <use xlink:href="{{ asset('/img/icons.svg#pr-prev') }}"></use>
1984 2057 </svg>
1985 2058 </div>
1986 2059 <div class="projects__line"></div>
... ... @@ -1990,7 +2063,9 @@
1990 2063 <button class="projects__btn">Смотреть все</button>
1991 2064 </div>
1992 2065 </section>
  2066 + @endif
1993 2067  
  2068 + @if ($lookin_good->count())
1994 2069 <section class="viewed">
1995 2070 <div class="container viewed-container">
1996 2071 <h2 class="viewed-container__title">
... ... @@ -1998,7 +2073,35 @@
1998 2073 </h2>
1999 2074 <div class="swiper swiper-viewed">
2000 2075 <div class="swiper-wrapper">
2001   - <div class="swiper-slide">
  2076 + @foreach ($lookin_good as $look)
  2077 + <div class="swiper-slide">
  2078 + <div class="viewed__item">
  2079 + <div class="catalog__item">
  2080 + <div class="swiper swiper-catalog-item">
  2081 + <div class="swiper-wrapper">
  2082 + <div class="swiper-slide swiper-slide-catalog">
  2083 + <img class="swiper-slide-catalog-img" width="250px" src="{{ asset(Storage::url($look->image)) }}"
  2084 + alt="">
  2085 + </div>
  2086 + <!--<div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
  2087 + src="../img/product/viewed/v-1-min.png" alt=""></div>
  2088 + <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
  2089 + src="./img/product/viewed/v-1-min.png" alt=""></div>-->
  2090 + </div>
  2091 + <div class="swiper-pagination"></div>
  2092 + </div>
  2093 + </div>
  2094 + <div class="viewed__item-info">
  2095 + <h3 class="viewed__item-title"><a href="{{ route('good', ['good' => $look->id]) }}">{{ $look->title }}</a></h3>
  2096 + <div class="viewed__item-bottom">
  2097 + <p class="viewed__item-price">{{ $look->price }} ₽</p>
  2098 + <button class="viewed__item-btn">В каталог</button>
  2099 + </div>
  2100 + </div>
  2101 + </div>
  2102 + </div>
  2103 + @endforeach
  2104 + <!--<div class="swiper-slide">
2002 2105 <div class="viewed__item">
2003 2106 <div class="catalog__item">
2004 2107 <div class="swiper swiper-catalog-item">
... ... @@ -2132,7 +2235,7 @@
2132 2235 </div>
2133 2236 </div>
2134 2237 </div>
2135   - </div>
  2238 + </div>-->
2136 2239 </div>
2137 2240  
2138 2241 </div>
... ... @@ -2148,7 +2251,7 @@
2148 2251 </div>
2149 2252 </div>
2150 2253 </section>
2151   -
  2254 + @endif
2152 2255  
2153 2256  
2154 2257 <section class="form">
resources/views/layout/admin.blade.php
... ... @@ -239,7 +239,8 @@
239 239 <section class="modal-catalog modal-catalog--hidden js_modal_catalog">
240 240 <h2 class="visually-hidden">Каталог</h2>
241 241 <div class="catalog-accordion-wrapper modal-catalog-left">
242   - <button class="catalog-accordion modal-cat-acc-but js_catalog_accordion">Обработка металла</button>
  242 + @include('part.categories_menu', ['level' => -1, 'parent' => 0])
  243 + <!--<button class="catalog-accordion modal-cat-acc-but js_catalog_accordion">Обработка металла</button>
243 244 <ul class="catalog-accordion-panel modal-cat-panel">
244 245 <li>Циркулярные станки</li>
245 246 <li>Рейсмусы</li>
... ... @@ -314,7 +315,7 @@
314 315 <li>Рейсмусы</li>
315 316 <li>Комбинируемые станки
316 317 по дереву</li>
317   - </ul>
  318 + </ul>-->
318 319 </div>
319 320 <div class="modal-catalog-centre">
320 321 <div class="modal-catalog-top">
... ... @@ -845,6 +846,12 @@
845 846 <script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.js"></script>
846 847 <script src="https://unpkg.com/imask"></script>
847 848 <script src="{{ asset('js/main_js.js') }}"></script>
  849 +<script src="//cdn.ckeditor.com/4.14.0/standard/ckeditor.js"></script>
  850 +<script>
  851 + CKEDITOR.replace( 'feature' );
  852 + CKEDITOR.replace( 'equipment' );
  853 + CKEDITOR.replace( 'description' );
  854 +</script>
848 855 </body>
849 856  
850 857 </html>
resources/views/layout/site.blade.php
... ... @@ -13,6 +13,12 @@
13 13 <link rel="preload" href="{{ asset('fonts/Montserrat-SemiBold.woff2') }}" as="font" type="font/woff2" crossorigin>
14 14 <link rel="stylesheet" href="{{ asset('css/style.css') }}">
15 15 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css" />
  16 + <style>
  17 + .link-btn {
  18 + padding-left: 18px;
  19 + padding-top: 6px;
  20 + }
  21 + </style>
16 22 </head>
17 23  
18 24 <body>
... ... @@ -239,7 +245,8 @@
239 245 <section class="modal-catalog modal-catalog--hidden js_modal_catalog">
240 246 <h2 class="visually-hidden">Каталог</h2>
241 247 <div class="catalog-accordion-wrapper modal-catalog-left">
242   - <button class="catalog-accordion modal-cat-acc-but js_catalog_accordion">Обработка металла</button>
  248 + @include('part.categories_menu', ['level' => -1, 'parent' => 0])
  249 + <!--<button class="catalog-accordion modal-cat-acc-but js_catalog_accordion">Обработка металла</button>
243 250 <ul class="catalog-accordion-panel modal-cat-panel">
244 251 <li>Циркулярные станки</li>
245 252 <li>Рейсмусы</li>
... ... @@ -251,7 +258,8 @@
251 258 <li>Подшипники</li>
252 259 <li>Тиски</li>
253 260 </ul>
254   - <button class="catalog-accordion modal-cat-acc-but cat-acc-two js_catalog_accordion js_cat_acc_two">Лазерные станки</button>
  261 +
  262 + <!--<button class="catalog-accordion modal-cat-acc-but cat-acc-two js_catalog_accordion js_cat_acc_two">Лазерные станки</button>
255 263 <ul class="catalog-accordion-panel">
256 264 <li>Циркулярные станки</li>
257 265 <li>Рейсмусы</li>
... ... @@ -314,7 +322,7 @@
314 322 <li>Рейсмусы</li>
315 323 <li>Комбинируемые станки
316 324 по дереву</li>
317   - </ul>
  325 + </ul>-->
318 326 </div>
319 327 <div class="modal-catalog-centre">
320 328 <div class="modal-catalog-top">
... ... @@ -611,7 +619,8 @@
611 619 Свяжитесь с нами
612 620 </h2>
613 621 <p class="modal-contact-type">Отметьте галочкой предпочтительный канал связи</p>
614   - <form class="modal-parts-content-form" enctype="multipart/form-data" method="post">
  622 + <form class="modal-parts-content-form" action="{{ route('online') }}" enctype="multipart/form-data" method="post">
  623 + @csrf
615 624 <div class="parts-content-form-top">
616 625 <div class="parts-content-form-top-line-one">
617 626 <label class="form__label" for="name">Ваше имя <span class="required">*</span></label>
resources/views/part/categories_menu.blade.php
... ... @@ -0,0 +1,19 @@
  1 +@if ($items->where('parent_id', $parent)->count())
  2 + @php $level++ @endphp
  3 + <? $array = $items->where('parent_id', $parent) ?>
  4 + @foreach ($array as $item)
  5 +
  6 + @if($level)
  7 + <li><a href="{{ route('catalog_detail', $item->id)}}">{{ $item->name }}</a></li>
  8 + @else
  9 + </ul>
  10 + <button class="catalog-accordion modal-cat-acc-but js_catalog_accordion">{{$item->name}}</button>
  11 + <ul class="catalog-accordion-panel modal-cat-panel">
  12 + @endif
  13 + <? /*if($item == end($array)) {?>
  14 + </ul>
  15 + <? $level = -1;
  16 + }*/?>
  17 + @include('part.categories', ['level' => $level, 'parent' => $item->id])
  18 + @endforeach
  19 +@endif
resources/views/simple_good.blade.php
... ... @@ -5,7 +5,7 @@
5 5 <meta charset="UTF-8">
6 6 <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 7 <meta name="viewport" content="width=device-width, initial-scale=1.0">
8   - <title>Vekprom</title>
  8 + <title>Карточка товара</title>
9 9 <link rel="stylesheet" href="{{ asset('css/style.css') }}">
10 10 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.css" />
11 11 </head>
... ... @@ -18,15 +18,16 @@
18 18 <div class="modal-card-wrapper">
19 19 <section class="modal-card">
20 20 <div class="container modal-card-container">
21   - <img src="./img/product/slider/main.png" alt="" class="modal-card__img">
  21 + <!--<div class="modal-card__image"></div-->>
  22 + <img src="{{ asset(Storage::url($good->image)) }}" alt="" class="modal-card__img">
22 23 <div class="modal-card-info">
23   - <h1 class="modal-card-info__title">Установка лазерной резки GWEIKE, серия LF 6025GH</h1>
  24 + <h1 class="modal-card-info__title">{{ $good->title }}</h1>
24 25  
25 26 <div class="modal-card-info-links">
26 27 <a href="#" class="link-item">Получить консультацию</a>
27 28 <a href="#" class="link-item">Заказать запчасти</a>
28 29 </div>
29   - <a class="modal-card-info__btn">Получить консультацию</a>
  30 + <a class="modal-card-info__btn">Узнать цену</a>
30 31 </div>
31 32 </div>
32 33 </section>
... ... @@ -39,10 +40,16 @@
39 40 </ul>
40 41 <div class="modal-spec__tabs-content">
41 42 <!-- таб описание -->
42   - <div class="modal-spec__tabs-item modal-spec__tabs-item_active modal-spec__tab-1 js-modal-spec__tabs-item">
  43 + <div class="modal-spec__tabs-item modal-spec__tabs-item_active modal-spec__tab-1 pr-modal js-modal-spec__tabs-item">
43 44 <div class="description">
44   - <h6 class="description__title">Назначение</h6>
45   - <p class="description__par description__par-1">Данные станки с высокой скоростью и точностью
  45 + <h2 class="spec__tab-3__title">Описание</h2><br>
  46 + <!--<h6 class="description__title">Назначение</h6>-->
  47 + @if (!empty($good->description))
  48 + {!! $good->description !!}
  49 + @else
  50 + <p>Здесь ничего нет</p>
  51 + @endif
  52 + <!--<p class="description__par description__par-1">Данные станки с высокой скоростью и точностью
46 53 предназначены для получистовой и чистовой обработки различного вида
47 54 деталей типа: вал, диск, втулка. Станки обеспечивает высокую эффективность, большие объемы и
48 55 высокую точность обработки.</p>
... ... @@ -88,35 +95,41 @@
88 95 <li class="par__item par-5_item">обработка дуг;</li>
89 96 <li class="par__item par-5_item">разворачивания отверстий;</li>
90 97 <li class="par__item par-5_item">скоростная обработка черных и цветных металлов.</li>
91   - </ul>
  98 + </ul>-->
92 99 </div>
93 100 </div>
94 101 <!-- таб характеристики -->
95 102 <div class="modal-spec__tabs-item modal-spec__tab-2 js-modal-spec__tabs-item">
  103 + <h2 class="spec__tab-3__title">Характеристики</h2>
96 104 <div class="modal-spec-tab-2-table-container">
97   - <table class="modal-spec-tab-2-table">
  105 + @if (!empty($good->feature))
  106 + {!! $good->feature !!}
  107 + @else
  108 + <p>Здесь ничего нет</p>
  109 + @endif
  110 + <!--<table class="modal-spec-tab-2-table js_table_product">
98 111 <thead>
99   - <tr class="spec-table_line line-color">
  112 + <tr class="spec-table_line line-color js_tr">
100 113 <th class="spec-table__title title-main">Model</th>
101   - <th class="spec-table__title title-row">GWEIKE,<br>
  114 + <th class="spec-table__title title-row js_table_title">GWEIKE,<br>
102 115 LF 6025GH</th>
103   - <th class="spec-table__title">GWEIKE,<br>
  116 + <th class="spec-table__title js_table_title">GWEIKE,<br>
104 117 LF 6025GH</th>
105   - <th class="spec-table__title">GWEIKE,<br>
  118 + <th class="spec-table__title js_table_title">GWEIKE,<br>
106 119 LF 6025GH</th>
107   - <th class="spec-table__title">GWEIKE,<br>
  120 + <th class="spec-table__title js_table_title">GWEIKE,<br>
108 121 LF 6025GH</th>
109   - <th class="spec-table__title">GWEIKE,<br>
  122 + <th class="spec-table__title js_table_title">GWEIKE,<br>
110 123 LF 6025GH</th>
111   - <th class="spec-table__title">GWEIKE,<br>
  124 + <th class="spec-table__title js_table_title">GWEIKE,<br>
112 125 LF 6025GH</th>
113 126 </tr>
114   - <tr class="spec-table_line line-two title-main">
  127 + <tr class="spec-table_line line-two title-main js_tr">
115 128 <th>Общие характеристики</th>
116 129 </tr>
117 130 </thead>
118 131 <tbody>
119   - <tr class="spec-table_line line-color">
  132 + <tr class="spec-table_line line-color js_tr">
120 133 <th class="spec-table__title title-main">Длина рабочего стола</th>
121 134 <td class="spec-table__info">289</td>
122 135 <td class="spec-table__info">2879</td>
... ... @@ -126,7 +139,7 @@
126 139 <td class="spec-table__info">288559</td>
127 140  
128 141 </tr>
129   - <tr class="spec-table_line">
  142 + <tr class="spec-table_line js_tr">
130 143 <th class="spec-table__title title-main">Ход траверсы</th>
131 144 <td class="spec-table__info">289</td>
132 145 <td class="spec-table__info">2879</td>
... ... @@ -136,7 +149,7 @@
136 149 <td class="spec-table__info">657</td>
137 150  
138 151 </tr>
139   - <tr class="spec-table_line line-color">
  152 + <tr class="spec-table_line line-color js_tr">
140 153 <th class="spec-table__title title-main">Расстояние между <br>столом и траверсой, мм</th>
141 154 <td class="spec-table__info">289</td>
142 155 <td class="spec-table__info">2879</td>
... ... @@ -146,7 +159,7 @@
146 159 <td class="spec-table__info">288559</td>
147 160  
148 161 </tr>
149   - <tr class="spec-table_line">
  162 + <tr class="spec-table_line js_tr">
150 163 <th class="spec-table__title title-main">Длина рабочего стола</th>
151 164 <td class="spec-table__info">289</td>
152 165 <td class="spec-table__info">2879</td>
... ... @@ -156,7 +169,7 @@
156 169 <td class="spec-table__info">657</td>
157 170  
158 171 </tr>
159   - <tr class="spec-table_line line-color">
  172 + <tr class="spec-table_line line-color js_tr">
160 173 <th class="spec-table__title title-main">Ход траверсы</th>
161 174 <td class="spec-table__info">289</td>
162 175 <td class="spec-table__info">2879</td>
... ... @@ -166,7 +179,7 @@
166 179 <td class="spec-table__info">288559</td>
167 180  
168 181 </tr>
169   - <tr class="spec-table_line">
  182 + <tr class="spec-table_line js_tr">
170 183 <th class="spec-table__title title-main">Расстояние между <br>столом и траверсой, мм</th>
171 184 <td class="spec-table__info">289</td>
172 185 <td class="spec-table__info">2879</td>
... ... @@ -176,7 +189,7 @@
176 189 <td class="spec-table__info">657</td>
177 190  
178 191 </tr>
179   - <tr class="spec-table_line line-color">
  192 + <tr class="spec-table_line line-color js_tr">
180 193 <th class="spec-table__title title-main">Ход траверсы</th>
181 194 <td class="spec-table__info">289</td>
182 195 <td class="spec-table__info">2879</td>
... ... @@ -186,13 +199,14 @@
186 199 <td class="spec-table__info">288559</td>
187 200 </tr>
188 201 </tbody>
189   - </table>
  202 + </table>-->
190 203 </div>
191 204 </div>
192 205 </div>
193 206 </div>
194 207 </section>
195 208  
  209 + @if ($lookin_good->count())
196 210 <section class="modal-viewed">
197 211 <div class="container modal-viewed__container">
198 212 <h3 class="modal-viewed__title">
... ... @@ -200,35 +214,38 @@
200 214 </h3>
201 215 <div class="swiper swiper-modal-viewed">
202 216 <div class="swiper-wrapper">
  217 + @foreach ($lookin_good as $look)
203 218 <div class="swiper-slide">
204 219 <div class="modal-viewed__item">
205   - <div class="catalog__item">
  220 + <div class="catalog__item product-slide">
206 221 <div class="swiper swiper-catalog-item">
207 222 <div class="swiper-wrapper">
  223 +
208 224 <div class="swiper-slide swiper-slide-catalog">
209   - <img class="swiper-slide-catalog-img" src="./img/product/viewed/v-1-min.png" alt="">
  225 + <img class="swiper-slide-catalog-img" src="{{ asset(Storage::url($look->image)) }}" alt="">
210 226 </div>
211   - <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
  227 +
  228 + <!--<div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
212 229 src="../img/product/viewed/v-1-min.png" alt=""></div>
213 230 <div class="swiper-slide swiper-slide-catalog"><img class="swiper-slide-catalog-img"
214   - src="./img/product/viewed/v-1-min.png" alt=""></div>
  231 + src="./img/product/viewed/v-1-min.png" alt=""></div>-->
215 232 </div>
216 233 <div class="swiper-pagination"></div>
217 234 </div>
218 235 </div>
219 236 <div class="modal-viewed__item-info">
220   - <h4 class="modal-viewed__item-title">Установка лазерной
221   - резки GWEIKE</h4>
  237 + <h4 class="modal-viewed__item-title"><a href="{{ route('good', ['good' => $look->id]) }}">{{ $look->title }}</a></h4>
222 238 <div class="modal-viewed__item-bottom">
223   - <p class="modal-viewed__item-price">250 990 ₽</p>
  239 + <p class="modal-viewed__item-price">{{ $look->price }} ₽</p>
224 240 <button class="modal-viewed__item-btn">В каталог</button>
225 241 </div>
226 242 </div>
227 243 </div>
228 244 </div>
229   - <div class="swiper-slide">
  245 + @endforeach
  246 + <!--<div class="swiper-slide">
230 247 <div class="modal-viewed__item">
231   - <div class="catalog__item">
  248 + <div class="catalog__item product-slide">
232 249 <div class="swiper swiper-catalog-item">
233 250 <div class="swiper-wrapper">
234 251 <div class="swiper-slide swiper-slide-catalog">
... ... @@ -254,7 +271,7 @@
254 271 </div>
255 272 <div class="swiper-slide">
256 273 <div class="modal-viewed__item">
257   - <div class="catalog__item">
  274 + <div class="catalog__item product-slide">
258 275 <div class="swiper swiper-catalog-item">
259 276 <div class="swiper-wrapper">
260 277 <div class="swiper-slide swiper-slide-catalog">
... ... @@ -280,7 +297,7 @@
280 297 </div>
281 298 <div class="swiper-slide">
282 299 <div class="modal-viewed__item">
283   - <div class="catalog__item">
  300 + <div class="catalog__item product-slide">
284 301 <div class="swiper swiper-catalog-item">
285 302 <div class="swiper-wrapper">
286 303 <div class="swiper-slide swiper-slide-catalog">
... ... @@ -306,7 +323,7 @@
306 323 </div>
307 324 <div class="swiper-slide">
308 325 <div class="modal-viewed__item">
309   - <div class="catalog__item">
  326 + <div class="catalog__item product-slide">
310 327 <div class="swiper swiper-catalog-item">
311 328 <div class="swiper-wrapper">
312 329 <div class="swiper-slide swiper-slide-catalog">
... ... @@ -329,21 +346,22 @@
329 346 </div>
330 347 </div>
331 348 </div>
332   - </div>
  349 + </div>-->
333 350 </div>
334 351 </div>
335 352 <div class="swiper-button-next swiper-button-next_modal-viewed">
336 353 <svg class="svg-partners-next">
337   - <use xlink:href="../img/icons.svg#pr-next"></use>
  354 + <use xlink:href="{{ asset('/img/icons.svg#pr-next') }}"></use>
338 355 </svg>
339 356 </div>
340 357 <div class="swiper-button-prev swiper-button-prev_modal-viewed">
341 358 <svg class="svg-partners-back">
342   - <use xlink:href="../img/icons.svg#pr-prev"></use>
  359 + <use xlink:href="{{ asset('/img/icons.svg#pr-prev') }}"></use>
343 360 </svg>
344 361 </div>
345 362 </div>
346 363 </section>
  364 + @endif
347 365  
348 366 <section class="modal-form">
349 367 <div class="modal-form__bc"></div>
... ... @@ -366,7 +384,7 @@
366 384  
367 385 <label class="form__label" for="number">Телефон</label>
368 386 <input class="right__form-input form__tel js_input_phone" type="tel" id="number" name="number"
369   - placeholder="+7 ___ - ___ - __ - __">
  387 + placeholder="+7 (___) ___-__-__">
370 388  
371 389 <label class="form__label" for="question">Ваш вопрос <span class="required">*</span></label>
372 390 <textarea class="right__form-input form__question" id="question" name="question" placeholder="Введите текст"
... ... @@ -384,7 +402,8 @@
384 402 </div>
385 403  
386 404 <script src="https://cdn.jsdelivr.net/npm/swiper@9/swiper-bundle.min.js"></script>
387   -<script src="{{ asset('js/main.js') }}"></script>
  405 +<script src="https://unpkg.com/imask"></script>
  406 +<script src="{{ asset('js/main_js.js') }}"></script>
388 407 </body>
389 408  
390 409 </html>
... ... @@ -10,6 +10,7 @@ use App\Http\Controllers\AdminController;
10 10 use App\Http\Controllers\LoginController;
11 11 use App\Http\Controllers\MainController;
12 12 use App\Http\Controllers\RegisterController;
  13 +use Illuminate\Support\Facades\Artisan;
13 14 use Illuminate\Support\Facades\Route;
14 15  
15 16 /*
... ... @@ -46,7 +47,14 @@ Route::get(&#39;company&#39;,[MainController::class, &#39;about_company&#39;])-&gt;name(&#39;company&#39;);
46 47 Route::get('good/{good}',[MainController::class, 'good'])->name('good');
47 48  
48 49 //Упрощенная карточка товара
49   -Route::get('simplegood',[MainController::class, 'simple_good'])->name('simplegood');
  50 +Route::get('simplegood/{good}',[MainController::class, 'simple_good'])->name('simplegood');
  51 +
  52 +//Связаться с нами
  53 +Route::post('online',[MainController::class, 'online'])->name('online');
  54 +
  55 +Route::get('link', function() {
  56 + Artisan::call('storage:link');
  57 +});
50 58  
51 59 Route::group([
52 60 'as' => 'auth.', // имя маршрута, например auth.index
... ... @@ -113,6 +121,18 @@ Route::group([
113 121 */
114 122 Route::resource('goods', GoodController::class, ['except' => ['show']]);
115 123  
  124 + //дополнительный маршрут для показа картинок объектов недвижимости
  125 + Route::get('img/good/{good}', [GoodController::class, 'images_good'])
  126 + ->name('img.good');
  127 +
  128 + //дополнительный маршрут для добавления картинок объектов недвижимости
  129 + Route::post('img/good/{good}', [GoodController::class, 'good_add_img'])
  130 + ->name('img.add.good');
  131 +
  132 + //дополнительный маршрут для удаления картинок объектов недвжимости
  133 + Route::get('img/del/{id}/good/{good}', [GoodController::class, 'good_del_img'])
  134 + ->name('img.del.good');
  135 +
116 136 /*
117 137 * CRUD-операции над категориями
118 138 */