From 0d86fd7ad05c1676e909891658dc2d2d6892ff0f Mon Sep 17 00:00:00 2001 From: alex-chevski Date: Fri, 15 Dec 2023 14:23:19 +0300 Subject: [PATCH] complete create plan --- app/Livewire/Plan/Create.php | 28 +- .../views/livewire/plan/create.blade.php | 752 +++++++----------- 2 files changed, 311 insertions(+), 469 deletions(-) diff --git a/app/Livewire/Plan/Create.php b/app/Livewire/Plan/Create.php index ad02c5d..98bdc2e 100644 --- a/app/Livewire/Plan/Create.php +++ b/app/Livewire/Plan/Create.php @@ -31,6 +31,9 @@ class Create extends Component public $input_items_2 = ""; public $input_items_3 = ""; + public $isVisibleDuration = false; + public $isVisibleState = false; + protected function rules() { $rules = [ @@ -66,6 +69,29 @@ class Create extends Component return view('livewire.plan.create'); } + public function showListDuration() + { + $this->isVisibleDuration = !$this->isVisibleDuration; + } + + public function showListState() + { + $this->isVisibleState = !$this->isVisibleState; + } + + public function toggleDuration($duration) + { + $this->duration = $duration; + $this->isVisibleDuration = false; + } + + + public function toggleState($state) + { + $this->state = $state; + $this->isVisibleState = false; + } + public function addPacketOption($options_type, $options_type_input) { $this->$options_type['short'] = $this->$options_type_input['short']; @@ -110,7 +136,7 @@ class Create extends Component public function showPreview() { - $this->state = "inactive"; + $this->state = "unactive"; $this->publish(); } } diff --git a/resources/views/livewire/plan/create.blade.php b/resources/views/livewire/plan/create.blade.php index ad334b1..ff9f1dc 100644 --- a/resources/views/livewire/plan/create.blade.php +++ b/resources/views/livewire/plan/create.blade.php @@ -53,59 +53,44 @@
- +
+ Длительность плана питания +
- @@ -119,53 +104,39 @@ Статус
+
@@ -173,10 +144,10 @@
+
-
Описание @@ -206,260 +177,30 @@ });" wire:key="myIdentifierHere" x-ref="myIdentifierHere" wire:model="details"> -
-
- - -
-
-
Оказание услуг
-
- -
-
-
- - - -
- @if($packets_count === 1) -
-
-
-
- - -
-
- - -
-
-
- - -
- - @isset($packet1_options['items']) -
    - @foreach($packet1_options['items'] as $item) -
  • - {{ $item }} -
  • - @endforeach -
- @endisset -
-
- -
-
- -
-
-
- @endif - - @if($packets_count === 3) -
-
-
-
- - -
-
- - -
-
-
- - -
- - @isset($packet1_options['items']) -
    - @foreach($packet1_options['items'] as $item) -
  • - {{ $item }} -
  • - @endforeach -
- @endisset -
-
- -
-
- -
-
-
-
-
-
- - -
-
- - -
-
-
- - -
- - @isset($packet2_options['items']) -
    - @foreach($packet2_options['items'] as $item) -
  • - {{ $item }} -
  • - @endforeach -
- @endisset -
-
- -
-
- -
-
-
-
-
-
- - -
-
- - -
-
-
- - -
- - @isset($packet3_options['items']) -
    - @foreach($packet3_options['items'] as $item) -
  • - {{ $item }} -
  • - @endforeach -
- @endisset -
-
- -
-
- -
+
-
-
-
- ОКАЗАНИЕ УСЛУГ -
-
- - -
+ +
+
+
+ ОКАЗАНИЕ УСЛУГ +
+
+ +
- - @if ($packets_count === 1) -
-
-
-
-
-
- Краткое описание -
- -
-
-
- Цена -
- -
-
-
-
-
- Описание услуги: -
- -
-
- -
-
-
- Содержание услуги -
- @isset($packet1_options['items']) -
    - @foreach ($packet1_options['items'] as $item) -
  • - {{ $item }} -
  • - @endforeach -
- @endisset -
-
- -
-
- -
- -
-
-
-
-
- @endif -
- @if ($packets_count === 3) - - + @if ($packets_count === 1)
@@ -500,7 +241,7 @@ Содержание услуги
@isset($packet1_options['items']) -
    +
      @foreach ($packet1_options['items'] as $item)
    • {{ $item }} @@ -508,166 +249,242 @@ @endforeach
    @endisset -
    -
    - -
    -
    - -
    +
    +
    + + + +
+
+ @endif - - -
-
-
-
-
-
- Краткое описание -
- -
-
-
- Цена - - - 2 вариант - -
- + @if ($packets_count === 3) +
+
+
+
+
+
+ Краткое описание
+
-
-
-
- Описание услуги: -
- +
+
+ Цена + + + 1 вариант +
+
- -
-
-
- Содержание услуги -
- @isset($packet2_options['items']) -
    - @foreach ($packet2_options['items'] as $item) -
  • - {{ $item }} -
  • - @endforeach -
- @endisset -
-
- -
-
- -
- -
+
+
+
+
+ Описание услуги:
+ +
+
+ +
+
+
+ Содержание услуги +
+ @isset($packet1_options['items']) +
    + @foreach ($packet1_options['items'] as $item) +
  • + {{ $item }} +
  • + @endforeach +
+ @endisset + +
+ +
+ + + + +
+
+
+
+
+ + + +
+
+
+
+
+
+ Краткое описание +
+ +
+
+
+ Цена + + + 2 вариант + +
+ +
+
+
+
+
+ Описание услуги: +
+ +
+
+ + +
+
+
+ Содержание услуги +
+ @isset($packet2_options['items']) +
    + @foreach ($packet2_options['items'] as $item) +
  • + {{ $item }} +
  • + @endforeach +
+ @endisset + +
+ +
+ + + + +
+
+ +
+
+
+ + + +
+
+
+
+
+
+ Краткое описание +
+ +
+
+
+ Цена + + + 3 вариант + +
+ +
+
+
+
+
+ Описание услуги: +
+ +
+
+ + +
+
+
+ Содержание услуги +
+ @isset($packet3_options['items']) +
    + @foreach ($packet3_options['items'] as $item) +
  • + {{ $item }} +
  • + @endforeach +
+ @endisset + +
+ +
+ + + +
+
+ +
-
-
-
-
-
-
- Краткое описание -
- -
-
-
- Цена - - - 3 вариант - -
- -
-
-
-
-
- Описание услуги: -
- -
-
- -
-
-
- Содержание услуги -
- @isset($packet3_options['items']) -
    - @foreach ($packet3_options['items'] as $item) -
  • - {{ $item }} -
  • - @endforeach -
- @endisset -
-
- -
-
- -
- -
-
-
-
-
@endif + + + + + + + + + + @if ($errors)
    @@ -687,7 +504,6 @@ class="diet__btn btn btn-primary">Опубликовать
-
- @endif - + +