used position arrows

This commit is contained in:
merelendor 2023-07-18 23:46:20 +03:00
parent 52d41265cc
commit c655ae5379
9 changed files with 68 additions and 1407 deletions

View File

@ -145,10 +145,10 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
$arResult['CARS_CATALOG_TITLE'] = "Каталог ".$bodies_ar_res["PROPERTIES"]["GENITIVE_NAME"]["VALUE"];
$catalog_bodies_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_BODY' => $bodies_ar_res['NAME'] ], false, [ 'ID' => [ IBLOCK_ID_CATALOG_CARS_NEW_BODY_PROPERTY_ID ] ]);
$catalog_bodies_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_BODY' => $bodies_ar_res['NAME'] ], false, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ] ]);
while ($catalog_bodies_row = $catalog_bodies_res->Fetch())
{
array_push($arResult['BRANDS_IDS'], $catalog_bodies_row[ IBLOCK_ID_CATALOG_CARS_NEW_BODY_PROPERTY_ID ]);
array_push($arResult['BRANDS_IDS'], $catalog_bodies_row[ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ]);
}
$arResult['BRANDS_IDS'] = array_unique($arResult['BRANDS_IDS']);
}
@ -180,10 +180,10 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
$arResult['CARS_CATALOG_TITLE'] = "Каталог ".$bodies_ar_res["PROPERTIES"]["GENITIVE_NAME"]["VALUE"];
$catalog_bodies_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_BODY' => $bodies_ar_res['NAME'] ], false, [ 'ID' => [ IBLOCK_ID_CATALOG_CARS_NEW_BODY_PROPERTY_ID ] ]);
$catalog_bodies_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_BODY' => $bodies_ar_res['NAME'] ], false, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ] ]);
while ($catalog_bodies_row = $catalog_bodies_res->Fetch())
{
array_push($arResult['BRANDS_IDS'], $catalog_bodies_row[ IBLOCK_ID_CATALOG_CARS_NEW_BODY_PROPERTY_ID ]);
array_push($arResult['BRANDS_IDS'], $catalog_bodies_row[ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ]);
}
$arResult['BRANDS_IDS'] = array_unique($arResult['BRANDS_IDS']);
}

View File

@ -145,10 +145,10 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
$arResult['CARS_CATALOG_TITLE'] = "Каталог ".$engines_ar_res["PROPERTIES"]["GENITIVE_NAME"]["VALUE"];
$catalog_engines_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_ENGINE_FUEL' => $engines_ar_res['NAME'] ], false, [ 'ID' => [ IBLOCK_ID_CATALOG_CARS_NEW_ENGINE_FUEL_PROPERTY_ID ] ]);
$catalog_engines_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_ENGINE_FUEL' => $engines_ar_res['NAME'] ], false, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ] ]);
while ($catalog_engines_row = $catalog_engines_res->Fetch())
{
array_push($arResult['BRANDS_IDS'], $catalog_engines_row[ IBLOCK_ID_CATALOG_CARS_NEW_ENGINE_FUEL_PROPERTY_ID ]);
array_push($arResult['BRANDS_IDS'], $catalog_engines_row[ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ]);
}
$arResult['BRANDS_IDS'] = array_unique($arResult['BRANDS_IDS']);
}
@ -180,14 +180,11 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
$arResult['CARS_CATALOG_TITLE'] = "Каталог ".$engines_ar_res["PROPERTIES"]["GENITIVE_NAME"]["VALUE"];
$catalog_engines_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_ENGINE_FUEL' => $engines_ar_res['NAME'] ], false, [ 'ID' => [ IBLOCK_ID_CATALOG_CARS_NEW_ENGINE_FUEL_PROPERTY_ID ] ]);
$catalog_engines_res = CIBlockElement::GetPropertyValues(IBLOCK_ID_CATALOG_CARS_NEW, [ 'ACTIVE' => 'Y', '=PROPERTY_ENGINE_FUEL' => $engines_ar_res['NAME'] ], false, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ] ]);
while ($catalog_engines_row = $catalog_engines_res->Fetch())
{
//print_r($catalog_engines_row);
array_push($arResult['BRANDS_IDS'], $catalog_engines_row[ IBLOCK_ID_CATALOG_CARS_NEW_ENGINE_FUEL_PROPERTY_ID ]);
array_push($arResult['BRANDS_IDS'], $catalog_engines_row[ PROPERTY_ID_CATALOG_CARS_NEW_BRAND ]);
}
//die();
$arResult['BRANDS_IDS'] = array_unique($arResult['BRANDS_IDS']);
}

