Compare commits

...

2 Commits

Author SHA1 Message Date
nimtaurel 24fb31b101 Merge pull request 'nim_style acc' (#10) from nim_style into master
Reviewed-on: #10
2025-04-25 11:25:33 +00:00
nimtaurel d20b3646e2 nim_style acc 2025-04-25 16:24:43 +05:00
10 changed files with 213 additions and 140 deletions

View File

@ -236,6 +236,7 @@ class MobileApiController extends Controller
$bodywork = $request->query('bodywork');
$marks = UniModel::model('pipi_brand_models')->get();
$availableMarks = [];
if ($class) {

View File

@ -1,68 +1,5 @@
<div class="row">
<div class="col-12 col-md-6">
<div class="col-12 col-lg-3 col-md-5 col-sm-5">
@include('platform.user_profile::user',['name'=>$user->name, 'about'=>$user->about])
</div>
<div class="col-12 col-md-6">
@if(config('platform.company.enabled'))
@include('platform.user_profile::company')
@endif
</div>
<div class="col-12 col-md-12">
@if(config('platform.company.enabled'))
@include('platform.user_profile::companylist')
@endif
</div>
</div>
{{--<?php--}}
{{--$roles = \A7kz\Platform\Models\UniModel::model('core_roles')->get();--}}
{{--$rows = \A7kz\Platform\Models\UniModel::model('core_applications')->get(['name','description']);--}}
{{--$applications = [];--}}
{{--foreach ($rows as $row){--}}
{{-- $applications[$row->name] = $row->description;--}}
{{--}--}}
{{--$actions = [--}}
{{-- 'default'=>'Просмотр списка значений',--}}
{{-- 'add'=>'Создание записи',--}}
{{-- 'edit' =>'Редактирование записи',--}}
{{-- 'delete'=>'Удаление записи',--}}
{{-- 'show' => 'Просмотр записи',--}}
{{-- 'open'=>'Открыть документ',--}}
{{-- 'edit_tree' => 'Редактировать дерево',--}}
{{-- 'terminate_document_impact' => 'Прекращение документа',--}}
{{-- 'stop_deductions' => 'прекратить отчисления',--}}
{{-- 'excel' => 'Генерация excel документа',--}}
{{-- 'report' => 'Отчет',--}}
{{-- 'print' => 'Версия для печати',--}}
{{-- 'lock' => 'Блокировка',--}}
{{-- 'generate' => 'Сгенерировать',--}}
{{-- 'accept' => 'Применить',--}}
{{-- 'decline' => 'Отклонить',--}}
{{-- 'save' => 'Сохранить запись',--}}
{{--]--}}
{{--?>--}}
{{--<div class="row">--}}
{{-- <div class="col-12">--}}
{{-- <table class="table">--}}
{{-- <tr>--}}
{{-- <th>Роль</th><th>Приложение</th><th>Доступное действие</th>--}}
{{-- </tr>--}}
{{-- @foreach ($roles as $role)--}}
{{-- <?php--}}
{{-- $apps = json_decode($role->actions, true);--}}
{{-- ?>--}}
{{-- @foreach($apps as $app_code=>$app)--}}
{{-- @foreach($app as $action=>$v)--}}
{{-- <tr>--}}
{{-- <td>{{$role->name}}</td><td>{{$applications[$app_code] ?? $app_code}}</td><td>{{$actions[$action] ?? $action}}</td>--}}
{{-- </tr>--}}
{{-- @endforeach--}}
{{-- @endforeach--}}
{{-- @endforeach--}}
{{-- </table>--}}
{{-- </div>--}}
{{--</div>--}}

View File

@ -1,15 +1,16 @@
<div class="row">
<div class="col">
<div class="card mb-4">
<div class="card mb-4 profile-info">
<div class="card-body">
@php($profile_image = auth()->user()->profile_image)
<div class="d-flex">
<div class="profile-img">
<div class="d-flex flex-column justify-content-center align-content-center profile-content">
<div class="profile-img d-flex justify-content-center align-content-center mb-3">
<img src="@if($profile_image == null) {{asset("img/avatar.png") }} @else {{ asset("storage/$profile_image") }} @endif" id="image_preview_container" alt="profile_image">
</div>
<div class="ms-3">
<div class="d-flex flex-column justify-content-center align-items-center">
<h5 class="mb-0">{{$name}}</h5>
<p class="text-muted mb-3">{{$about}}</p>
<p class="text-muted mb-0" >{{$about}}</p>
<hr style="height: 1px; color:#a8a8a8; width: 100%">
<div class="form-group mb-2">
<label>@lang("Электронная почта")</label>
<p class="text-muted m-0">{{$user->email}} @if(is_null($user->email_verified_at)) <a href="#" class="btn btn-outline-primary">@lang("Подтвердить")</a> @endif</p>

View File

@ -6,7 +6,6 @@
font-size: 20px;
}
</style>
<x-component name="Tabs" />
<form method="POST" enctype="multipart/form-data" id="profile_setup_frm" action="{{lurl('app/user.profile/edit')}}">
<div class="global-actions">
<div class="left-content">
@ -32,7 +31,7 @@
@csrf
<div class="col-md-10 mt-3">
<div class="d-flex justify-content-center align-items-center flex-column">
<label class="labels"><span style="width: 20px; height: 20px; background-color: #E58F65; color: white; border-radius: 50%; padding: 5px 7px"><i class="bi bi-pen"></i></span>{{__(" Редактировать профиль")}}</label>
<label class="labels"><span style="width: 20px; height: 20px; background-color: #01b0e8; color: white; border-radius: 50%; padding: 5px 7px"><i class="bi bi-pen"></i></span>{{__(" Редактировать профиль")}}</label>
</div>
<div class="row mt-3">
<div class="col-md-6 mb-3">
@ -55,7 +54,7 @@
</div>
</div>
<div class="d-flex justify-content-center align-items-center flex-column mt-3">
<label class="labels"><span style="width: 20px; height: 20px; background-color: #E58F65; color: white; border-radius: 50%; padding: 7px 5px 3px 5px"><i class="bi bi-key"></i></span>{{__(" Сменить пароль")}}</label>
<label class="labels"><span style="width: 20px; height: 20px; background-color: #01b0e8; color: white; border-radius: 50%; padding: 7px 5px 3px 5px"><i class="bi bi-key"></i></span>{{__(" Сменить пароль")}}</label>
</div>
<div class="row mt-2">
<div class="col-md-6 mb-3">

View File

@ -21,21 +21,27 @@ class Main extends Component
parent::__construct($params, $module);
$this->template = 'pipicar::main.views.main';
$class_filters = Request::input('class_filters') ?? null;
$started_at = Request::input('started_at') ?? null;
$ended_at = Request::input('ended_at') ?? null;
$bodywork_filters = Request::input('bodywork_filters') ?? null;
$request = new \Illuminate\Http\Request([
'started_at' => Carbon::now()->toDateString(),
'ended_at' => Carbon::now()->addDays(3)->toDateString(),
]);
$response = (new \App\Http\Controllers\MobileApiController)->getAvailableMarksList($request);
$this->params['cars'] = collect($response->getData(true));
// $class_filters = Request::input('class_filters') ?? null;
// $response = Http::get('https://cvm10.a7.kz/api/mobile/getAvailableMarksList', [
// $request = new \Illuminate\Http\Request([
// 'started_at' => Carbon::now()->toDateString(),
// 'ended_at' => Carbon::now()->addDays(3)->toDateString(),
// ]);
// $this->params['cars'] = collect($response->json());
//
// $response = (new \App\Http\Controllers\MobileApiController)->getAvailableMarksList($request);
// $this->params['cars'] = collect($response->getData(true));
// dd($class_filters, $started_at, $ended_at, $bodywork_filters);
$response = Http::get('https://cvm10.a7.kz/api/mobile/getAvailableMarksList', [
'started_at' => $started_at ?? Carbon::now()->toDateString(),
'ended_at' => $ended_at ?? Carbon::now()->addDays(3)->toDateString(),
'class' => $class_filters ?? null,
'bodywork' => $bodywork_filters ?? null,
]);
$this->params['cars'] = collect($response->json());
}
}