View File

@ -289,6 +289,23 @@ $(function()
document.location.href = "/used/";
});
var scrollContainer = $('.scroll_images');
var imageWidth = $('.thumb').outerWidth(true);
var isScrolling = false; // Флаг для определения активного скролла
$('.scroll_images_button').on('click', function() {
if (!isScrolling) {
isScrolling = true;
var direction = $(this).hasClass('scroll_images_button_left') ? 'left' : 'right';
var scrollOffset = direction === 'left' ? -imageWidth : imageWidth;
scrollContainer.animate({scrollLeft: scrollContainer.scrollLeft() + scrollOffset}, 'fast', function() {
isScrolling = false;
});
}
});
$(".thumb").eq(0).addClass("active");
$(".thumb").on("click", function(event)
{

View File

@ -10,6 +10,17 @@
gap: 0 2px;
}
.scroll_images [data-custom-scroll]::-webkit-scrollbar-track {
background: #fff !important;
visibility: hidden;
}
.scroll_images [data-custom-scroll]::-webkit-scrollbar-thumb {
background: #fff;
border-radius: 0px !important;
visibility: hidden;
}
@media all and (max-width: 768px) {
.scroll_images {
margin: 2px -16px;
@ -40,7 +51,7 @@
margin-bottom: 15px;
gap: 0;
}
}
}
.thumb {
display: flex;
@ -309,22 +320,38 @@
}
.scroll_images_button {
width: 50px;
height: 50px;
width: 36px;
height: 36px;
border-radius: 25px;
background-color: #1c01a9;
position: absolute;
display: none;
display: block;
top: 50%;
transform: translateY(-18px);
bottom: 0;
cursor: pointer;
}
@media all and (min-width: 768px) and (max-width: 1024px) {
.scroll_images_button {
display: none;
}
}
.scroll_images_button_left {
left: 0px;
top: 50%;
left: 3px;
background-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M27 16H5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M14 7L5 16L14 25' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-size: 19px;
background-position: center;
}
.scroll_images_button_right {
right: 0px;
top: 50%;
right:3px;
background-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 16H27' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M18 7L27 16L18 25' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
background-repeat: no-repeat;
background-size: 19px;
background-position: center;
}
.car_container_used {

File diff suppressed because one or more lines are too long

View File

@ -1099,7 +1099,7 @@ section[data-page] {
[data-custom-scroll]::-webkit-scrollbar {
width: 4px;
height: 14px;
height: 4px;
}
[data-custom-scroll]::-webkit-scrollbar-track {

View File

@ -1,5 +1,4 @@
<?
//$_SERVER["DOCUMENT_ROOT"] = __DIR__;
define('STOP_STATISTICS', true);
define('NO_KEEP_STATISTIC', 'Y');
define('NO_AGENT_STATISTIC', 'Y');
@ -36,32 +35,8 @@ $content = file_get_contents($api_used_url, false, stream_context_create($arrCon
print $api_used_url."\n\n";
file_put_contents("get_catalog_izt.json", $content);
$json = json_decode($content, true);
/*
$bitrix_brands = [];
$bitrix_models = [];
$brand_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_BRANDS, ], false, false, [] );
while($brand_search_ob = $brand_search_res->GetNextElement())
{
$brand_search = $brand_search_ob->GetFields();
$brand_search['PROPERTIES'] = $brand_search_ob->GetProperties();
$bitrix_brands[$brand_search['PROPERTIES']['UID']['VALUE']] = $brand_search['ID'];
}
$models_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODELS, ], false, false, [] );
while($models_search_ob = $models_search_res->GetNextElement())
{
$model_search = $models_search_ob->GetFields();
$model_search['PROPERTIES'] = $models_search_ob->GetProperties();
$bitrix_models[$model_search['PROPERTIES']['UID']['VALUE']] = $model_search['ID'];
}
*/
$flags = [];
$flag_names = [ "SPECIAL_OFFER", "LEASING_AVAILABLE", "AFTER_ACCIDENT" ];
@ -71,10 +46,7 @@ foreach($flag_names AS $f)
while ($prop_fields = $properties->GetNext())
{
$flags[ $f ] = $prop_fields["ID"];
//print_r($prop_fields)."\n";
//print $prop_fields["ID"]." - ".$prop_fields["NAME"]."\n";
}
}
}
print "flags\n";
@ -146,20 +118,6 @@ foreach($json AS $entry)
"name" => $model_name,
];
}
/*
if(!isset($api_data_titles[ $brand_name ]['models'][ $model_name ]))
{
$api_data_titles[ $brand_name ]['models'][ $model_name ] = [
"modifications" => []
];
}
if(!in_array($model_id, $api_models))
{
array_push($api_models, $model_id);
}
*/
}
print_r($api_data);
@ -316,12 +274,6 @@ function resize_image($image, $filename, $width, $height, $quality)
$mime = mime_content_type($tempfile_metadata['uri']);
$ext = get_ext_from_mime($mime);
//$source = imagecreatefromjpeg($file_full_path_original);
//$tempfile = tmpfile();
//fwrite($tempfile, $image);
//$tempfile_metadata = stream_get_meta_data($tempfile);
$resized = imagecreatetruecolor($width, $height);
$source = imagecreatefromstring($image);
@ -336,9 +288,6 @@ function resize_image($image, $filename, $width, $height, $quality)
imagejpeg($resized, $tempfile_filename, $quality);
//header("Content-type: image/jpeg");
//imagejpeg($resized, null, 100);
imagedestroy($source);
imagedestroy($resized);
imagedestroy($panel);
@ -349,27 +298,6 @@ function resize_image($image, $filename, $width, $height, $quality)
fclose($tempfile);
/*
$file_path = CFile::GetPath($saved_file_id);
print "file_path\n";
print_r($file_path);
print "\n\n";
//die();
$file_full_path_original = $_SERVER["DOCUMENT_ROOT"].$file_path;
$file_full_path_resized = $_SERVER["DOCUMENT_ROOT"].$file_path."_resized";
$new_main_photo_name = $main_photo_path."_resized";
$file['tmp_name'] = $main_photo_path_resized;
$file['old_file'] = $saved_file_id;
$file['del'] = true;
$saved_file_id = CFile::SaveFile($file, "used");
fclose($tempfile);
*/
return $saved_file_id;
}
@ -470,6 +398,8 @@ foreach($json as $car)
$el = new CIBlockElement;
$el->Update($car_existed['ID'], ["ACTIVE" => "Y", "NAME" => $name, "SORT" => 500]);
CIBlockElement::SetPropertyValuesEx($car_existed['ID'], IBLOCK_ID_CATALOG_CARS_USED, $PROPERTY_VALUES, []);
}
}

View File

@ -82,7 +82,7 @@ $arUrlRewrite=array (
),
array (
'CONDITION' => '#^/catalog/kuzov-([a-zA-Z0-9_-]+)/\\??.*$#',
'CONDITION' => '#^/catalog/kuzov-([a-zA-Z0-9_-]+)/#',
'RULE' => 'TYPE=body&BODY_SLUG=$1',
'ID' => '',
'PATH' => '/catalog/landing.php',
@ -90,7 +90,7 @@ $arUrlRewrite=array (
),
array (
'CONDITION' => '#^/catalog/dvigatel-([a-zA-Z0-9_-]+)/\\??.*$#',
'CONDITION' => '#^/catalog/dvigatel-([a-zA-Z0-9_-]+)/#',
'RULE' => 'TYPE=engine_fuel&ENGINE_FUEL_SLUG=$1',
'ID' => '',
'PATH' => '/catalog/landing.php',

View File

@ -1,6 +1,6 @@
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->AddChainItem("Подержанные автомобили", "/used/");
$APPLICATION->AddChainItem("С пробегом", "/used/");
?>
<?
$APPLICATION->IncludeComponent("bitrix:breadcrumb", "evolution", Array(