View File

@ -8,51 +8,51 @@
<div class="col-12 col-md-3 card-catalog-left-container">
<div class="text-end">
<button class="btn btn-outline" id="toggleFilterBtn">
@lang('Фильтр')
<i class="bi bi-filter-right" style="vertical-align: -.1em;"></i>@lang('Фильтр')
</button>
</div>
<div class="card card-catalog-left-filter collapsible collapsed" id="filterCard">
<div class="card-body">
{{-- Дата начала --}}
<form method="GET" id="filter">
<div class="form-group mb-3 pb-4 d-flex flex-column justify-content-around align-content-center">
<label class="form-label d-block">Даты аренды</label>
<div class="d-flex flex-row justify-content-around align-content-center">
<input type="text"
class="form-control"
name="started_at"
id="started_at"
autocomplete="off"
inputmode="numeric"
pattern="\d{2}\.\d{2}\.\d{4}"
placeholder="дд.мм.гггг"
value="{{ request('started_at') }}"
style="max-width: 120px">
<span class="separator"></span>
<input type="text"
class="form-control"
name="ended_at"
id="ended_at"
autocomplete="off"
inputmode="numeric"
pattern="\d{2}\.\d{2}\.\d{4}"
placeholder="дд.мм.гггг"
value="{{ request('ended_at') }}"
style="max-width: 120px">
<div class="form-group mb-3 pb-4 d-flex flex-column justify-content-around align-content-center">
<label class="form-label d-block">Даты аренды</label>
<div class="d-flex flex-row justify-content-around align-content-center">
<input type="text"
class="form-control"
name="started_at"
id="started_at"
autocomplete="off"
inputmode="numeric"
pattern="\d{2}\.\d{2}\.\d{4}"
placeholder="дд.мм.гггг"
value="{{ request('started_at') }}"
style="max-width: 120px">
<span class="separator"></span>
<input type="text"
class="form-control"
name="ended_at"
id="ended_at"
autocomplete="off"
inputmode="numeric"
pattern="\d{2}\.\d{2}\.\d{4}"
placeholder="дд.мм.гггг"
value="{{ request('ended_at') }}"
style="max-width: 120px">
</div>
</div>
</div>
{{-- Класс авто --}}
{{-- Класс авто --}}
<div class="mb-3 pb-4">
<label class="form-label d-block">Класс авто</label>
<div class="btn-group" role="group" aria-label="Класс">
<input type="checkbox" class="btn-check" name="class_filters[]" value="1" id="class_option1" {{ in_array('1', (array) request('class_filters')) ? 'checked' : '' }}>
<input type="checkbox" class="btn-check" name="class_filters[]" value="Эконом" id="class_option1" {{ in_array('Эконом', (array) request('class_filters')) ? 'checked' : '' }}>
<label class="btn btn-outline-primary" for="class_option1">Эконом</label>
<input type="checkbox" class="btn-check" name="class_filters[]" value="2" id="class_option2" {{ in_array('2', (array) request('class_filters')) ? 'checked' : '' }}>
<input type="checkbox" class="btn-check" name="class_filters[]" value="Средний" id="class_option2" {{ in_array('Средний', (array) request('class_filters')) ? 'checked' : '' }}>
<label class="btn btn-outline-primary" for="class_option2">Средний</label>
<input type="checkbox" class="btn-check" name="class_filters[]" value="3" id="class_option3" {{ in_array('3', (array) request('class_filters')) ? 'checked' : '' }}>
<input type="checkbox" class="btn-check" name="class_filters[]" value="Бизнес" id="class_option3" {{ in_array('Бизнес', (array) request('class_filters')) ? 'checked' : '' }}>
<label class="btn btn-outline-primary" for="class_option3">Бизнес</label>
</div>
</div>
@ -60,21 +60,26 @@
<div class="mb-3 pb-4">
<label class="form-label d-block">Тип кузова</label>
<div class="btn-group" role="group" aria-label="Кузов">
<input type="checkbox" class="btn-check" name="bodywork_filters[]" value="1" id="bodywork_option1" {{ in_array('1', (array) request('bodywork_filters')) ? 'checked' : '' }}>
<input type="checkbox" class="btn-check" name="bodywork_filters[]" value="Седан" id="bodywork_option1" {{ in_array('Седан', (array) request('bodywork_filters')) ? 'checked' : '' }}>
<label class="btn btn-outline-primary" for="bodywork_option1">Седан</label>
<input type="checkbox" class="btn-check" name="bodywork_filters[]" value="2" id="bodywork_option2" {{ in_array('2', (array) request('bodywork_filters')) ? 'checked' : '' }}>
<input type="checkbox" class="btn-check" name="bodywork_filters[]" value="Кроссовер" id="bodywork_option2" {{ in_array('Кроссовер', (array) request('bodywork_filters')) ? 'checked' : '' }}>
<label class="btn btn-outline-primary" for="bodywork_option2">Кроссовер</label>
<input type="checkbox" class="btn-check" name="bodywork_filters[]" value="3" id="bodywork_option3" {{ in_array('3', (array) request('bodywork_filters')) ? 'checked' : '' }}>
<input type="checkbox" class="btn-check" name="bodywork_filters[]" value="Внедорожник" id="bodywork_option3" {{ in_array('Внедорожник', (array) request('bodywork_filters')) ? 'checked' : '' }}>
<label class="btn btn-outline-primary" for="bodywork_option3">Внедорожник</label>
</div>
</div>
{{-- Кнопка --}}
<button type="submit" class="btn btn-success" style="width: 100%; font-size: 14px">
@lang('Искать')
</button>
{{-- Кнопка --}}
<div class="filter-buttons d-flex" style="gap: 5px;">
<button type="submit" class="btn btn-danger w-100" id="filter_reset" onclick="resetForm()">
@lang('Сбросить')
</button>
<button type="submit" class="btn btn-success w-100">
@lang('Искать')
</button>
</div>
</form>
</div>
</div>
@ -106,12 +111,12 @@
</div>
</div>
</div>
<div class="col-12 col-md-9 mb-4 d-flex justify-content-center">
<div class="row custom-row">
<div class="col-12 col-md-9 mb-4 d-flex">
<div class="row custom-row w-100">
@php $carsValues = array_values($cars->toArray()); @endphp
@foreach($carsValues as $car)
<div class="col-12 col-md-6 mb-4">
<div class="car-card">
<div class="car-card flex-grow-1">
<img class="img-fluid" src="{{ $car['photo'] ?? asset('img/default.png') }}" alt="Car Image">
<div class="title">{{ $car['brand'] . ' ' . $car['mark'] . ' - ' . $car['year'] }}</div>
<div class="card-car-chars">
@ -157,10 +162,18 @@
const toggleBtn = document.getElementById('toggleFilterBtn');
const filterCard = document.getElementById('filterCard');
let isExpanded = false;
// Инициализация состояния по localStorage
let isExpanded = localStorage.getItem('filterOpened') === 'true';
toggleBtn.addEventListener('click', function () {
if (!isExpanded) {
if (isExpanded) {
filterCard.classList.add('expanded');
filterCard.style.transition = 'max-height 1.2s ease, opacity 1.2s ease';
}
toggleBtn.addEventListener('click', function (e) {
e.preventDefault();
if (!filterCard.classList.contains('expanded')) {
filterCard.style.transition = 'max-height 1.2s ease, opacity 1.2s ease';
filterCard.classList.add('expanded');
isExpanded = true;
@ -169,6 +182,60 @@
filterCard.classList.remove('expanded');
isExpanded = false;
}
localStorage.setItem('filterOpened', isExpanded);
});
});
document.querySelectorAll('input[name="class_filters[]"]').forEach(checkbox => {
checkbox.addEventListener('click', function () {
if (this.checked) {
const wasChecked = this.dataset.checked === "true";
document.querySelectorAll('input[name="class_filters[]"]').forEach(cb => {
cb.checked = false;
cb.dataset.checked = "false";
});
if (!wasChecked) {
this.checked = true;
this.dataset.checked = "true";
}
} else {
this.dataset.checked = "false";
}
});
});
document.querySelectorAll('input[name="bodywork_filters[]"]').forEach(checkbox => {
checkbox.addEventListener('click', function () {
if (this.checked) {
const wasChecked = this.dataset.checked === "true";
document.querySelectorAll('input[name="bodywork_filters[]"]').forEach(cb => {
cb.checked = false;
cb.dataset.checked = "false";
});
if (!wasChecked) {
this.checked = true;
this.dataset.checked = "true";
}
} else {
this.dataset.checked = "false";
}
});
});
function resetForm() {
const form = document.getElementById('filter');
form.querySelectorAll('input').forEach(input => {
if (input.type === 'checkbox' || input.type === 'radio') {
input.checked = false;
} else {
input.value = '';
}
});
window.location.href = window.location.origin + window.location.pathname;
}
</script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -235,6 +235,13 @@ iframe {
border-color: #01b0e8;
}
}
.filter-buttons {
button {
font-size: 14px;
padding: 5px 12px;
}
}
}
.collapsible {
@ -247,3 +254,25 @@ iframe {
max-height: 1000px;
opacity: 1;
}
.profile-info {
padding: 0;
.card-body {
.profile-content {
.profile-img {
width: 100%;
height: 100%;
padding: 50px 50px 20px;
img {
border-radius: 50%;
}
}
.btn {
font-size: 14px;
padding: 5px 12px;
}
}
}
}

View File

@ -92,12 +92,15 @@ $nav = \A7kz\Platform\Modules\Platform\Navigation\Facades\Nav::config();
{{ $autoNav->label }}
</a>
<ul class="dropdown-menu">
@foreach($autoNav->childs as $child)
@foreach(collect($autoNav->childs) as $child)
<li>
<a class="dropdown-item" href="{{ '/' . app()->getLocale() . '/' . ltrim($child->link ?? '#', '/') }}">
{{ $child->label ?? 'Без названия' }}
</a>
</li>
@if (!$loop->last)
<li><hr class="dropdown-divider"></li>
@endif
@endforeach
</ul>
</li>
@ -126,16 +129,46 @@ $nav = \A7kz\Platform\Modules\Platform\Navigation\Facades\Nav::config();
@else
<div class="right-cont">
<a class="item-nav user"
href="@if(config('platform.user_profile.enabled')){{\A7kz\Platform\Modules\Platform\Core\Facades\Core::url('user.profile')}}@else{{'#'}}@endif">
<i class="bi bi-person-fill"></i>
{{ Auth::user()->name }}
</a>
<a class="item-nav logout btn btn-primary" href="{{ lurl('logout') }}"
onclick="event.preventDefault();document.getElementById('logout-form').submit();">
Выйти
</a>
<form id="logout-form" action="{{ lurl('logout') }}" method="POST" class="d-none">@csrf</form>
<div class="dropdown">
<a class="item-nav user dropdown-toggle" href="#" role="button" id="userDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-person-fill"></i>
{{ Auth::user()->name }}
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="userDropdown">
@if(config('platform.user_profile.enabled'))
<li>
<a class="dropdown-item" href="{{ \A7kz\Platform\Modules\Platform\Core\Facades\Core::url('user.profile') }}">
Личный кабинет
</a>
</li>
<li>
<a class="dropdown-item" href="{{ \A7kz\Platform\Modules\Platform\Core\Facades\Core::url('user.profile') }}">
Заявки
</a>
</li>
<li>
<a class="dropdown-item" href="{{ \A7kz\Platform\Modules\Platform\Core\Facades\Core::url('user.profile') }}">
Бронирования
</a>
</li>
<li>
<a class="dropdown-item" href="{{ \A7kz\Platform\Modules\Platform\Core\Facades\Core::url('user.profile') }}">
История заказов
</a>
</li>
@endif
<li><hr class="dropdown-divider"></li>
<li>
<a class="dropdown-item logout" href="{{ lurl('logout') }}"
onclick="event.preventDefault();document.getElementById('logout-form').submit();">
Выйти
</a>
<form id="logout-form" action="{{ lurl('logout') }}" method="POST" class="d-none">@csrf</form>
</li>
</ul>
</div>
</div>
@endguest
</div>