Merge branch 'master' of https://github.com/merelendor/evoleasing-site
This commit is contained in:
commit
d9cb483bc8
258
api/index.php
258
api/index.php
@ -355,13 +355,30 @@ switch($PARAM_1)
|
||||
{
|
||||
if($auth['username'] !== 'crm') { header('HTTP/1.0 401 Unauthorized'); print json_encode(["status" => "error", "error" => "unauthorized", "message" => "Unauthorized"]); die(); }
|
||||
|
||||
$email = $REQ['email'];
|
||||
$phone = (int)$REQ['phone'];
|
||||
$password = $REQ['password'];
|
||||
|
||||
if(empty($email) && empty($phone))
|
||||
{
|
||||
header('HTTP/1.0 400 Bad Request'); print json_encode(["status" => "error", "error" => "empty email and phone", "message" => "Bad Request"]); die();
|
||||
}
|
||||
|
||||
$real_email = true;
|
||||
if(empty($email))
|
||||
{
|
||||
$email = $phone."@evoleasing.ru";
|
||||
$real_email = false;
|
||||
$password = md5($email);
|
||||
}
|
||||
|
||||
$profile = [
|
||||
"XML_ID" => $REQ['crm_id'],
|
||||
"LOGIN" => $REQ['email'],
|
||||
"LOGIN" => $email,
|
||||
"NAME" => $REQ['firstname'],
|
||||
"SECOND_NAME" => $REQ['secondname'],
|
||||
"LAST_NAME" => $REQ['lastname'],
|
||||
"EMAIL" => $REQ['email'],
|
||||
"EMAIL" => $email,
|
||||
"UF_ORG_TITLE" => (string)$REQ['org_title'],
|
||||
"UF_INN" => (string)$REQ['inn'],
|
||||
"UF_KPP" => (string)$REQ['kpp'],
|
||||
@ -369,10 +386,15 @@ switch($PARAM_1)
|
||||
"UF_PHONE_NUMBER" => (int)$REQ['phone'],
|
||||
];
|
||||
|
||||
if(!$real_email)
|
||||
{
|
||||
$profile["UF_IS_VALID_EMAIL"] = "нет";
|
||||
}
|
||||
|
||||
$user_registered_id = null;
|
||||
$company_registered_id = null;
|
||||
|
||||
$existed_users_res = \CUser::GetList(["ID" => "ASC"], false, [ "LOGIN" => $REQ['email'] ], []);
|
||||
$existed_users_res = \CUser::GetList(["ID" => "ASC"], false, [ "LOGIN" => $email ], []);
|
||||
while($existed_user = $existed_users_res->Fetch())
|
||||
{
|
||||
$user_registered_id = $existed_user["ID"];
|
||||
@ -397,13 +419,13 @@ switch($PARAM_1)
|
||||
$company_message = "Вам предоставлен доступ к Личному кабинету следующей организации:<br><br>\n\n";
|
||||
$company_message .= $REQ['org_title'].", ИНН: ".$REQ['inn']."<br>\n";
|
||||
|
||||
if(SEND_EMAIL_REGISTRATION_JOIN)
|
||||
if(SEND_EMAIL_REGISTRATION_JOIN && $real_email)
|
||||
{
|
||||
\Bitrix\Main\Mail\Event::send([
|
||||
"EVENT_NAME" => "CLIENT_USER_INVITE",
|
||||
"LID" => "s1",
|
||||
"C_FIELDS" => Array(
|
||||
"EMAIL" => $REQ['email'],
|
||||
"EMAIL" => $email,
|
||||
"COMPANIES" => $company_message,
|
||||
)
|
||||
]);
|
||||
@ -481,22 +503,22 @@ switch($PARAM_1)
|
||||
{
|
||||
$user = new \CUser;
|
||||
|
||||
$profile["PASSWORD"] = $REQ['password'];
|
||||
$profile["CONFIRM_PASSWORD"] = $REQ['password'];
|
||||
$profile["PASSWORD"] = $password;
|
||||
$profile["CONFIRM_PASSWORD"] = $password;
|
||||
|
||||
$ID = $user->Add($profile);
|
||||
if (intval($ID) > 0)
|
||||
{
|
||||
if(SEND_EMAIL_REGISTRATION_CREATE)
|
||||
if(SEND_EMAIL_REGISTRATION_CREATE && $real_email)
|
||||
{
|
||||
\Bitrix\Main\Mail\Event::send([
|
||||
"EVENT_NAME" => "USER_INFO",
|
||||
"LID" => "s1",
|
||||
"C_FIELDS" => Array(
|
||||
"EMAIL" => $REQ['email'],
|
||||
"EMAIL" => $email,
|
||||
"ORG_NAME" => $REQ['org_title'],
|
||||
"LOGIN" => $REQ['email'],
|
||||
"PASS" => $REQ['password'],
|
||||
"LOGIN" => $email,
|
||||
"PASS" => $password,
|
||||
)
|
||||
]);
|
||||
}
|
||||
@ -753,6 +775,7 @@ switch($PARAM_1)
|
||||
"phone" => $ar_user['UF_PHONE_NUMBER'],
|
||||
"phone_verified" => $ar_user['UF_PHONE_VERIFIED'],
|
||||
"is_admin" => $companies[0]['is_admin'],
|
||||
"valid_email" => $ar_user['UF_IS_VALID_EMAIL'],
|
||||
];
|
||||
|
||||
print json_encode([
|
||||
@ -849,6 +872,7 @@ switch($PARAM_1)
|
||||
"lastname" => $ar_user['LAST_NAME'],
|
||||
"phone" => $ar_user['UF_PHONE_NUMBER'],
|
||||
"phone_verified" => $ar_user['UF_PHONE_VERIFIED'],
|
||||
"valid_email" => $ar_user['UF_IS_VALID_EMAIL'],
|
||||
];
|
||||
|
||||
$companies = getCompaniesForUser($ar_user['ID']);
|
||||
@ -2032,23 +2056,110 @@ switch($PARAM_1)
|
||||
|
||||
case "programs":
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
switch($PARAM_2)
|
||||
{
|
||||
$programs = [];
|
||||
$programs_res = CIBlockElement::GetList(["SORT" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => 3], false, []);
|
||||
while ($programs_ob_element = $programs_res->GetNextElement())
|
||||
case "brands":
|
||||
{
|
||||
$programs_ar_res = $programs_ob_element->GetFields();
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
define("USED", filter_var($REQ['USED'], FILTER_VALIDATE_BOOLEAN));
|
||||
$filter = [ "ACTIVE" => "Y", ];
|
||||
|
||||
$programs[] = [
|
||||
"name" => $programs_ar_res['NAME'],
|
||||
"code" => $programs_ar_res['CODE'],
|
||||
];
|
||||
if(!empty($REQ['PROGRAM'])) { $filter['PROPERTY_LEASING_PROGRAMS'] = $REQ['PROGRAM']; }
|
||||
|
||||
$brands = [];
|
||||
$brands_ids = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter, true, [ 'ID' => [ USED ? PROPERTY_ID_CATALOG_CARS_USED_BRAND : PROPERTY_ID_CATALOG_CARS_NEW_BRAND ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($brands_ids, $row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_BRAND : PROPERTY_ID_CATALOG_CARS_NEW_BRAND ]);
|
||||
}
|
||||
|
||||
$brands_ids = array_values(array_unique($brands_ids));
|
||||
|
||||
$brands_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_BRANDS_USED : IBLOCK_ID_BRANDS ], [ "ID" => $brands_ids ]), false, []);
|
||||
while ($brands_ob_element = $brands_res->GetNextElement())
|
||||
{
|
||||
$brands_ar_res = $brands_ob_element->GetFields();
|
||||
$brands_ar_res['PROPERTIES'] = $brands_ob_element->GetProperties();
|
||||
|
||||
array_push($brands, [
|
||||
"id" => $brands_ar_res['ID'],
|
||||
"value" => $brands_ar_res['CODE'],
|
||||
"text" => $brands_ar_res['NAME'],
|
||||
"uid" => $brands_ar_res['PROPERTIES']['UID']['VALUE'],
|
||||
]);
|
||||
}
|
||||
|
||||
print json_encode([
|
||||
"brands" => $brands,
|
||||
]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
print json_encode([
|
||||
"programs" => $programs,
|
||||
]);
|
||||
case "models":
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
define("USED", filter_var($REQ['USED'], FILTER_VALIDATE_BOOLEAN));
|
||||
$filter = [ "ACTIVE" => "Y", "PROPERTY_BRAND" => $REQ['BRAND_ID'] ];
|
||||
|
||||
if(!empty($REQ['PROGRAM'])) { $filter['PROPERTY_LEASING_PROGRAMS'] = $REQ['PROGRAM']; }
|
||||
|
||||
$models = [];
|
||||
$models_ids = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( USED ? IBLOCK_ID_CATALOG_CARS_USED : IBLOCK_ID_CATALOG_CARS_NEW, $filter, true, [ 'ID' => [ USED ? PROPERTY_ID_CATALOG_CARS_USED_MODEL : PROPERTY_ID_CATALOG_CARS_NEW_MODEL ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($models_ids, $row[ USED ? PROPERTY_ID_CATALOG_CARS_USED_MODEL : PROPERTY_ID_CATALOG_CARS_NEW_MODEL ]);
|
||||
}
|
||||
|
||||
$models_ids = array_values(array_unique($models_ids));
|
||||
|
||||
$models_res = CIBlockElement::GetList(["NAME" => "ASC"], array_merge([ "IBLOCK_ID" => USED ? IBLOCK_ID_MODELS_USED : IBLOCK_ID_MODELS ], [ "ID" => $models_ids ]), false, []);
|
||||
while ($models_ob_element = $models_res->GetNextElement())
|
||||
{
|
||||
$models_ar_res = $models_ob_element->GetFields();
|
||||
$models_ar_res['PROPERTIES'] = $models_ob_element->GetProperties();
|
||||
|
||||
array_push($models, [
|
||||
"id" => $models_ar_res['ID'],
|
||||
"value" => $models_ar_res['CODE'],
|
||||
"text" => $models_ar_res['NAME'],
|
||||
"uid" => $models_ar_res['PROPERTIES']['UID']['VALUE'],
|
||||
]);
|
||||
}
|
||||
|
||||
print json_encode([
|
||||
"models" => $models,
|
||||
]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$programs = [];
|
||||
$programs_res = CIBlockElement::GetList(["SORT" => "ASC"], ["ACTIVE" => "Y", "IBLOCK_ID" => 3], false, []);
|
||||
while ($programs_ob_element = $programs_res->GetNextElement())
|
||||
{
|
||||
$programs_ar_res = $programs_ob_element->GetFields();
|
||||
|
||||
$programs[] = [
|
||||
"name" => $programs_ar_res['NAME'],
|
||||
"code" => $programs_ar_res['CODE'],
|
||||
];
|
||||
}
|
||||
|
||||
print json_encode([
|
||||
"programs" => $programs,
|
||||
]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -2274,6 +2385,8 @@ switch($PARAM_1)
|
||||
"utm_content" => $_COOKIE['utm_content'],
|
||||
"page_url" => $REQ['FORM_FIELD_PAGE_URL'],
|
||||
"page_name" => $REQ['FORM_FIELD_PAGE_NAME'],
|
||||
"sale_type" => $REQ['FORM_FIELD_SALE_TYPE'],
|
||||
"inn" => $REQ['FORM_FIELD_INN'],
|
||||
];
|
||||
if(!empty($REQ['FORM_FIELD_IS_IZT']))
|
||||
{
|
||||
@ -2615,7 +2728,8 @@ switch($PARAM_1)
|
||||
"lastname" => $ar_user['LAST_NAME'],
|
||||
"phone" => $ar_user['UF_PHONE_NUMBER'],
|
||||
"phone_verified" => $ar_user['UF_PHONE_VERIFIED'],
|
||||
"is_admin" => $companies[0]['is_admin'],
|
||||
"is_admin" => $companies[0]['is_admin'],
|
||||
"valid_email" => $ar_user['UF_IS_VALID_EMAIL'],
|
||||
];
|
||||
|
||||
print json_encode([
|
||||
@ -2669,6 +2783,7 @@ switch($PARAM_1)
|
||||
"phone_number" => $ar_user['UF_PHONE_NUMBER'],
|
||||
"phone_verified" => $ar_user['UF_PHONE_VERIFIED'],
|
||||
"is_admin" => $companies[0]['is_admin'],
|
||||
"valid_email" => $ar_user['UF_IS_VALID_EMAIL'],
|
||||
],
|
||||
"company" => [
|
||||
"inn" => $companies[0]['inn'],
|
||||
@ -2953,6 +3068,101 @@ switch($PARAM_1)
|
||||
}
|
||||
break;
|
||||
|
||||
case "preapproval":
|
||||
{
|
||||
$payload = [
|
||||
"inn" => $_REQUEST['vat'],
|
||||
];
|
||||
|
||||
$payload_json = json_encode($payload);
|
||||
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, API_HOST."/site/FindClientInDatabase?inn=".$_REQUEST['vat']);
|
||||
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($c, CURLOPT_TIMEOUT, 30);
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($c, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
||||
|
||||
$response = curl_exec($c);
|
||||
$response_decoded = json_decode($response, true);
|
||||
curl_close($c);
|
||||
|
||||
print json_encode([
|
||||
"client" => $response_decoded['client_status'],
|
||||
]);
|
||||
|
||||
die();
|
||||
}
|
||||
break;
|
||||
|
||||
case "feedbacks":
|
||||
{
|
||||
switch($PARAM_2)
|
||||
{
|
||||
case "add":
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$auth = (array) \Bitrix\Main\Web\JWT::decode($REQ['token'], $secret_crm, ["HS256"]);
|
||||
|
||||
$rs_user = \CUser::GetByLogin($auth['login']);
|
||||
$ar_user = $rs_user->Fetch();
|
||||
|
||||
$company_res = CIBlockElement::GetList([ 'id' => 'desc' ], [ 'IBLOCK_ID' => IBLOCK_ID_CLIENTS, 'CODE' => $auth['acc_number'] ], false, []);
|
||||
|
||||
while ($company_element = $company_res->GetNextElement())
|
||||
{
|
||||
$company_record = $company_element->GetFields();
|
||||
$company_record['PROPERTIES'] = $company_element->GetProperties();
|
||||
}
|
||||
|
||||
$feedback_properties = [
|
||||
"NAME" => "Отзыв от ".date("Y.m.d H:i:s"),
|
||||
"CLIENT" => $company_record['ID'],
|
||||
"CLIENT_CODE" => $auth['acc_number'],
|
||||
"USER" => $ar_user['ID'],
|
||||
"PERSON" => $REQ['name'],
|
||||
"PHONE" => $REQ['phone'],
|
||||
"EVALUATION" => $REQ['rating'],
|
||||
"COMPANY_NAME" => $company_record['NAME'],
|
||||
"COMPANY_INN" => $company_record['PROPERTIES']['INN']['VALUE'],
|
||||
];
|
||||
|
||||
$ar_new_feedback = [
|
||||
'IBLOCK_ID' => IBLOCK_ID_FEEDBACKS,
|
||||
'NAME' => "Отзыв от ".$company_record['NAME']." ".date("Y.m.d H:i:s"),
|
||||
"PREVIEW_TEXT" => $REQ['comment'],
|
||||
'PROPERTY_VALUES' => $feedback_properties,
|
||||
'ACTIVE' => 'Y', // активен
|
||||
];
|
||||
|
||||
$new_feedback = new CIBlockElement;
|
||||
if($new_feedback_id = $new_feedback->Add($ar_new_feedback))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
print json_encode([
|
||||
"status" => "success",
|
||||
"auth" => $auth,
|
||||
]);
|
||||
|
||||
die();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
die();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
print json_encode([]);
|
||||
|
||||
@ -249,4 +249,184 @@ function zerof_get_images($task_uid)
|
||||
return $images;
|
||||
}
|
||||
|
||||
//AddEventHandler("iblock", "OnBeforeIBlockElementAdd", "OnBeforeIBlockElementAddHandler");
|
||||
//AddEventHandler("iblock", "OnAfterIBlockElementAdd", "OnAfterIBlockElementAddHandler");
|
||||
//AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", "OnBeforeIBlockElementUpdateHandler");
|
||||
|
||||
function OnBeforeIBlockElementAddHandler(&$arFields)
|
||||
{
|
||||
$iblocks_array = [
|
||||
IBLOCK_ID_SPECIALS => "specials",
|
||||
IBLOCK_ID_NEWS => "news",
|
||||
IBLOCK_ID_SLIDER => "slider",
|
||||
IBLOCK_ID_SPECIAL_OFFERS_BANNERS => "special_offers_banner",
|
||||
IBLOCK_ID_SPECIAL_OFFERS_CARS => "special_offers_car_banner",
|
||||
IBLOCK_ID_BANNERS_INNER => "banner_inner",
|
||||
];
|
||||
|
||||
if(array_key_exists($arFields['IBLOCK_ID'], $iblocks_array))
|
||||
{
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_add.txt", var_export($arFields, true));
|
||||
|
||||
$res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
|
||||
$properties = [];
|
||||
|
||||
while($res_arr = $res->GetNext())
|
||||
{
|
||||
$properties[$res_arr['CODE']] = $res_arr['ID'];
|
||||
}
|
||||
|
||||
if(isset($properties['ADVERTISING']))
|
||||
{
|
||||
if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
|
||||
{
|
||||
//снимаем элемент с публикации по умолчанию
|
||||
$arFields['ACTIVE'] = "N";
|
||||
}
|
||||
else
|
||||
{
|
||||
$arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ 'n0' => [ 'VALUE' => '' ]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function OnAfterIBlockElementAddHandler(&$arFields)
|
||||
{
|
||||
$iblocks_array = [
|
||||
IBLOCK_ID_SPECIALS => "specials",
|
||||
IBLOCK_ID_NEWS => "news",
|
||||
IBLOCK_ID_SLIDER => "slider",
|
||||
IBLOCK_ID_SPECIAL_OFFERS_BANNERS => "special_offers_banner",
|
||||
IBLOCK_ID_SPECIAL_OFFERS_CARS => "special_offers_car_banner",
|
||||
IBLOCK_ID_BANNERS_INNER => "banner_inner",
|
||||
];
|
||||
|
||||
if(array_key_exists($arFields['IBLOCK_ID'], $iblocks_array))
|
||||
{
|
||||
if(isset($properties['ADVERTISING']))
|
||||
{
|
||||
if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
|
||||
{
|
||||
if(!is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']]))
|
||||
{
|
||||
//если ERIR пуст
|
||||
//запускаем получение ЕРИР
|
||||
$arFields['ACTIVE'] = "Y";
|
||||
$arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0] => [ 'VALUE' => '' ]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
|
||||
$properties = [];
|
||||
|
||||
while($res_arr = $res->GetNext())
|
||||
{
|
||||
$properties[$res_arr['CODE']] = $res_arr['ID'];
|
||||
}
|
||||
|
||||
if(isset($properties['ADVERTISING']))
|
||||
{
|
||||
if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
|
||||
{
|
||||
//запускаем получение ЕРИР
|
||||
$element = new CIBlockElement;
|
||||
$result = $element->Update($arFields['ID'], [ "ACTIVE" => "Y" ]);
|
||||
|
||||
CIBlockElement::SetPropertyValuesEx($arFields['ID'], $arFields['IBLOCK_ID'], [
|
||||
"ADVERTISING_ERIR" => "12345",
|
||||
"ADVERTISING_SAMPLE_URL" => "67890",
|
||||
], []);
|
||||
|
||||
//ставим элемент на публикацию
|
||||
$arFields['ACTIVE'] = "Y";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function OnBeforeIBlockElementUpdateHandler(&$arFields)
|
||||
{
|
||||
$iblocks_array = [
|
||||
IBLOCK_ID_SPECIALS => "specials",
|
||||
IBLOCK_ID_NEWS => "news",
|
||||
IBLOCK_ID_SLIDER => "slider",
|
||||
IBLOCK_ID_SPECIAL_OFFERS_BANNERS => "special_offers_banner",
|
||||
IBLOCK_ID_SPECIAL_OFFERS_CARS => "special_offers_car_banner",
|
||||
IBLOCK_ID_BANNERS_INNER => "banner_inner",
|
||||
];
|
||||
|
||||
if(array_key_exists($arFields['IBLOCK_ID'], $iblocks_array))
|
||||
{
|
||||
$res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
|
||||
$properties = [];
|
||||
|
||||
while($res_arr = $res->GetNext())
|
||||
{
|
||||
$properties[$res_arr['CODE']] = $res_arr['ID'];
|
||||
}
|
||||
|
||||
if(isset($properties['ADVERTISING']))
|
||||
{
|
||||
if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
|
||||
{
|
||||
if($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']][array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0]]['VALUE'] === "")
|
||||
{
|
||||
//это реклама, ЕРИР нет и его надо получить
|
||||
/*
|
||||
CIBlockElement::SetPropertyValuesEx($arFields['ID'], $arFields['IBLOCK_ID'], [
|
||||
"ADVERTISING_ERIR" => "12345",
|
||||
"ADVERTISING_SAMPLE_URL" => "67890",
|
||||
], []);
|
||||
*/
|
||||
|
||||
$response_str = file_get_contents("https://evo.quickcode.ru/advertising/".$iblocks_array[$arFields['IBLOCK_ID']]."?id=".$arFields['ID']."");
|
||||
$response = json_decode($response_str, true);
|
||||
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/adv_response.txt", var_export($response, true));
|
||||
|
||||
$arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0]."" => [ 'VALUE' => $response['erir'] ] ];
|
||||
$arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']])[0]."" => [ 'VALUE' => $response['sample'] ] ];
|
||||
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_update.txt", var_export($arFields, true));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//очистка ЕРИР и образца
|
||||
$arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_ERIR']])[0]."" => [ 'VALUE' => '' ] ];
|
||||
$arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']] = [ "".array_keys($arFields['PROPERTY_VALUES'][$properties['ADVERTISING_SAMPLE_URL']])[0]."" => [ 'VALUE' => '' ] ];
|
||||
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/element_update.txt", var_export($arFields, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$res = CIBlock::GetProperties($arFields['IBLOCK_ID'], [], []);
|
||||
$properties = [];
|
||||
|
||||
while($res_arr = $res->GetNext())
|
||||
{
|
||||
$properties[$res_arr['CODE']] = $res_arr['ID'];
|
||||
}
|
||||
|
||||
if(isset($properties['ADVERTISING']))
|
||||
{
|
||||
if(is_array($arFields['PROPERTY_VALUES'][$properties['ADVERTISING']]))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
file_put_contents($_SERVER['DOCUMENT_ROOT']."/iblock_properties.txt", var_export($properties, true));
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
@ -1,5 +0,0 @@
|
||||
<svg width="34" height="40" viewBox="0 0 34 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M32.5 23.0769C32.5 31.5884 25.5668 38.5 17 38.5C8.43317 38.5 1.5 31.5884 1.5 23.0769C1.5 14.5654 8.43317 7.65384 17 7.65384C25.5668 7.65384 32.5 14.5654 32.5 23.0769Z" stroke="white" stroke-width="3"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1957 2C11.1957 0.895431 12.0911 0 13.1957 0H20.529C21.6336 0 22.529 0.895431 22.529 2V2.10256C22.529 3.20713 21.6336 4.10256 20.529 4.10256H18.5758V7.36712H15.2587V4.10256H13.1957C12.0911 4.10256 11.1957 3.20713 11.1957 2.10256V2ZM2.65408 11.6023C2.65408 12.8603 3.19769 13.9919 4.06383 14.777L10.4592 9.08443C9.67555 8.00898 8.40296 7.30957 6.96627 7.30957C4.58471 7.30957 2.65408 9.23147 2.65408 11.6023ZM31.513 11.6023C31.513 12.8603 30.9694 13.9919 30.1032 14.777L23.7079 9.08443C24.4915 8.00898 25.7641 7.30957 27.2008 7.30957C29.5823 7.30957 31.513 9.23147 31.513 11.6023Z" fill="white"/>
|
||||
<path d="M21.0216 20.0638C21.0907 18.7842 20.466 16.2251 17.4143 16.2251M17.4143 16.2251C13.5997 16.2251 13.4338 19.2795 13.4338 20.0638C13.4338 20.848 14.2631 23.2007 17.4143 23.8199C20.5655 24.439 21.0216 26.09 21.0216 27.6585C21.0216 29.227 19.9021 30.878 17.4143 30.878M17.4143 16.2251V13.5422M17.4143 30.878C14.9265 30.878 12.646 29.9287 12.646 26.8743M17.4143 30.878V33.3546" stroke="white" stroke-width="3"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
5
images/icons/preapproval_icon.svg
Normal file
5
images/icons/preapproval_icon.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="34" height="40" viewBox="0 0 34 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M32.5 23.0769C32.5 31.5885 25.5668 38.5 17 38.5C8.43317 38.5 1.5 31.5885 1.5 23.0769C1.5 14.5654 8.43317 7.65387 17 7.65387C25.5668 7.65387 32.5 14.5654 32.5 23.0769Z" stroke="white" stroke-width="3"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1957 2C11.1957 0.895431 12.0911 0 13.1957 0H20.529C21.6336 0 22.529 0.895431 22.529 2V2.10256C22.529 3.20713 21.6336 4.10256 20.529 4.10256H18.5758V7.36712H15.2587V4.10256H13.1957C12.0911 4.10256 11.1957 3.20713 11.1957 2.10256V2ZM2.65405 11.6023C2.65405 12.8603 3.19767 13.9919 4.06381 14.777L10.4592 9.08443C9.67553 8.00898 8.40294 7.30957 6.96625 7.30957C4.58469 7.30957 2.65405 9.23147 2.65405 11.6023ZM31.513 11.6023C31.513 12.8603 30.9693 13.9919 30.1032 14.777L23.7078 9.08443C24.4915 8.00898 25.7641 7.30957 27.2008 7.30957C29.5823 7.30957 31.513 9.23147 31.513 11.6023Z" fill="white"/>
|
||||
<path d="M19.4788 14L19.6178 14.0121C21.1335 14.0815 22.4967 14.5779 23.5623 15.711C24.5483 16.7597 25.0144 18.1294 24.9997 19.5816C24.9983 19.7099 24.9954 19.8323 24.9909 19.949C24.9397 21.2519 24.482 22.4801 23.5995 23.4329C22.676 24.4298 21.4672 24.9938 20.1335 25.1314C19.872 25.1584 19.5475 25.1716 19.1599 25.1711C17.805 25.1693 16.4504 25.17 15.0959 25.1733C15.0919 25.1733 15.0881 25.1749 15.0852 25.1778C15.0824 25.1807 15.0808 25.1846 15.0808 25.1887L15.0814 26.6615C15.0814 26.6799 15.0904 26.6892 15.1085 26.6892C17.1771 26.6905 19.2404 26.6902 21.2985 26.6883C21.4206 26.6881 21.5068 26.6973 21.557 26.7158C21.7304 26.7801 21.7954 26.9319 21.799 27.1131C21.8093 27.6453 21.7965 28.1823 21.7963 28.7153C21.7963 28.8906 21.7288 29.0297 21.5689 29.1021C21.4618 29.1505 21.338 29.1362 21.2081 29.1362C19.2193 29.136 17.2304 29.136 15.2415 29.1362C15.194 29.1362 15.1435 29.1425 15.0925 29.1403C15.0853 29.14 15.0817 29.1436 15.0817 29.1509C15.0809 29.8981 15.0808 30.6453 15.0814 31.3925C15.0815 31.4103 15.0831 31.4573 15.0862 31.5335C15.0966 31.7847 14.9613 31.9653 14.7165 32H12.5469C12.3892 31.9723 12.2831 31.8903 12.2288 31.754C12.1842 31.6424 12.197 31.4849 12.1986 31.3567C12.2076 30.6246 12.2032 29.8906 12.1993 29.1555C12.1992 29.1513 12.1976 29.1474 12.1948 29.1445C12.1919 29.1415 12.188 29.1399 12.184 29.1399C11.2712 29.1357 10.357 29.1345 9.44136 29.1362C9.25145 29.1366 9.08795 29.0725 9.02471 28.8792C9.0077 28.8277 8.99991 28.735 9.00135 28.6012C9.00363 28.3714 9.00333 28.1416 9.00045 27.9119C8.99776 27.6954 9.00818 27.4434 9.00297 27.2087C9.00009 27.0807 9.00536 26.9954 9.01878 26.9528C9.07717 26.7665 9.23331 26.6829 9.42627 26.6855C9.92479 26.6922 10.7043 26.6932 11.7648 26.6883C11.8755 26.6879 12.0426 26.6826 12.1822 26.6892C12.1847 26.6893 12.1872 26.6889 12.1895 26.688C12.1918 26.6871 12.194 26.6858 12.1958 26.684C12.1976 26.6823 12.199 26.6802 12.2 26.6778C12.2009 26.6755 12.2014 26.673 12.2014 26.6705V25.195C12.2014 25.1902 12.1996 25.1857 12.1964 25.1823C12.1931 25.1789 12.1887 25.177 12.184 25.177C11.2827 25.1683 10.3796 25.1677 9.47478 25.1753C9.259 25.1772 9.07106 25.1173 9.01393 24.8842C9.00339 24.8411 8.9995 24.741 9.00225 24.5838C9.00926 24.1779 8.99776 23.8458 9.0053 23.3268C9.00758 23.1734 9.0071 23.0199 9.00387 22.8662C8.99902 22.6393 9.14868 22.4788 9.36339 22.452L12.1842 22.4527C12.187 22.4539 12.1895 22.4543 12.1917 22.4538C12.1969 22.4526 12.1993 22.4492 12.1989 22.4437C12.1943 22.3857 12.202 22.3205 12.202 22.2721C12.2022 19.6819 12.2023 17.0917 12.2022 14.5016C12.2022 14.3844 12.2112 14.3016 12.2293 14.2532C12.2967 14.0727 12.4474 14.0117 12.6344 14.0116C14.9129 14.0094 17.1913 14.0083 19.4698 14.0084C19.4737 14.0084 19.4767 14.0056 19.4788 14ZM15.0941 22.4443C15.0965 22.4504 15.0998 22.4535 15.1038 22.4535C15.802 22.4544 17.1345 22.4541 19.1013 22.4525C19.295 22.4507 19.4387 22.4449 19.5325 22.4351C20.1488 22.3716 20.7332 22.1239 21.1907 21.6967C21.9368 21 22.1677 19.9508 21.9852 18.9552C21.7967 17.926 21.0498 17.1254 20.0613 16.8522C19.757 16.7681 19.4461 16.726 19.1284 16.7259C17.7956 16.7253 16.4555 16.7252 15.1081 16.7257C15.0902 16.7257 15.0812 16.735 15.0812 16.7534L15.081 22.441C15.081 22.4469 15.0838 22.449 15.0893 22.4474C15.0912 22.4469 15.0928 22.4459 15.0941 22.4443Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
@ -36,25 +36,32 @@ $APPLICATION->AddHeadString('<script type="application/ld+json">'.json_encode($m
|
||||
<p class="section_title">Новость</p>
|
||||
<div class="news_container">
|
||||
<div class="image">
|
||||
<img src="<?= $arResult['DETAIL_PICTURE']; ?>" alt="<?= $arResult['NAME']; ?>" />
|
||||
<div class="advwrapper">
|
||||
<img src="<?= $arResult['DETAIL_PICTURE']; ?>" alt="<?= $arResult['NAME']; ?>" />
|
||||
<? if($arResult['PROPERTIES']['ADVERTISING_ERIR']['VALUE']): ?>
|
||||
<div class="advblock adv_button_news adv_button_news_article">Реклама
|
||||
<div class="adv_button_slider_erir">ООО "ЛК Эволюция"</div>
|
||||
<div class="adv_button_slider_erir">ИНН 9724016636</div>
|
||||
<div class="adv_button_slider_erir">ЕРИР: <?= $arResult['PROPERTIES']['ADVERTISING_ERIR']['VALUE']; ?></div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<h1><?= $arResult['NAME']; ?></h1>
|
||||
<date class="date"><?= FormatDate("d F Y", MakeTimeStamp($arResult['ACTIVE_FROM'])); ?></date>
|
||||
<?= $arResult['DETAIL_TEXT']; ?>
|
||||
|
||||
<h1><?= $arResult['NAME']; ?></h1>
|
||||
<date class="date"><?= FormatDate("d F Y", MakeTimeStamp($arResult['ACTIVE_FROM'])); ?></date>
|
||||
<?= $arResult['DETAIL_TEXT']; ?>
|
||||
|
||||
<? $APPLICATION->IncludeComponent("bitrix:main.share", "evolution", Array(
|
||||
"HIDE" => "N", // Скрыть панель закладок по умолчанию
|
||||
"HANDLERS" => array( // Используемые соц. закладки и сети
|
||||
"facebook",
|
||||
"vk",
|
||||
),
|
||||
"PAGE_URL" => "https://".$_SERVER['SERVER_NAME'].$arResult["DETAIL_PAGE_URL"], // URL страницы относительно корня сайта
|
||||
"PAGE_TITLE" => $arResult["NAME"], // Заголовок страницы
|
||||
<? $APPLICATION->IncludeComponent("bitrix:main.share", "evolution", Array(
|
||||
"HIDE" => "N", // Скрыть панель закладок по умолчанию
|
||||
"HANDLERS" => array( // Используемые соц. закладки и сети
|
||||
"facebook",
|
||||
"vk",
|
||||
),
|
||||
false
|
||||
); ?>
|
||||
|
||||
"PAGE_URL" => "https://".$_SERVER['SERVER_NAME'].$arResult["DETAIL_PAGE_URL"], // URL страницы относительно корня сайта
|
||||
"PAGE_TITLE" => $arResult["NAME"], // Заголовок страницы
|
||||
),
|
||||
false
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@ -22,7 +22,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
$arResult = [];
|
||||
$sort = Array("ACTIVE_FROM" => "DESC", "NAME" => "ASC");
|
||||
$filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => 6);
|
||||
$options = Array("nPageSize" => 4);
|
||||
$options = Array("nPageSize" => isset($_GET['advertise']) ? 10000 : 4);
|
||||
|
||||
$res = CIBlockElement::GetList($sort, $filter, false, $options);
|
||||
$arResult = ['ITEMS' => []];
|
||||
|
||||
@ -40,10 +40,17 @@ $this->setFrameMode(true);
|
||||
<div class="masongry_columns news_list">
|
||||
<div class="column">
|
||||
<? foreach($left_column AS $entry): ?>
|
||||
<div class="news_item">
|
||||
<div class="news_item" id="news_item_<?= $entry['ID']; ?>">
|
||||
<p class="news_date"><?= FormatDate("d F Y", MakeTimeStamp($entry['ACTIVE_FROM'])); ?></p>
|
||||
<p class="news_title"><?= $entry['NAME']; ?></p>
|
||||
<img src="<?= $entry['PREVIEW_PICTURE']; ?>" width="234px" height="234px" alt="">
|
||||
<div class="advwrapper">
|
||||
<img src="<?= $entry['PREVIEW_PICTURE']; ?>" width="234px" height="234px" alt="">
|
||||
<? if($entry['PROPERTIES']['ADVERTISING_ERIR']['VALUE']): ?>
|
||||
<div class="advblock adv_button_news">Реклама
|
||||
<div class="adv_button_slider_erir">ЕРИР: <?= $entry['PROPERTIES']['ADVERTISING_ERIR']['VALUE']; ?></div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<p class="news_description"><?= $entry['PREVIEW_TEXT']; ?></p>
|
||||
<p class="news_link">Подробнее</p>
|
||||
<a href="<?= $entry['DETAIL_PAGE_URL']; ?>"></a>
|
||||
@ -52,10 +59,17 @@ $this->setFrameMode(true);
|
||||
</div>
|
||||
<div class="column">
|
||||
<? foreach($right_column AS $entry): ?>
|
||||
<div class="news_item">
|
||||
<div class="news_item" id="news_item_<?= $entry['ID']; ?>">
|
||||
<p class="news_date"><?= FormatDate("d F Y", MakeTimeStamp($entry['ACTIVE_FROM'])); ?></p>
|
||||
<p class="news_title"><?= $entry['NAME']; ?></p>
|
||||
<img src="<?= $entry['PREVIEW_PICTURE']; ?>" width="234px" height="234px" alt="">
|
||||
<div class="advwrapper">
|
||||
<img src="<?= $entry['PREVIEW_PICTURE']; ?>" width="234px" height="234px" alt="">
|
||||
<? if($entry['PROPERTIES']['ADVERTISING_ERIR']['VALUE']): ?>
|
||||
<div class="advblock adv_button_news">Реклама
|
||||
<div class="adv_button_slider_erir">ЕРИР: <?= $entry['PROPERTIES']['ADVERTISING_ERIR']['VALUE']; ?></div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<p class="news_description"><?= $entry['PREVIEW_TEXT']; ?></p>
|
||||
<p class="news_link">Подробнее</p>
|
||||
<a href="<?= $entry['DETAIL_PAGE_URL']; ?>"></a>
|
||||
|
||||
@ -33,9 +33,9 @@ function calculate(param, value)
|
||||
redemption_payment: calculation.redemption_payment,
|
||||
}, function(response)
|
||||
{
|
||||
for(let i in response)
|
||||
{ calculation[i] = parseInt(response[i], 10); }
|
||||
for(let i in response) { calculation[i] = parseInt(response[i], 10); }
|
||||
|
||||
$("#calculator_car_price_text").text(calculation['car_price'].toLocaleString()+" ₽");
|
||||
$("#calculator_monthly_payment_value").text(calculation['monthly_payment'].toLocaleString());
|
||||
$("#calculator_tax_savings_value").text((calculation['tax_savings'] + calculation['vat_reimbursement']).toLocaleString());
|
||||
$("#calculator_tax_savings_percent").text(Math.round((calculation['tax_savings']+calculation['vat_reimbursement']) / (calculation['car_price'] / 100)));
|
||||
|
||||
@ -220,6 +220,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
$APPLICATION->AddChainItem($breadcrumb['NAME'], $breadcrumb['URL']);
|
||||
}
|
||||
|
||||
$arResult['SHOW_PROMO_MODELS'] = true;
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
@ -60,30 +60,7 @@ if(!empty($arResult['SUBTITLE']))
|
||||
<img src="/images/special_offer.jpg" alt="" />
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div id="catalog_small_filter" style="<?= $arResult['EXTENDED'] ? "display:none;" : ($arResult['FILTER_SMALL'] ? "display:none;" : ""); ?>">
|
||||
<form id="catalog_small_form" method="get" action="/catalog/">
|
||||
<div class="filter_body">
|
||||
<div class="form_field">
|
||||
<select name="brand" id="small_filter_brands">
|
||||
<option disabled selected value="">Марка</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select name="model" id="small_filter_models">
|
||||
<option disabled selected value="">Модель</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="button button-blue" id="catalog_small_find"></button>
|
||||
<button class="button button-blue" id="rich_filter_toggle">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.63025 3H13.3697C13.4666 3 13.5613 3.02814 13.6425 3.08099C13.7237 3.13384 13.7878 3.20914 13.827 3.29772C13.8661 3.38631 13.8788 3.48437 13.8633 3.57999C13.8478 3.6756 13.8048 3.76466 13.7397 3.83634L9.63 8.35697C9.54633 8.449 9.49997 8.56892 9.49997 8.6933V12.2324C9.49997 12.3147 9.47965 12.3958 9.44081 12.4683C9.40197 12.5409 9.34581 12.6028 9.27732 12.6484L7.27732 13.9818C7.20202 14.032 7.11451 14.0608 7.02412 14.0652C6.93372 14.0695 6.84384 14.0493 6.76404 14.0066C6.68425 13.9639 6.61755 13.9003 6.57104 13.8227C6.52454 13.745 6.49997 13.6562 6.49997 13.5657V8.6933C6.49997 8.56892 6.45361 8.449 6.36994 8.35697L2.26028 3.83634C2.19512 3.76466 2.15218 3.6756 2.13669 3.57999C2.12119 3.48437 2.13381 3.38631 2.17299 3.29772C2.21218 3.20914 2.27625 3.13384 2.35743 3.08099C2.4386 3.02814 2.53338 3 2.63025 3V3Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
Фильтр
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="filter" class="filter_in_catalog" style="<?= $arResult['EXTENDED'] ? "display:block;" : ""; ?>">
|
||||
<div id="filter" class="filter_in_catalog" style="display:block;">
|
||||
<div class="container">
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:form.catalog.filter",
|
||||
@ -174,13 +151,12 @@ if(!empty($arResult['SUBTITLE']))
|
||||
|
||||
<? if($arResult['SHOW_PROMO_MODELS']): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.promo.model",
|
||||
"evolution:catalog.landing.promo.model",
|
||||
"",
|
||||
Array(
|
||||
"COUNT" => 3,
|
||||
"BRAND_NAME" => $arResult['TITLES']['BRAND'],
|
||||
"BRAND_CODE" => $arResult['SELECTED']['BRAND'],
|
||||
"BRAND_UID" => $arResult['SELECTED']['BRAND_UID'],
|
||||
"PROPERTIES_FILTER_ARRAY" => [ "PROPERTY_BODY" => $arResult['BODY'], ],
|
||||
"PROPERTIES_FILTER_ARRAY_MODELS" => [ "PROPERTY_PROMO_BODY_VALUE" => "Да" ],
|
||||
"PATH" => $arParams['PATH'],
|
||||
)
|
||||
); ?>
|
||||
|
||||
@ -221,6 +221,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
$APPLICATION->AddChainItem($breadcrumb['NAME'], $breadcrumb['URL']);
|
||||
}
|
||||
|
||||
$arResult['SHOW_PROMO_MODELS'] = true;
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
@ -60,30 +60,7 @@ if(!empty($arResult['SUBTITLE']))
|
||||
<img src="/images/special_offer.jpg" alt="" />
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<div id="catalog_small_filter" style="<?= $arResult['EXTENDED'] ? "display:none;" : ($arResult['FILTER_SMALL'] ? "display:none;" : ""); ?>">
|
||||
<form id="catalog_small_form" method="get" action="/catalog/">
|
||||
<div class="filter_body">
|
||||
<div class="form_field">
|
||||
<select name="brand" id="small_filter_brands">
|
||||
<option disabled selected value="">Марка</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select name="model" id="small_filter_models">
|
||||
<option disabled selected value="">Модель</option>
|
||||
</select>
|
||||
</div>
|
||||
<button class="button button-blue" id="catalog_small_find"></button>
|
||||
<button class="button button-blue" id="rich_filter_toggle">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.63025 3H13.3697C13.4666 3 13.5613 3.02814 13.6425 3.08099C13.7237 3.13384 13.7878 3.20914 13.827 3.29772C13.8661 3.38631 13.8788 3.48437 13.8633 3.57999C13.8478 3.6756 13.8048 3.76466 13.7397 3.83634L9.63 8.35697C9.54633 8.449 9.49997 8.56892 9.49997 8.6933V12.2324C9.49997 12.3147 9.47965 12.3958 9.44081 12.4683C9.40197 12.5409 9.34581 12.6028 9.27732 12.6484L7.27732 13.9818C7.20202 14.032 7.11451 14.0608 7.02412 14.0652C6.93372 14.0695 6.84384 14.0493 6.76404 14.0066C6.68425 13.9639 6.61755 13.9003 6.57104 13.8227C6.52454 13.745 6.49997 13.6562 6.49997 13.5657V8.6933C6.49997 8.56892 6.45361 8.449 6.36994 8.35697L2.26028 3.83634C2.19512 3.76466 2.15218 3.6756 2.13669 3.57999C2.12119 3.48437 2.13381 3.38631 2.17299 3.29772C2.21218 3.20914 2.27625 3.13384 2.35743 3.08099C2.4386 3.02814 2.53338 3 2.63025 3V3Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
Фильтр
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id="filter" class="filter_in_catalog" style="<?= $arResult['EXTENDED'] ? "display:block;" : ""; ?>">
|
||||
<div id="filter" class="filter_in_catalog" style="display:block;">
|
||||
<div class="container">
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:form.catalog.filter",
|
||||
@ -174,13 +151,12 @@ if(!empty($arResult['SUBTITLE']))
|
||||
|
||||
<? if($arResult['SHOW_PROMO_MODELS']): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.promo.model",
|
||||
"evolution:catalog.landing.promo.model",
|
||||
"",
|
||||
Array(
|
||||
"COUNT" => 3,
|
||||
"BRAND_NAME" => $arResult['TITLES']['BRAND'],
|
||||
"BRAND_CODE" => $arResult['SELECTED']['BRAND'],
|
||||
"BRAND_UID" => $arResult['SELECTED']['BRAND_UID'],
|
||||
"PROPERTIES_FILTER_ARRAY" => [ "PROPERTY_ENGINE_FUEL" => $arResult['ENGINE_FUEL'], ],
|
||||
"PROPERTIES_FILTER_ARRAY_MODELS" => [ "PROPERTY_PROMO_ENGINE_FUEL_VALUE" => "Да" ],
|
||||
"PATH" => $arParams['PATH'],
|
||||
)
|
||||
); ?>
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
<?
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
|
||||
$arTemplateDescription = array(
|
||||
"NAME" => GetMessage("DEFAULT_NAME"),
|
||||
"DESCRIPTION" => GetMessage("DEFAULT_DESC"),
|
||||
);
|
||||
?>
|
||||
@ -0,0 +1,131 @@
|
||||
<?
|
||||
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
/** @var CBitrixComponent $this */
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @var string $componentPath */
|
||||
/** @var string $componentName */
|
||||
/** @var string $componentTemplate */
|
||||
/** @global CDatabase $DB */
|
||||
/** @global CUser $USER */
|
||||
/** @global CMain $APPLICATION */
|
||||
|
||||
use Bitrix\Main\Context,
|
||||
Bitrix\Main\Type\DateTime,
|
||||
Bitrix\Main\Loader,
|
||||
Bitrix\Iblock;
|
||||
|
||||
global $NavNum;
|
||||
$NavNum = 0;
|
||||
|
||||
if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$arResult = [
|
||||
'MODELS' => [],
|
||||
];
|
||||
|
||||
$models_ids = [];
|
||||
$iterator = CIBlockElement::GetPropertyValues( IBLOCK_ID_CATALOG_CARS_NEW, $arParams['PROPERTIES_FILTER_ARRAY'], true, [ 'ID' => [ PROPERTY_ID_CATALOG_CARS_NEW_MODEL ] ] );
|
||||
while ($row = $iterator->Fetch())
|
||||
{
|
||||
array_push($models_ids, $row[ PROPERTY_ID_CATALOG_CARS_NEW_MODEL ]);
|
||||
}
|
||||
|
||||
$models_ids = array_values(array_unique($models_ids));
|
||||
|
||||
$models_sort = [ "SORT" => "ASC" ];
|
||||
$models_filter = [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_MODELS, "ID" => $models_ids, ];
|
||||
$models_filter = array_merge($models_filter, $arParams['PROPERTIES_FILTER_ARRAY_MODELS']);
|
||||
|
||||
$models_res = CIBlockElement::GetList($models_sort, $models_filter, false, []);
|
||||
while ($models_element = $models_res->GetNextElement())
|
||||
{
|
||||
$models_ar_res = $models_element->GetFields();
|
||||
$models_ar_res['PROPERTIES'] = $models_element->GetProperties();
|
||||
$models_ar_res['ITEMS'] = [];
|
||||
|
||||
$brands_res = CIBlockElement::GetList([ "SORT" => "ASC" ], [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_BRANDS, "PROPERTY_UID" => $models_ar_res['PROPERTIES']['BRAND_UID']['VALUE'], ], false, []);
|
||||
while ($brands_element = $brands_res->GetNextElement())
|
||||
{
|
||||
$brands_ar_res = $brands_element->GetFields();
|
||||
$models_ar_res['BRAND_NAME'] = $brands_ar_res['NAME'];
|
||||
$models_ar_res['BRAND_CODE'] = $brands_ar_res['CODE'];
|
||||
}
|
||||
|
||||
$cars_sort = [ "NAME" => "ASC" ];
|
||||
$cars_filter = [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "PROPERTY_MODEL" => $models_ar_res['ID'], ];
|
||||
$cars_filter = array_merge($cars_filter, $arParams['PROPERTIES_FILTER_ARRAY']);
|
||||
|
||||
$position_res = CIBlockElement::GetList($cars_sort, $cars_filter, false, [ "nPageSize" => 3 ]);
|
||||
|
||||
while ($position_element = $position_res->GetNextElement())
|
||||
{
|
||||
$ar_res = $position_element->GetFields();
|
||||
$ar_res['PROPERTIES'] = $position_element->GetProperties();
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(IBLOCK_ID_MODIFICATIONS, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
|
||||
$ar_res['CALCULATION'] = [];
|
||||
$ar_res['CALCULATION']['MONTHLY'] = number_format(($ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
|
||||
$models_ar_res['ITEMS'][] = $ar_res;
|
||||
}
|
||||
|
||||
$arResult['MODELS'][] = $models_ar_res;
|
||||
}
|
||||
|
||||
/*
|
||||
$models_sort = [ "SORT" => "ASC" ];
|
||||
$models_filter = [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_MODELS, ];
|
||||
$models_filter = array_merge($models_filter, $arParams['FILTER']);
|
||||
|
||||
$models_res = CIBlockElement::GetList($sort, $filter, false, []);
|
||||
while ($models_element = $models_res->GetNextElement())
|
||||
{
|
||||
$models_ar_res = $models_element->GetFields();
|
||||
$models_ar_res['PROPERTIES'] = $models_element->GetProperties();
|
||||
$models_ar_res['ITEMS'] = [];
|
||||
|
||||
if(!isset($arParams['BRAND_CODE']))
|
||||
{
|
||||
$brands_res = CIBlockElement::GetList([ "SORT" => "ASC" ], [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_BRANDS, "CODE" => $models_ar_res['PROPERTIES']['BRAND_UID']['VALUE'], ], false, [ "nPageSize" => 1 ]);
|
||||
while ($brands_element = $brands_res->GetNextElement())
|
||||
{
|
||||
$brands_ar_res = $brands_element->GetFields();
|
||||
$arParams['BRAND_CODE'] = $brands_ar_res['CODE'];
|
||||
}
|
||||
}
|
||||
|
||||
$cars_sort = [ "NAME" => "ASC" ];
|
||||
$cars_filter = [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "PROPERTY_MODEL" => $models_ar_res['ID'], ];
|
||||
|
||||
$position_res = CIBlockElement::GetList($cars_sort, $cars_filter, false, [ "nPageSize" => 3 ]);
|
||||
|
||||
while ($position_element = $position_res->GetNextElement())
|
||||
{
|
||||
$ar_res = $position_element->GetFields();
|
||||
$ar_res['PROPERTIES'] = $position_element->GetProperties();
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(IBLOCK_ID_MODIFICATIONS, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
|
||||
$ar_res['CALCULATION'] = [];
|
||||
$ar_res['CALCULATION']['MONTHLY'] = number_format(($ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
|
||||
$models_ar_res['ITEMS'][] = $ar_res;
|
||||
}
|
||||
|
||||
$arResult['MODELS'][] = $models_ar_res;
|
||||
}
|
||||
*/
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$MESS ['DEFAULT_NAME'] = "Промо модели в аграгацию";
|
||||
$MESS ['DEFAULT_DESC'] = "Промо модели в аграгацию";
|
||||
?>
|
||||
@ -0,0 +1,57 @@
|
||||
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @global CMain $APPLICATION */
|
||||
/** @global CUser $USER */
|
||||
/** @global CDatabase $DB */
|
||||
/** @var CBitrixComponentTemplate $this */
|
||||
/** @var string $templateName */
|
||||
/** @var string $templateFile */
|
||||
/** @var string $templateFolder */
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<? if(count($arResult['MODELS']) > 0): ?>
|
||||
<? foreach($arResult['MODELS'] AS $model): ?>
|
||||
<h2 class="catalog_h2_title"><?= $model['BRAND_NAME']; ?> <?= $model['NAME']; ?></h2>
|
||||
<div id="list" class="catalog_list">
|
||||
<? foreach($model['ITEMS'] AS $arItem): ?>
|
||||
<div class="catalog_item catalog_item_with_button">
|
||||
<a href="/car/<?= $arItem['CODE']; ?>/" class="item_link" area-label="<?= $arItem['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arItem['PROPERTIES']['MODEL']['RELATED']['NAME']; ?>"></a>
|
||||
<img src="<?= $arItem['PROPERTIES']['IMAGE_URL']['VALUE']; ?>" alt="<?= $arItem['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arItem['PROPERTIES']['MODEL']['RELATED']['NAME']; ?> <?= $arItem['PROPERTIES']['BODY']['VALUE']; ?>" />
|
||||
<p class="item_class"><?= $arItem['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arItem['PROPERTIES']['MODEL']['RELATED']['NAME']; ?> <?= $arItem['PROPERTIES']['BODY']['VALUE']; ?></p>
|
||||
<p class="item_model">
|
||||
<b><?= $arItem['PROPERTIES']['MODIFICATION']['RELATED']['PROPERTIES']['TITLE']['VALUE']; ?></b>
|
||||
<?= $arItem['PROPERTIES']['ENGINE_FUEL']['VALUE']; ?>, <?= $arItem['PROPERTIES']['GEAR']['VALUE']; ?>, <?= $arItem['PROPERTIES']['ENGINE_POWER']['VALUE']; ?> л.с.
|
||||
</p>
|
||||
<ul>
|
||||
<li class="pay">
|
||||
<p>Ежемесячный платёж (от)</p>
|
||||
<p><?= $arItem['CALCULATION']['MONTHLY']; ?> р.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Стоимость автомобиля (от)</p>
|
||||
<p><?= number_format($arItem['PROPERTIES']['PRICE']['VALUE'], 0, ".", " "); ?> р.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Экономия по налогу на прибыль (до)</p>
|
||||
<p><?= $arItem['CALCULATION']['SAVINGS_TAX']; ?> р.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>НДС к возмещению из бюджета (до)</p>
|
||||
<p><?= $arItem['CALCULATION']['SAVINGS_VAT']; ?> р.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="item_footer">
|
||||
<span class="button button-blue">Рассчитать график</span>
|
||||
</div>
|
||||
<p></p>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
<a class="catalog_show_more_button" href="<?= $model['PROPERTIES']['REGIONS']['VALUE'] !== "Да" ? "/catalog/" : $arParams['PATH']; ?><?= $model['BRAND_CODE']; ?>/<?= $model['CODE']; ?>/" style="cursor:pointer;">
|
||||
<span>Показать еще</span>
|
||||
</a>
|
||||
<? endforeach; ?>
|
||||
<? endif; ?>
|
||||
@ -0,0 +1,8 @@
|
||||
<?
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
|
||||
$arTemplateDescription = array(
|
||||
"NAME" => GetMessage("DEFAULT_NAME"),
|
||||
"DESCRIPTION" => GetMessage("DEFAULT_DESC"),
|
||||
);
|
||||
?>
|
||||
14
local/components/evolution/catalog.light/.parameters.php
Normal file
14
local/components/evolution/catalog.light/.parameters.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
|
||||
$arComponentParameters = array(
|
||||
'PARAMETERS' => array(
|
||||
'MAP_WIDTH' => array(
|
||||
'NAME' => GetMessage('COUNT_PER_PAGE'),
|
||||
'TYPE' => 'STRING',
|
||||
'DEFAULT' => '3',
|
||||
'PARENT' => 'BASE',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
116
local/components/evolution/catalog.light/component.php
Normal file
116
local/components/evolution/catalog.light/component.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?
|
||||
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
/** @var CBitrixComponent $this */
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @var string $componentPath */
|
||||
/** @var string $componentName */
|
||||
/** @var string $componentTemplate */
|
||||
/** @global CDatabase $DB */
|
||||
/** @global CUser $USER */
|
||||
/** @global CMain $APPLICATION */
|
||||
|
||||
use Bitrix\Main\Context,
|
||||
Bitrix\Main\Type\DateTime,
|
||||
Bitrix\Main\Loader,
|
||||
Bitrix\Iblock;
|
||||
|
||||
if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$breadcrumbs = [];
|
||||
$canonical = [];
|
||||
|
||||
$arResult = [
|
||||
'SELECTED' => [],
|
||||
'TITLES' => [],
|
||||
'ITEMS' => [],
|
||||
'FILTER_ARRAY' => [],
|
||||
];
|
||||
|
||||
$query = null;
|
||||
$query_arr = [];
|
||||
|
||||
$pages_url = $arParams['PATH'];
|
||||
|
||||
//'=PROPERTY_BODY' => $bodies_ar_res['NAME']
|
||||
$sort = Array("SORT" => "ASC", "PROPERTY_PRICE" => "DESC");
|
||||
$filter = [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW ];
|
||||
$options = [ "nPageSize" => !empty($arParams['COUNT_PER_PAGE']) ? $arParams['COUNT_PER_PAGE'] : 15 ];
|
||||
|
||||
if(isset($arParams['FILTER']))
|
||||
{
|
||||
$filter = array_merge($filter, $arParams['FILTER']);
|
||||
}
|
||||
if(isset($arParams['SORT']))
|
||||
{
|
||||
$sort = $arParams['SORT'];
|
||||
}
|
||||
|
||||
$res = CIBlockElement::GetList($sort, $filter, false, $options);
|
||||
|
||||
while ($obElement = $res->GetNextElement())
|
||||
{
|
||||
$ar_res = $obElement->GetFields();
|
||||
$ar_res['PROPERTIES'] = $obElement->GetProperties();
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(IBLOCK_ID_MODIFICATIONS, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
|
||||
$ar_res['CALCULATION'] = [];
|
||||
$ar_res['CALCULATION']['MONTHLY'] = number_format(($ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_TAX'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
$ar_res['CALCULATION']['SAVINGS_VAT'] = number_format((($ar_res['PROPERTIES']['PRICE']['VALUE'] / 100) * 4), 0, ".", " ");
|
||||
|
||||
$arResult['ITEMS'][] = $ar_res;
|
||||
}
|
||||
|
||||
$arResult['SECTION_CODE'] = !empty($arParams['section_code']) ? $arParams['section_code'] : $pages_url;
|
||||
$arResult['QUERY'] = $query;
|
||||
|
||||
if(count($arResult['ITEMS']) > 0 && $arParams["PAGINATION"] == "Y")
|
||||
{
|
||||
$arResult["NAV_STRING"] = $res->GetPageNavStringEx(
|
||||
$navComponentObject,
|
||||
"",
|
||||
"catalog",
|
||||
"N",
|
||||
null,
|
||||
[
|
||||
"section_code" => $arResult['SECTION_CODE'],
|
||||
"query" => $arResult['QUERY'],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$arResult['PAGE_CURRENT'] = $res->NavPageNomer;
|
||||
$arResult['PAGE_COUNT'] = $res->NavPageCount;
|
||||
|
||||
if(isset($_REQUEST['ajax']))
|
||||
{
|
||||
$GLOBALS['APPLICATION']->RestartBuffer();
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
$items = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
$response = [
|
||||
'ITEMS' => json_encode(str_replace(["\t","\r","\n"], ["","",""], $items), JSON_UNESCAPED_SLASHES),
|
||||
'PAGE_CURRENT' => $arResult['PAGE_CURRENT'],
|
||||
'PAGE_COUNT' => $arResult['PAGE_COUNT'],
|
||||
'PAGINATION' => json_encode(str_replace(["\t","\r","\n"], ["","",""], $arResult['NAV_STRING']), JSON_UNESCAPED_SLASHES),
|
||||
];
|
||||
|
||||
print json_encode($response, JSON_UNESCAPED_SLASHES);
|
||||
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$MESS ['DEFAULT_NAME'] = "Каталог ЛКТ для внутренних страниц";
|
||||
$MESS ['DEFAULT_DESC'] = "Каталог ЛКТ для внутренних страниц";
|
||||
?>
|
||||
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
$MESS["COUNT_PER_PAGE"] = "Количество предложений на страницу";
|
||||
@ -0,0 +1,26 @@
|
||||
var section_code = "";
|
||||
var query = "";
|
||||
var page = 2;
|
||||
|
||||
$(function()
|
||||
{
|
||||
page = parseInt($("#current_page").val(), 10) + 1;
|
||||
|
||||
$("#catalog_get_more").on("click", function()
|
||||
{
|
||||
var url = section_code+"page-"+page+"/";
|
||||
url += query !== "" ? "?"+query+"&ajax" : "?ajax";
|
||||
|
||||
$.get(url, {}, function(response)
|
||||
{
|
||||
page++;
|
||||
$(".pagination").replaceWith(JSON.parse(response['PAGINATION']));
|
||||
$("#catalog_positions_list").append(JSON.parse(response['ITEMS']));
|
||||
|
||||
if(parseInt(response['PAGE_COUNT'], 10) === parseInt(response['PAGE_CURRENT'], 10))
|
||||
{
|
||||
$("#catalog_get_more").empty();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,42 @@
|
||||
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @global CMain $APPLICATION */
|
||||
/** @global CUser $USER */
|
||||
/** @global CDatabase $DB */
|
||||
/** @var CBitrixComponentTemplate $this */
|
||||
/** @var string $templateName */
|
||||
/** @var string $templateFile */
|
||||
/** @var string $templateFolder */
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
section_code = "<?= $arResult['SECTION_CODE']; ?>";
|
||||
query = "<?= $arResult['QUERY']; ?>";
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
main {overflow-x: unset;}
|
||||
</style>
|
||||
<h2 style="padding-bottom: 40px;"><?= $arParams['TITLE']; ?></h2>
|
||||
<? if(count($arResult['ITEMS']) > 0): ?>
|
||||
<div class="catalog_list" id="catalog_positions_list">
|
||||
<? foreach($arResult['ITEMS'] AS $arItem): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.list.item",
|
||||
"",
|
||||
$arItem
|
||||
); ?>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
<? if($arResult['PAGE_COUNT'] > 1 && $arResult['PAGE_CURRENT'] != $arResult['PAGE_COUNT']): ?>
|
||||
<input type="hidden" id="current_page" value="<?= $arResult['PAGE_CURRENT']; ?>"/>
|
||||
<a class="catalog_show_more_button" id="catalog_get_more" style="cursor:pointer;">
|
||||
<span>Показать еще</span>
|
||||
</a>
|
||||
<? endif; ?>
|
||||
<? endif; ?>
|
||||
@ -0,0 +1,22 @@
|
||||
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @global CMain $APPLICATION */
|
||||
/** @global CUser $USER */
|
||||
/** @global CDatabase $DB */
|
||||
/** @var CBitrixComponentTemplate $this */
|
||||
/** @var string $templateName */
|
||||
/** @var string $templateFile */
|
||||
/** @var string $templateFolder */
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
|
||||
?>
|
||||
<? foreach($arResult['ITEMS'] AS $arItem): ?>
|
||||
<? $APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.list.item",
|
||||
"",
|
||||
$arItem
|
||||
); ?>
|
||||
<? endforeach; ?>
|
||||
@ -26,22 +26,28 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
'MODELS' => [],
|
||||
];
|
||||
|
||||
$models_res = CIBlockElement::GetList([ "SORT" => "ASC" ], [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_MODELS, "PROPERTY_BRAND_UID" => $arParams['BRAND_UID'], "PROPERTY_PROMO_VALUE" => "Да" ], false, []);
|
||||
$models_sort = [ "SORT" => "ASC" ];
|
||||
$models_filter = [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_MODELS, "PROPERTY_BRAND_UID" => $arParams['BRAND_UID'], "PROPERTY_PROMO_VALUE" => "Да" ];
|
||||
|
||||
$models_res = CIBlockElement::GetList($models_sort, $models_filter, false, []);
|
||||
while ($models_element = $models_res->GetNextElement())
|
||||
{
|
||||
$models_ar_res = $models_element->GetFields();
|
||||
$models_ar_res['PROPERTIES'] = $models_element->GetProperties();
|
||||
$models_ar_res['ITEMS'] = [];
|
||||
|
||||
$position_res = CIBlockElement::GetList([ "NAME" => "ASC" ], [ "ACTIVE" => "Y", "IBLOCK_ID" => 1, "PROPERTY_MODEL" => $models_ar_res['ID'], ], false, [ "nPageSize" => 3 ]);
|
||||
|
||||
$cars_sort = [ "NAME" => "ASC" ];
|
||||
$cars_filter = [ "ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "PROPERTY_MODEL" => $models_ar_res['ID'], ];
|
||||
|
||||
$position_res = CIBlockElement::GetList($cars_sort, $cars_filter, false, [ "nPageSize" => 3 ]);
|
||||
|
||||
while ($position_element = $position_res->GetNextElement())
|
||||
{
|
||||
$ar_res = $position_element->GetFields();
|
||||
$ar_res['PROPERTIES'] = $position_element->GetProperties();
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(8, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(9, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(10, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(IBLOCK_ID_MODIFICATIONS, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
|
||||
$ar_res['CALCULATION'] = [];
|
||||
$ar_res['CALCULATION']['MONTHLY'] = number_format(($ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT), 0, ".", " ");
|
||||
|
||||
@ -359,9 +359,9 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
$ar_res = $obElement->GetFields();
|
||||
$ar_res['PROPERTIES'] = $obElement->GetProperties();
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(8, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(9, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(10, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
$ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related(IBLOCK_ID_BRANDS, $ar_res['PROPERTIES']['BRAND']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODEL']['RELATED'] = get_related(IBLOCK_ID_MODELS, $ar_res['PROPERTIES']['MODEL']['VALUE']);
|
||||
$ar_res['PROPERTIES']['MODIFICATION']['RELATED'] = get_related(IBLOCK_ID_MODIFICATIONS, $ar_res['PROPERTIES']['MODIFICATION']['VALUE']);
|
||||
|
||||
$ar_res['CALCULATION'] = [];
|
||||
$ar_res['CALCULATION']['MONTHLY'] = number_format(($ar_res['PROPERTIES']['PRICE']['VALUE'] / CALCULATION_COEFFICIENT), 0, ".", " ");
|
||||
|
||||
@ -165,7 +165,24 @@ if(!empty($arResult['SUBTITLE']))
|
||||
<? else: ?>
|
||||
<? if($arResult['MODEL_DISABLED']): ?>
|
||||
<p style="font-size: 18px; line-height: 24px; padding: 10px 40px 40px 0px; border-left: solid 1px white;">Модель <b><?= $arResult['TITLES']['BRAND']; ?> <?= $arResult['TITLES']['MODEL']; ?></b> на данный момент отсутствует в каталоге, но это не означает, что мы не сможем её для Вас найти. Оставьте <a href="#order">заявку</a> или позвоните по номеру горячей линии <a href="tel:88003337575">8 800 333 75 75</a> и мы найдём Вам автомобиль!</p>
|
||||
<p style="font-size: 18px; line-height: 24px; padding: 0px 40px 40px 0px; border-left: solid 1px white;">Посмотрите другие модели <?= $arResult['TITLES']['BRAND']; ?>:</p>
|
||||
<? /*
|
||||
<p style="font-size: 18px; line-height: 24px; padding: 0px 40px 40px 0px; border-left: solid 1px white;">Посмотрите другие модели <?= $arResult['TITLES']['BRAND']; ?>:</p>
|
||||
*/?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:catalog.light",
|
||||
isset($_REQUEST['ajax']) ? "ajax" : "",
|
||||
array(
|
||||
"TITLE" => "Посмотрите похожие автомобили на ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL'],
|
||||
"PAGINATION" => "Y",
|
||||
"COUNT_PER_PAGE" => 3,
|
||||
//"BODY" => $_REQUEST['BODY'],
|
||||
//"BODY_SLUG" => $_REQUEST['BODY_SLUG'],
|
||||
//"SORT" => $_REQUEST['SORT'],
|
||||
"PATH" => "/catalog/",
|
||||
)
|
||||
);
|
||||
?>
|
||||
<? endif; ?>
|
||||
<? endif; ?>
|
||||
|
||||
|
||||
@ -39,7 +39,14 @@ $this->setFrameMode(true);
|
||||
<div class="news_item">
|
||||
<p class="news_date"><?= FormatDate("d F Y", MakeTimeStamp($entry['ACTIVE_FROM'])); ?></p>
|
||||
<p class="news_title"><?= $entry['NAME']; ?></p>
|
||||
<img src="<?= $entry['PREVIEW_PICTURE']; ?>" width="234px" height="234px" alt="" />
|
||||
<div class="advwrapper">
|
||||
<img src="<?= $entry['PREVIEW_PICTURE']; ?>" width="234px" height="234px" alt="" />
|
||||
<? if($entry['PROPERTIES']['ADVERTISING_ERIR']['VALUE']): ?>
|
||||
<div class="advblock adv_button_news">Реклама
|
||||
<div class="adv_button_slider_erir">ЕРИР: <?= $entry['PROPERTIES']['ADVERTISING_ERIR']['VALUE']; ?></div>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<p class="news_description"><?= $entry['PREVIEW_TEXT']; ?></p>
|
||||
<p class="news_link">Подробнее</p>
|
||||
<a href="<?= $entry['DETAIL_PAGE_URL']; ?>"></a>
|
||||
|
||||
8
local/components/evolution/preapproval/.description.php
Normal file
8
local/components/evolution/preapproval/.description.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?
|
||||
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
|
||||
$arTemplateDescription = array(
|
||||
"NAME" => GetMessage("DEFAULT_NAME"),
|
||||
"DESCRIPTION" => GetMessage("DEFAULT_DESC"),
|
||||
);
|
||||
?>
|
||||
34
local/components/evolution/preapproval/component.php
Normal file
34
local/components/evolution/preapproval/component.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?
|
||||
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
|
||||
/** @var CBitrixComponent $this */
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @var string $componentPath */
|
||||
/** @var string $componentName */
|
||||
/** @var string $componentTemplate */
|
||||
/** @global CDatabase $DB */
|
||||
/** @global CUser $USER */
|
||||
/** @global CMain $APPLICATION */
|
||||
|
||||
if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
if(CModule::IncludeModule('iblock'))
|
||||
{
|
||||
$sort = Array("SORT" => "ASC", "NAME" => "ASC");
|
||||
$filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_PROGRAMS, "PROPERTY_PREAPPROVAL_VALUE" => "Да" );
|
||||
$options = false;
|
||||
|
||||
$arResult['PROGRAMS'] = [];
|
||||
|
||||
$programs_res = CIBlockElement::GetList($sort, $filter, false, []);
|
||||
while ($programs_ob_element = $programs_res->GetNextElement())
|
||||
{
|
||||
$programs_ar_res = $programs_ob_element->GetFields();
|
||||
$programs_ar_res['PROPERTIES'] = $programs_ob_element->GetProperties();
|
||||
|
||||
$arResult['PROGRAMS'][] = [ "CODE" => $programs_ar_res['PROPERTIES']['CODE']['VALUE'], "NAME" => $programs_ar_res['PROPERTIES']['PREAPPROVAL_NAME']['VALUE'] ];
|
||||
}
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?
|
||||
$MESS ['DEFAULT_NAME'] = "Предварительное одобрение";
|
||||
$MESS ['DEFAULT_DESC'] = "Предварительное одобрение";
|
||||
?>
|
||||
@ -0,0 +1,468 @@
|
||||
const programs_with_catalog = ["la", "lkt"];
|
||||
|
||||
var preapproval_selected_program = undefined;
|
||||
var preapproval_selected_brand = undefined;
|
||||
var preapproval_exists = false;
|
||||
var preapproval_payload = {
|
||||
vat: "",
|
||||
program: "",
|
||||
brand: "",
|
||||
model: "",
|
||||
price: "",
|
||||
name: "",
|
||||
phone: "",
|
||||
};
|
||||
|
||||
var leasing_form_submitting = false;
|
||||
|
||||
function preapproval_object_check_errors()
|
||||
{
|
||||
var valid = true;
|
||||
console.log({ preapproval_payload })
|
||||
|
||||
if(preapproval_payload.vat === "")
|
||||
{
|
||||
valid = false;
|
||||
console.log("preapproval_vat");
|
||||
$("#preapproval_vat_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите ИНН организации");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(preapproval_payload.vat.toString().length < 10)
|
||||
{
|
||||
$("#preapproval_vat_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите корректный ИНН");
|
||||
}
|
||||
}
|
||||
|
||||
if(preapproval_payload.price === "")
|
||||
{
|
||||
valid = false;
|
||||
console.log("preapproval_price");
|
||||
$("#preapproval_price_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите цену объекта лизинга");
|
||||
}
|
||||
|
||||
if(preapproval_payload.program === "")
|
||||
{
|
||||
valid = false;
|
||||
console.log("preapproval_program_wrapper");
|
||||
$("#preapproval_program_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите выберите программу");
|
||||
}
|
||||
|
||||
if(preapproval_payload.brand === "")
|
||||
{
|
||||
valid = false;
|
||||
if(programs_with_catalog.indexOf(preapproval_selected_program) > -1)
|
||||
{
|
||||
console.log(1);
|
||||
$("#preapproval_brand_select_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите марку");
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(2);
|
||||
$("#preapproval_brand_input_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите марку");
|
||||
}
|
||||
}
|
||||
|
||||
if(preapproval_payload.model === "" && preapproval_payload.brand !== "Другая марка")
|
||||
{
|
||||
valid = false;
|
||||
if(programs_with_catalog.indexOf(preapproval_selected_program) > -1)
|
||||
{
|
||||
console.log(3);
|
||||
if(preapproval_payload.brand !== "")
|
||||
{
|
||||
$("#preapproval_model_select_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите модель");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(4);
|
||||
$("#preapproval_model_input_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите марку");
|
||||
}
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
function preapproval_form_check_errors()
|
||||
{
|
||||
console.log("preapproval_form_check_errors()", { preapproval_payload });
|
||||
|
||||
var valid = true;
|
||||
|
||||
if(preapproval_payload.name === "")
|
||||
{
|
||||
valid = false;
|
||||
$("#preapproval_name_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите с кем связаться");
|
||||
}
|
||||
|
||||
if(preapproval_payload.phone === "")
|
||||
{
|
||||
valid = false;
|
||||
$("#preapproval_phone_wrapper").addClass("error").attr("data-error", "Пожалуйста, укажите номер телефона");
|
||||
}
|
||||
|
||||
if(!$("#preapproval_form_policy_checkbox").is(':checked'))
|
||||
{
|
||||
valid = false;
|
||||
$("#preapproval_form_policy_wrapper").addClass("error");
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
(function InitAprrove()
|
||||
{
|
||||
console.log("OF", window.innerWidth);
|
||||
if(window.innerWidth > 540)
|
||||
{
|
||||
$("#preapproval_block").find(".block_toggle")
|
||||
.on("mouseenter", function() {
|
||||
$("#preapproval_block_span_wrapper").css("margin-left", "-20px" );
|
||||
$("#preapproval_block_span").removeClass("span_hidden").css("transform", "translate(0px, 0px)");
|
||||
})
|
||||
.on("mouseleave", function() {
|
||||
$("#preapproval_block_span_wrapper").css("margin-left", "-500px");
|
||||
$("#preapproval_block_span").add("span_hidden").css("transform", "translate(-500px, 0px)");
|
||||
});
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#preapproval_block_span_wrapper").css("margin-left", "-500px");
|
||||
$(".span_animate_out").removeClass("span_animate_out").addClass("span_hidden");
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
const wrap = $("#preapproval_block");
|
||||
const form = $(wrap).find("form");
|
||||
|
||||
const checkFields = () =>
|
||||
{
|
||||
var currentStep = $(".step.active");
|
||||
var inputsFilled = currentStep.find("input, select").filter(function()
|
||||
{
|
||||
return $(this).val() === ""|| $(this).val() === null;
|
||||
}).length === 0;
|
||||
|
||||
if(!inputsFilled)
|
||||
{
|
||||
alert("Пожалуйста, заполните все поля.");
|
||||
}
|
||||
return inputsFilled;
|
||||
}
|
||||
|
||||
$(wrap).on("click", ".block_toggle", function(e)
|
||||
{
|
||||
$(".preapproval_exists").css("display", "none");
|
||||
$(".preapproval_new").css("display", "none");
|
||||
|
||||
e.preventDefault();
|
||||
$(wrap).toggleClass("active");
|
||||
$(wrap).find(".block_title").text("Получите предварительное одобрение за 1 минуту");
|
||||
$(wrap).find(".step").eq(0).addClass("active").siblings().removeClass("active");
|
||||
});
|
||||
|
||||
$(wrap).on("change", "#preapproval_program", function(e)
|
||||
{
|
||||
console.log(e.target);
|
||||
preapproval_selected_program = e.target.value;
|
||||
preapproval_payload.program = $(this).find("option:selected").text();
|
||||
$("#preapproval_program_wrapper").removeClass("error").removeAttr("data-error");
|
||||
preapproval_payload.brand = "";
|
||||
preapproval_payload.model = "";
|
||||
$("#preapproval_brand_input").val("");
|
||||
$("#preapproval_model_input").val("");
|
||||
|
||||
$("#preapproval_brand_select").attr("disabled", true);
|
||||
$("#preapproval_brand_select").empty();
|
||||
$("#preapproval_brand_select").append('<option selected disabled value="">Марка</option>');
|
||||
|
||||
$("#preapproval_model_select").attr("disabled", true);
|
||||
$("#preapproval_model_select").empty();
|
||||
$("#preapproval_model_select").append('<option selected disabled value="">Модель</option>');
|
||||
|
||||
if(programs_with_catalog.indexOf(preapproval_selected_program) > -1)
|
||||
{
|
||||
$("#preapproval_brand_select_wrapper").css("display", "block");
|
||||
$("#preapproval_model_select_wrapper").css("display", "block");
|
||||
$("#preapproval_brand_input_wrapper").css("display", "none");
|
||||
$("#preapproval_model_input_wrapper").css("display", "none");
|
||||
|
||||
$.get("/api/programs/brands/", { "PROGRAM": preapproval_selected_program }, function(response)
|
||||
{
|
||||
if(response.brands !== undefined)
|
||||
{
|
||||
if(response.brands.length > 0)
|
||||
{
|
||||
for(let i in response.brands)
|
||||
{
|
||||
$("#preapproval_brand_select").append('<option value="'+response.brands[i].id+'">'+response.brands[i].text+'</option>');
|
||||
}
|
||||
$("#preapproval_brand_select").append('<option value="Другая марка">Другая марка</option>');
|
||||
|
||||
$("#preapproval_brand_select").attr("disabled", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#preapproval_brand_select_wrapper").css("display", "none");
|
||||
$("#preapproval_model_select_wrapper").css("display", "none");
|
||||
$("#preapproval_brand_input_wrapper").css("display", "block");
|
||||
$("#preapproval_model_input_wrapper").css("display", "block");
|
||||
}
|
||||
});
|
||||
|
||||
$(wrap).on("change", "#preapproval_brand_select", function(e)
|
||||
{
|
||||
preapproval_selected_brand = e.target.value;
|
||||
preapproval_payload.brand = $(this).find("option:selected").text();
|
||||
$("#preapproval_brand_select_wrapper").removeClass("error").removeAttr("data-error");
|
||||
$("#preapproval_brand_input_wrapper").removeClass("error").removeAttr("data-error");
|
||||
|
||||
if(preapproval_selected_brand === "Другая марка")
|
||||
{
|
||||
$("#preapproval_model_select").attr("disabled", true);
|
||||
$("#preapproval_model_select").empty();
|
||||
$("#preapproval_model_select").append('<option selected disabled value="">Модель</option>');
|
||||
preapproval_payload.model = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$.get("/api/programs/models/", { "PROGRAM": preapproval_selected_program, "BRAND_ID": preapproval_selected_brand }, function(response)
|
||||
{
|
||||
$("#preapproval_model_select").attr("disabled", true);
|
||||
$("#preapproval_model_select").empty();
|
||||
$("#preapproval_model_select").append('<option selected disabled value="">Модель</option>');
|
||||
|
||||
if(response.models !== undefined)
|
||||
{
|
||||
if(response.models.length > 0)
|
||||
{
|
||||
for(let i in response.models)
|
||||
{
|
||||
$("#preapproval_model_select").append('<option value="'+response.models[i].id+'">'+response.models[i].text+'</option>');
|
||||
}
|
||||
$("#preapproval_model_select").append('<option value="Другая модель">Другая модель</option>');
|
||||
|
||||
$("#preapproval_model_select").attr("disabled", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(wrap).on("change", "#preapproval_model_select", function(e)
|
||||
{
|
||||
preapproval_payload.model = $(this).find("option:selected").text();
|
||||
$("#preapproval_model_select_wrapper").removeClass("error").removeAttr("data-error");
|
||||
$("#preapproval_model_input_wrapper").removeClass("error").removeAttr("data-error");
|
||||
});
|
||||
|
||||
$("#preapproval_vat").on("input", function(e)
|
||||
{
|
||||
preapproval_payload.vat = e.target.value;
|
||||
$("#preapproval_vat_wrapper").removeClass("error").removeAttr("data-error");
|
||||
});
|
||||
|
||||
$("#preapproval_price").on("input", function(e)
|
||||
{
|
||||
preapproval_payload.price = e.target.value;
|
||||
$("#preapproval_price_wrapper").removeClass("error").removeAttr("data-error");
|
||||
});
|
||||
|
||||
$("#preapproval_brand_input").on("input", function(e)
|
||||
{
|
||||
preapproval_payload.brand = e.target.value;
|
||||
$("#preapproval_brand_input_wrapper").removeClass("error").removeAttr("data-error");
|
||||
});
|
||||
|
||||
$("#preapproval_model_input").on("input", function(e)
|
||||
{
|
||||
preapproval_payload.model = e.target.value;
|
||||
$("#preapproval_model_input_wrapper").removeClass("error").removeAttr("data-error");
|
||||
});
|
||||
|
||||
$("#preapproval_name").on("input", function(e)
|
||||
{
|
||||
preapproval_payload.name = e.target.value;
|
||||
$("#preapproval_name_wrapper").removeClass("error").removeAttr("data-error");
|
||||
});
|
||||
|
||||
$(wrap).on("click", ".next", function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var currentStep = $(".step.active");
|
||||
|
||||
if(preapproval_object_check_errors())
|
||||
{
|
||||
console.log({ preapproval_payload });
|
||||
|
||||
currentStep.removeClass("active");
|
||||
currentStep.next(".step").addClass("active");
|
||||
// $(wrap).find(".block_title").text("Вам предварительно одобрено всё");
|
||||
|
||||
$.post("/api/preapproval/", { vat: preapproval_payload.vat }, function(response)
|
||||
{
|
||||
console.log("/api/preapproval/", { response });
|
||||
|
||||
$(".loading_spinner").css("display", "none");
|
||||
$("#preapproval_form").css("display", "block");
|
||||
|
||||
if(response.client === "partner")
|
||||
{
|
||||
preapproval_exists = true;
|
||||
$("#preapproval_status").text("Мы Вас узнали 😊");
|
||||
$(".preapproval_exists").css("display", "block");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#preapproval_status").text("Вам предварительно одобрено финансирование");
|
||||
$(".preapproval_new").css("display", "block");
|
||||
}
|
||||
|
||||
//$(form).reset();
|
||||
//$(wrap).find(".block_close").click();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(form).on("submit", function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
var currentStep = $(".step.active");
|
||||
|
||||
if(preapproval_form_check_errors())
|
||||
{
|
||||
console.log({ preapproval_payload });
|
||||
|
||||
$(".loading_spinner").css("display", "inline-block");
|
||||
currentStep.removeClass("active");
|
||||
currentStep.next(".step").addClass("active");
|
||||
|
||||
var formData = new FormData($("#form_leasing_request")[0]);
|
||||
formData.append("form", "FORM_LEASING_REQUESTS");
|
||||
formData.append("FORM_FIELD_FIO", preapproval_payload.name);
|
||||
formData.append("FORM_FIELD_PHONE", preapproval_payload.phone);
|
||||
formData.append("FORM_FIELD_PAGE_NAME", document.title);
|
||||
formData.append("FORM_FIELD_PAGE_URL", window.location.href);
|
||||
formData.append("FORM_FIELD_BRAND", preapproval_payload.brand);
|
||||
formData.append("FORM_FIELD_MODEL", preapproval_payload.model);
|
||||
formData.append("FORM_FIELD_PRICE", preapproval_payload.price);
|
||||
formData.append("FORM_FIELD_PROGRAM", preapproval_payload.program);
|
||||
formData.append("FORM_FIELD_INN", preapproval_payload.vat);
|
||||
|
||||
grecaptcha.ready(function()
|
||||
{
|
||||
grecaptcha.execute($("meta[name=recaptcha_site_key]")
|
||||
.attr("content"), { action: 'submit' })
|
||||
.then(function(token)
|
||||
{
|
||||
formData.append("recaptcha_token", token);
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
url: "/api/forms/", type: 'POST', success: function(response)
|
||||
{
|
||||
$(".loading_spinner").css("display", "none");
|
||||
|
||||
if(response.status === "complete")
|
||||
{
|
||||
try
|
||||
{
|
||||
ym(66905533,'reachGoal','leasingform')
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
if(preapproval_exists)
|
||||
{
|
||||
$(".preapproval_exists_success").css("display", "block");
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".preapproval_new_success").css("display", "block");
|
||||
}
|
||||
}
|
||||
else if(response.status === "error")
|
||||
{
|
||||
if(response.message === "recaptcha_error")
|
||||
{
|
||||
$(".preapproval_error_recaptcha_message").css("display", "block");
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".preapproval_error_message").css("display", "block");
|
||||
}
|
||||
}
|
||||
}, data: formData,
|
||||
dataType: "json",
|
||||
cache: false, contentType: false, processData: false
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
$.post("/api/preapproval/send/", preapproval_payload, function(response)
|
||||
{
|
||||
});
|
||||
*/
|
||||
|
||||
/*
|
||||
$.post("/api/preapproval/", preapproval_payload, function(response)
|
||||
{
|
||||
console.log("send");
|
||||
$(form).reset();
|
||||
$(wrap).find(".block_close").click();
|
||||
$("#approval_status").text("Вам предварительно одобрено всё");
|
||||
$("#approval_status").text("Мы Вас узнали 😊");
|
||||
$("#approval_comment").text("Оставьте контактные данные и мы свяжемся с Вами");
|
||||
$("#approval_comment").text("Ваш менеджер по лизингу свяжется с Вами в ближайшее время");
|
||||
});
|
||||
*/
|
||||
}
|
||||
})
|
||||
|
||||
$("#preapproval_form_policy_checkbox").on("change", function(e)
|
||||
{
|
||||
if($(this).is(':checked'))
|
||||
{
|
||||
$("#preapproval_send_button").attr("disabled", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#preapproval_send_button").attr("disabled", true);
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#preapproval_phone").inputmask('+7 (999) 999-9999', {
|
||||
oncomplete: function(event) {
|
||||
const phone = event.target.value.replace(/\D/g, "");
|
||||
preapproval_payload.phone = phone;
|
||||
$("#preapproval_phone_wrapper").removeClass("error").removeAttr("data-error");
|
||||
},
|
||||
onincomplete: function(event) {
|
||||
preapproval_payload.phone = event.target.value.replace(/\D/g, "");
|
||||
},
|
||||
onBeforePaste: function(pastedValue, opts) {
|
||||
preapproval_payload.phone = pastedValue;
|
||||
$("#preapproval_phone_wrapper").removeClass("error").removeAttr("data-error");
|
||||
return pastedValue;
|
||||
},
|
||||
onBeforeMask: function(value, opts)
|
||||
{
|
||||
const phone = value.replace(/\D/g, "");
|
||||
if(phone.length === 11)
|
||||
{
|
||||
preapproval_payload.phone = phone;
|
||||
$("#preapproval_phone_wrapper").removeClass("error").removeAttr("data-error");
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,37 @@
|
||||
@keyframes loading_spinner_animation {
|
||||
0% { transform: translate(-50%,-50%) rotate(0deg); }
|
||||
100% { transform: translate(-50%,-50%) rotate(360deg); }
|
||||
}
|
||||
|
||||
.loading_spinner_animation div {
|
||||
position: absolute;
|
||||
width: 130px;
|
||||
height: 130px;
|
||||
border: 5px solid #1c01a9;
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.loading_spinner_animation div {
|
||||
animation: loading_spinner_animation 1s linear infinite;
|
||||
top: 100px;
|
||||
left: 100px
|
||||
}
|
||||
|
||||
.loading_spinner {
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.loading_spinner_animation {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
transform: translateZ(0) scale(0.28);
|
||||
backface-visibility: hidden;
|
||||
transform-origin: 0 0; /* see note above */
|
||||
}
|
||||
.loading_spinner_animation div { box-sizing: content-box; }
|
||||
@ -0,0 +1,122 @@
|
||||
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
|
||||
/** @var array $arParams */
|
||||
/** @var array $arResult */
|
||||
/** @global CMain $APPLICATION */
|
||||
/** @global CUser $USER */
|
||||
/** @global CDatabase $DB */
|
||||
/** @var CBitrixComponentTemplate $this */
|
||||
/** @var string $templateName */
|
||||
/** @var string $templateFile */
|
||||
/** @var string $templateFolder */
|
||||
/** @var string $componentPath */
|
||||
/** @var CBitrixComponent $component */
|
||||
$this->setFrameMode(true);
|
||||
?>
|
||||
<!-- Предварительное одобрение --->
|
||||
<div id="preapproval_block">
|
||||
<button class="block_open block_toggle">
|
||||
<i>
|
||||
<img src="/images/icons/preapproval_icon.svg" loading="lazy" alt="Одобрение" width="34" height="40" />
|
||||
</i>
|
||||
<div id="preapproval_block_span_wrapper">
|
||||
<span id="preapproval_block_span" class="span_animate_out">Предварительное одобрение за 1 минуту</span>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<div class="block_form">
|
||||
<div class="block_header">
|
||||
<button class="block_close block_toggle" title="Свернуть"></button>
|
||||
<p class="block_title" id="preapproval_status"></p>
|
||||
</div>
|
||||
<form>
|
||||
|
||||
<div class="step">
|
||||
<div class="form_field" id="preapproval_vat_wrapper">
|
||||
<input id="preapproval_vat" type="text" placeholder="ИНН" onkeypress='return event.charCode >= 48 && event.charCode <= 57' minlength="10" maxlength="11"/>
|
||||
</div>
|
||||
<div class="form_field" id="preapproval_program_wrapper">
|
||||
<select id="preapproval_program">
|
||||
<option selected disabled value="">Тип предмета лизинга</option>
|
||||
<? foreach($arResult['PROGRAMS'] AS $program): ?>
|
||||
<option value="<?= $program['CODE']; ?>"><?= $program['NAME']; ?></option>
|
||||
<? endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field" id="preapproval_brand_select_wrapper">
|
||||
<select id="preapproval_brand_select" disabled>
|
||||
<option selected disabled value="">Марка</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field" id="preapproval_model_select_wrapper">
|
||||
<select id="preapproval_model_select" disabled>
|
||||
<option selected disabled value="">Модель</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form_field" id="preapproval_brand_input_wrapper" style="display: none;">
|
||||
<input id="preapproval_brand_input" type="text" placeholder="Марка" />
|
||||
</div>
|
||||
|
||||
<div class="form_field" id="preapproval_model_input_wrapper" style="display: none;">
|
||||
<input id="preapproval_model_input" type="text" placeholder="Модель" />
|
||||
</div>
|
||||
|
||||
<div class="form_field" id="preapproval_price_wrapper">
|
||||
<input id="preapproval_price" type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' placeholder="Стоимость" />
|
||||
</div>
|
||||
<button class="button button-blue next">Отправить на одобрение</button>
|
||||
</div>
|
||||
|
||||
<div class="step">
|
||||
<div class="loading_spinner">
|
||||
<div class="loading_spinner_animation">
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preapproval_exists" style="display: none">
|
||||
<p>Пожалуйста, укажите контактное лицо, с которым мы можем связаться</p>
|
||||
</div>
|
||||
<div class="preapproval_new" style="display: none">
|
||||
<p>Оставьте контактные данные и мы свяжемся с Вами</p>
|
||||
</div>
|
||||
<div id="preapproval_form" style="display: none">
|
||||
<div class="form_field" id="preapproval_name_wrapper">
|
||||
<input id="preapproval_name" type="text" placeholder="Имя, фамилия" />
|
||||
</div>
|
||||
<div class="form_field" id="preapproval_phone_wrapper">
|
||||
<input id="preapproval_phone" type="phone" placeholder="Номер телефона" />
|
||||
</div>
|
||||
<div class="form_field" id="preapproval_form_policy_wrapper">
|
||||
<div class="preapproval_form_policy">
|
||||
<input type="checkbox" name="preapproval_form_policy_checkbox" id="preapproval_form_policy_checkbox" hidden checked/>
|
||||
<label for="preapproval_form_policy_checkbox">Даю свое согласие на обработку <u class="personal_data_link" id="personal_data_link">указанных персональных данных</u></label>
|
||||
</div>
|
||||
</div>
|
||||
<button class="button button-blue" id="preapproval_send_button" type="submit">Отправить</button>
|
||||
<div id="form_leasing_info" style="font-size: 9px; color: #666; opacity: 0.5; line-height:11px; height: 20px; padding-top: 12px;">защита от спама reCAPTCHA<br><a href="https://policies.google.com/privacy" target="_blank" style="font-size: 9px; color: #666; text-decoration:underline;">Конфиденциальность</a> - <a href="https://policies.google.com/terms" target="_blank" style="font-size: 9px; color: #666; text-decoration:underline;">Условия использования</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="step">
|
||||
<div class="loading_spinner">
|
||||
<div class="loading_spinner_animation">
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preapproval_exists_success" style="display: none; padding-top: 20px;">
|
||||
<p>Ваш менеджер по лизингу свяжется с Вами в ближайшее время</p>
|
||||
</div>
|
||||
<div class="preapproval_new_success" style="display: none; padding-top: 20px;">
|
||||
<p>Спасибо за заявку, наш специалист свяжется с Вами в самое ближайшее время</p>
|
||||
</div>
|
||||
<div class="preapproval_error_recaptcha_message" style="display: none; padding-top: 20px;">
|
||||
<p>Сожалеем, запросы, отправляемые с Вашего устройства похожи на автоматические. Пожалуйста, воспользуйтесь другим браузером/подключением или попробуйте позднее.</p>
|
||||
</div>
|
||||
<div class="preapproval_error_message" style="display: none; padding-top: 20px;">
|
||||
<p>Извините, в процессе создания запроса вонзикла ошибка, пожалуйста, попробуйте снова через несколько минут.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -2,6 +2,7 @@ $(document).ready(function()
|
||||
{
|
||||
function click(item)
|
||||
{
|
||||
console.log({ item });
|
||||
let slideImageAttr;
|
||||
if($(window).width() < 768) {
|
||||
slideImageAttr = "data-sm-image"
|
||||
@ -14,12 +15,24 @@ $(document).ready(function()
|
||||
$(item).addClass("active").siblings().removeClass("active");
|
||||
|
||||
$('.slider_active_title').fadeOut(150, function() {
|
||||
$(".slider_active_title").text($(item).attr("data-title")).fadeIn(150);
|
||||
$(".slider_active_title").html($(item).attr("data-title")).fadeIn(150);
|
||||
});
|
||||
|
||||
$('.main_slider-image').fadeOut(150, function() {
|
||||
$('.main_slider-image').attr("src", $(item).attr(slideImageAttr)).fadeIn(150);
|
||||
});
|
||||
|
||||
var erir = $(item).data("erir");
|
||||
if(erir !== "")
|
||||
{
|
||||
$(".adv_button_slider").css("display", "flex");
|
||||
$(".adv_button_slider_erir").text("ЕРИР: "+erir);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".adv_button_slider").css("display", "none");
|
||||
$(".adv_button_slider_erir").text("");
|
||||
}
|
||||
}
|
||||
|
||||
$("#main_slider .slider_item").on("click", function(){
|
||||
@ -29,7 +42,10 @@ $(document).ready(function()
|
||||
|
||||
});
|
||||
|
||||
$('#main_slider .slider_item:first-child').click();
|
||||
if(document.location.href.indexOf("advertise") < 0)
|
||||
{
|
||||
$('#main_slider .slider_item:first-child').click();
|
||||
}
|
||||
|
||||
let item_width = $("#main_slider .slider_item").outerWidth();
|
||||
|
||||
|
||||
@ -16,19 +16,21 @@ $this->setFrameMode(true);
|
||||
<section id="main_slider">
|
||||
<div class="container">
|
||||
<div class="main_slider_swiper">
|
||||
<p class="slider_active_title"><?= $arResult['SLIDES'][0]['NAME']; ?></p>
|
||||
<p class="slider_active_title"><?= str_replace("₽", "<span style='font-family: montserrat; font-weight: 200;'>₽</span>", $arResult['SLIDES'][0]['NAME']); ?></p>
|
||||
</div>
|
||||
<div class="slider_list">
|
||||
<div class="scrolled">
|
||||
<? $c = 0; ?>
|
||||
<? foreach($arResult['SLIDES'] AS $SLIDE): ?>
|
||||
<div
|
||||
id="slider_button_<?= $SLIDE['ID']; ?>"
|
||||
class="slider_item"
|
||||
data-title="<?= $SLIDE['NAME']; ?>"
|
||||
data-title="<?= str_replace("₽", "<span style='font-family: montserrat; font-weight: 200;'>₽</span>", $SLIDE['NAME']); ?>"
|
||||
style="color: <?= $colors[$c]; ?>;"
|
||||
data-image="<?= $SLIDE['DETAIL_PICTURE']; ?>"
|
||||
data-tb-image="<?= $SLIDE['DETAIL_PICTURE']; ?>"
|
||||
data-sm-image="<?= $SLIDE['PREVIEW_PICTURE']; ?>"
|
||||
data-erir="<?= $SLIDE['PROPERTIES']['ADVERTISING_ERIR']['VALUE']; ?>"
|
||||
>
|
||||
<p class="item_name"><?= $SLIDE['PROPERTIES']['TAGLINE']['VALUE']; ?></p>
|
||||
<span href="<?= $SLIDE['PROPERTIES']['URL']['VALUE']; ?>" class="item_link">Подробнее</span>
|
||||
@ -43,4 +45,5 @@ $this->setFrameMode(true);
|
||||
</div>
|
||||
</div>
|
||||
<img src="" class="main_slider-image" alt="Специальное предложение" />
|
||||
<div class="advblock adv_button_slider">Реклама<div class="adv_button_slider_erir"></div></div>
|
||||
</section>
|
||||
@ -32,7 +32,9 @@ if(!empty($arParams['PROPERTIES']['PARKING_CITY']['VALUE'])) { array_push($descr
|
||||
<div class="used_item_tag used_item_special_offer">Спецпредложение</div>
|
||||
<? endif; ?>
|
||||
<? if(!empty($arParams['PROPERTIES']['RESERVE_DATE']['VALUE'])): ?>
|
||||
<div class="used_item_tag used_item_reserve">Резерв до <?= date("d.m.Y", strtotime($arParams['PROPERTIES']['RESERVE_DATE']['VALUE'])); ?></div>
|
||||
<? if(strtotime($arParams['PROPERTIES']['RESERVE_DATE']['VALUE']) > time()): ?>
|
||||
<div class="used_item_tag used_item_reserve">Резерв до <?= date("d.m.Y", strtotime($arParams['PROPERTIES']['RESERVE_DATE']['VALUE'])); ?></div>
|
||||
<? endif; ?>
|
||||
<? endif; ?>
|
||||
<? if($arParams['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_leasing">Доступно в лизинг</div>
|
||||
|
||||
@ -63,8 +63,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
array_push($arResult['PHOTOS_120'], CFile::GetPath($photo_id));
|
||||
}
|
||||
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="'.$ar_res['CANONICAL_PAGE_URL'].'"/>');
|
||||
//$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/used/'.$ar_res['PROPERTIES']['BRAND']['RELATED']['CODE'].'/'.$ar_res['PROPERTIES']['MODEL']['RELATED']['CODE'].'/"/>');
|
||||
//$APPLICATION->AddHeadString('<link rel="canonical" href="'.$ar_res['CANONICAL_PAGE_URL'].'"/>');
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/izt/'.$ar_res['CODE'].'/"/>');
|
||||
}
|
||||
|
||||
if(empty($ar_res['NAME'])) { define('ERROR_404', 'Y'); }
|
||||
@ -79,6 +79,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
$APPLICATION->SetPageProperty("title", $meta['ELEMENT_META_TITLE']);
|
||||
$APPLICATION->SetPageProperty("keywords", $meta['ELEMENT_META_KEYWORDS']);
|
||||
$APPLICATION->SetPageProperty("description", $meta['ELEMENT_META_DESCRIPTION']);
|
||||
|
||||
$APPLICATION->SetPageProperty("robots", "noindex, nofollow");
|
||||
}
|
||||
|
||||
$this->IncludeComponentTemplate();
|
||||
|
||||
@ -116,7 +116,8 @@ function calculator_car_price_save()
|
||||
|
||||
function fullpage_prev()
|
||||
{
|
||||
if(fullscreen && current_image > 0)
|
||||
//fullscreen &&
|
||||
if(current_image > 0)
|
||||
{
|
||||
$(".photo_480_"+current_image).animate({ opacity: 0.0, }, 500);
|
||||
current_image--;
|
||||
@ -133,8 +134,8 @@ function fullpage_prev()
|
||||
|
||||
function fullpage_next()
|
||||
{
|
||||
console.log("fullpage_next()");
|
||||
if(fullscreen && current_image < max_images)
|
||||
// console.log("fullpage_next()");
|
||||
if(current_image < max_images)
|
||||
{
|
||||
$(".photo_480_"+current_image).animate({ opacity: 0.0, }, 500);
|
||||
current_image++;
|
||||
@ -396,41 +397,65 @@ $(function()
|
||||
fullpage_next();
|
||||
}
|
||||
});
|
||||
|
||||
$('.scroll_images').on("scroll", function(event)
|
||||
{
|
||||
var scrollPanelWidth = $('.scroll_images').outerWidth(true);
|
||||
|
||||
if(event.target.scrollLeft > 0)
|
||||
{
|
||||
$(".scroll_images_button_left").css("display", "block");
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".scroll_images_button_left").css("display", "none");
|
||||
}
|
||||
|
||||
if((event.target.scrollLeft + scrollPanelWidth) >= event.target.scrollWidth)
|
||||
{
|
||||
$(".scroll_images_button_right").css("display", "none");
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".scroll_images_button_right").css("display", "block");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const gestureZone = document.getElementById('overlay_image');
|
||||
const gestureZone = document.getElementById('photo_480_wrapper');
|
||||
const gestureZoneFullImage = document.getElementById('overlay_image');
|
||||
|
||||
gestureZone.addEventListener('touchstart', function(event) {
|
||||
touchstartX = event.changedTouches[0].screenX;
|
||||
touchstartY = event.changedTouches[0].screenY;
|
||||
touchstartX = event.changedTouches[0].screenX;
|
||||
touchstartY = event.changedTouches[0].screenY;
|
||||
}, false);
|
||||
|
||||
gestureZone.addEventListener('touchend', function(event) {
|
||||
touchendX = event.changedTouches[0].screenX;
|
||||
touchendY = event.changedTouches[0].screenY;
|
||||
handleGesture();
|
||||
touchendX = event.changedTouches[0].screenX;
|
||||
touchendY = event.changedTouches[0].screenY;
|
||||
handleGesture();
|
||||
}, false);
|
||||
|
||||
function handleGesture() {
|
||||
if (touchendX < touchstartX) {
|
||||
fullpage_next();
|
||||
console.log('<< LEFT');
|
||||
}
|
||||
|
||||
if (touchendX > touchstartX) {
|
||||
fullpage_prev();
|
||||
console.log('RIGHT >>');
|
||||
}
|
||||
gestureZoneFullImage.addEventListener('touchstart', function(event) {
|
||||
touchstartX = event.changedTouches[0].screenX;
|
||||
touchstartY = event.changedTouches[0].screenY;
|
||||
}, false);
|
||||
|
||||
if (touchendY < touchstartY) {
|
||||
console.log('Swiped up');
|
||||
gestureZoneFullImage.addEventListener('touchend', function(event) {
|
||||
touchendX = event.changedTouches[0].screenX;
|
||||
touchendY = event.changedTouches[0].screenY;
|
||||
handleGesture();
|
||||
}, false);
|
||||
|
||||
function handleGesture()
|
||||
{
|
||||
if (touchendX < touchstartX)
|
||||
{
|
||||
fullpage_next();
|
||||
}
|
||||
|
||||
if (touchendY > touchstartY) {
|
||||
console.log('Swiped down');
|
||||
}
|
||||
|
||||
if (touchendY === touchstartY) {
|
||||
console.log('Tap');
|
||||
}
|
||||
if (touchendX > touchstartX)
|
||||
{
|
||||
fullpage_prev();
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,7 @@
|
||||
.scroll_images_wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.scroll_images {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
@ -21,7 +25,7 @@
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
@media all and (max-width: 767px) {
|
||||
.scroll_images {
|
||||
margin: 2px -16px;
|
||||
width: calc(100% + 32px);
|
||||
@ -56,7 +60,7 @@
|
||||
.thumb {
|
||||
display: flex;
|
||||
width: 33.333%;
|
||||
margin: 2px 0px 8px 0px;
|
||||
margin: 2px 0px 4px 0px;
|
||||
margin-right: 0;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
@ -77,11 +81,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
@media all and (max-width: 767px) {
|
||||
.thumb {
|
||||
width: auto;
|
||||
min-width: 90px;
|
||||
height: 88px;
|
||||
height: 75px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,7 +122,7 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
@media all and (max-width: 767px) {
|
||||
#photo_480_wrapper {
|
||||
margin: 0 -16px;
|
||||
width: calc(100% + 32px);
|
||||
@ -138,7 +142,7 @@
|
||||
display: none;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
z-index: 1000;
|
||||
z-index: 1010;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@ -156,7 +160,7 @@
|
||||
|
||||
#overlay_image {
|
||||
height: auto;
|
||||
z-index: 1001;
|
||||
z-index: 1011;
|
||||
touch-action:pan-x;
|
||||
}
|
||||
|
||||
@ -181,7 +185,7 @@
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
right: 25px;
|
||||
z-index: 1002;
|
||||
z-index: 1012;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@ -199,7 +203,7 @@
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
background-color: #1c01a9;
|
||||
z-index: 1001;
|
||||
z-index: 1011;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
display: none;
|
||||
@ -220,7 +224,7 @@
|
||||
width: 50px;
|
||||
height: 100px;
|
||||
background-color: #1c01a9;
|
||||
z-index: 1001;
|
||||
z-index: 1011;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
display: none;
|
||||
@ -260,6 +264,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 540px) {
|
||||
#overlay_left {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#overlay_right {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (min-width: 768px) and (max-width: 1280px) {
|
||||
#pdf_download {
|
||||
margin-bottom: 30px;
|
||||
@ -327,6 +341,7 @@
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 50%;
|
||||
margin-top: -9px;
|
||||
transform: translateY(-18px);
|
||||
bottom: 0;
|
||||
cursor: pointer;
|
||||
@ -338,20 +353,34 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 1024px)
|
||||
{
|
||||
.scroll_images_button_left {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.scroll_images_button_right {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll_images_button_left {
|
||||
left: 3px;
|
||||
left: 0px;
|
||||
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;
|
||||
border-radius: 0px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.scroll_images_button_right {
|
||||
right:3px;
|
||||
right:0px;
|
||||
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;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.car_container_used {
|
||||
|
||||
@ -36,7 +36,7 @@ $this->setFrameMode(true);
|
||||
<ul class="breadcrumbs">
|
||||
<li></li>
|
||||
</ul>
|
||||
<h1 class="car_position_title"><em><?= $arResult['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arResult['PROPERTIES']['MODEL']['RELATED']['NAME']; ?></em><br> <?= $arResult['PROPERTIES']['MODIFICATION']['VALUE']; ?> с пробегом<?= $arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === "YES" ? " в лизинг " : " "; ?>для юридических лиц и ИП</h1>
|
||||
<h1 class="car_position_title"><em><?= $arResult['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arResult['PROPERTIES']['MODEL']['RELATED']['NAME']; ?></em><br> <?= $arResult['PROPERTIES']['MODIFICATION']['VALUE']; ?> с пробегом<?= $arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === "YES" ? " в лизинг " : " "; ?></h1>
|
||||
<div class="used_item_tags">
|
||||
<? if($arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0): ?>
|
||||
<div class="used_item_tag used_item_discount">Скидка</div>
|
||||
@ -45,7 +45,9 @@ $this->setFrameMode(true);
|
||||
<div class="used_item_tag used_item_special_offer">Спецпредложение</div>
|
||||
<? endif; ?>
|
||||
<? if(!empty($arResult['PROPERTIES']['RESERVE_DATE']['VALUE'])): ?>
|
||||
<div class="used_item_tag used_item_reserve">Резерв до <?= date("d.m.Y", strtotime($arResult['PROPERTIES']['RESERVE_DATE']['VALUE'])); ?></div>
|
||||
<? if(strtotime($arParams['PROPERTIES']['RESERVE_DATE']['VALUE']) > time()): ?>
|
||||
<div class="used_item_tag used_item_reserve">Резерв до <?= date("d.m.Y", strtotime($arResult['PROPERTIES']['RESERVE_DATE']['VALUE'])); ?></div>
|
||||
<? endif; ?>
|
||||
<? endif; ?>
|
||||
<? if($arResult['PROPERTIES']['LEASING_AVAILABLE']['VALUE_XML_ID'] === "YES"): ?>
|
||||
<div class="used_item_tag used_item_leasing">Доступно в лизинг</div>
|
||||
@ -82,7 +84,7 @@ $this->setFrameMode(true);
|
||||
<? endif; ?>
|
||||
</div>
|
||||
<?/* style="display:none;" */?>
|
||||
<div style="position: relative;">
|
||||
<div class="scroll_images_wrapper">
|
||||
<div class="scroll_images_button scroll_images_button_left"></div>
|
||||
<div class="scroll_images" data-custom-scroll="true">
|
||||
<? foreach($arResult['PHOTOS_120'] AS $k => $thumb): ?>
|
||||
@ -132,9 +134,9 @@ $this->setFrameMode(true);
|
||||
<div class="model_price">
|
||||
<? if($arResult['ACTIVE'] == "Y"): ?>
|
||||
<h2 style="margin:0; font-size:inherit; margin-bottom: 45px; line-height: 20px;">Приобретите <?= $arResult['PROPERTIES']['BRAND']['RELATED']['NAME']; ?> <?= $arResult['PROPERTIES']['MODEL']['RELATED']['NAME']; ?> на выгодных условиях</h2>
|
||||
<p style="<?= $arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? "text-decoration: line-through; margin-bottom: 20px;" : ""; ?>">
|
||||
<p style="<?= $arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? "margin-bottom: 20px;" : ""; ?>">
|
||||
Стоимость авто
|
||||
<span style="font-size: <?= ($arResult['PROPERTIES']['PRICE']['VALUE'] > 9999999) ? "30px" : "34px"; ?>"><?= number_format($arResult['PROPERTIES']['PRICE']['VALUE'], 0, ".", " "); ?> ₽</span>
|
||||
<span style="<?= $arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0 ? "text-decoration: line-through;" : ""; ?> font-size: <?= ($arResult['PROPERTIES']['PRICE']['VALUE'] > 9999999) ? "30px" : "34px"; ?>"><?= number_format($arResult['PROPERTIES']['PRICE']['VALUE'], 0, ".", " "); ?> ₽</span>
|
||||
</p>
|
||||
<? if($arResult['PROPERTIES']['PRICE_WITH_DISCOUNT']['VALUE'] > 0): ?>
|
||||
<p>
|
||||
|
||||
@ -96,7 +96,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
$arResult['SELECTED']['BRAND_ID'] = $brands_ar_res['ID'];
|
||||
$arResult['SELECTED']['BRAND_UID'] = $brands_ar_res['PROPERTIES']['UID']['VALUE'];
|
||||
$arResult['TITLES']['BRAND'] = $brands_ar_res['NAME'];
|
||||
$arResult['TITLES']['TRANSCRIPTION'] = $brands_ar_res['PROPERTIES']['TRANSCRIPTION']['VALUE'];
|
||||
$arResult['TITLES']['TRANSCRIPTION'] = !empty($brands_ar_res['PROPERTIES']['TRANSCRIPTION']['VALUE']) ? $brands_ar_res['PROPERTIES']['TRANSCRIPTION']['VALUE'] : $brands_ar_res['NAME'];
|
||||
|
||||
if($brands_ar_res['ACTIVE'] === "Y")
|
||||
{
|
||||
@ -170,6 +170,11 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
$APPLICATION->SetPageProperty("robots", "noindex, nofollow");
|
||||
}
|
||||
}
|
||||
|
||||
if($models_ar_res['PROPERTIES']['SEO_INDEXING']['VALUE_XML_ID'] !== 'YES')
|
||||
{
|
||||
$APPLICATION->SetPageProperty("robots", "noindex, nofollow");
|
||||
}
|
||||
}
|
||||
|
||||
$arResult['EXTENDED'] = true;
|
||||
@ -431,13 +436,15 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
{
|
||||
if(!empty($arResult['TITLES']['MODEL']))
|
||||
{
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг для юридических лиц и ИП в Москве - купить новый автомобиль ".$arResult['TITLES']['TRANSCRIPTION']." ".$arResult['TITLES']['MODEL']." в лизинг | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." с пробегом (б/у) в лизинг для юридических лиц и ИП в Москве - купить подержанные автомобили ".$arResult['TITLES']['TRANSCRIPTION']." ".$arResult['TITLES']['MODEL']." в лизинг | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Каталог автомобилей ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." с пробегом (б/у) в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить подержанные машины ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." с пробегом в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
$APPLICATION->SetPageProperty("keywords", $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." с пробегом в лизинг, ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." подержанные в лизинг, ".$arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." бу в лизинг");
|
||||
}
|
||||
else
|
||||
{
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." в лизинг для юридических лиц и ИП в Москве - купить новый автомобиль ".$arResult['TITLES']['TRANSCRIPTION']." в лизинг | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Новые автомобили ".$arResult['TITLES']['BRAND']." в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить ".$arResult['TITLES']['BRAND']." в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
$APPLICATION->SetPageProperty("title", $arResult['TITLES']['BRAND']." с пробегом (б/у) в лизинг для юридических лиц и ИП в Москве - купить подержанные автомобили ".$arResult['TITLES']['TRANSCRIPTION']." в лизинг | Эволюция");
|
||||
$APPLICATION->SetPageProperty("description", "Каталог автомобилей ".$arResult['TITLES']['BRAND']." с пробегом (б/у) в лизинг для юридических лиц и ИП в Москве и в других регионах России. Вы можете купить подержанные машины ".$arResult['TITLES']['BRAND']." с пробегом в лизинг от официальных дилеров, автосалонов на выгодных условиях со скидкой. Телефон горячей линии ".CENTRAL_PHONE_FORMATTED." - звонок по России бесплатный.");
|
||||
$APPLICATION->SetPageProperty("keywords", $arResult['TITLES']['BRAND']." с пробегом в лизинг, ".$arResult['TITLES']['BRAND']." подержанные в лизинг, ".$arResult['TITLES']['BRAND']." бу в лизинг");
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,6 +469,8 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
|
||||
$arResult['PAGE_CURRENT'] = $res->NavPageNomer;
|
||||
$arResult['PAGE_COUNT'] = $res->NavPageCount;
|
||||
|
||||
$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/used/'.implode("/", $canonical).(count($canonical) > 0 ? "/" : "").'"/>');
|
||||
|
||||
if($arResult['MODEL_DISABLED'])
|
||||
{
|
||||
$arResult['MODEL'] = null;
|
||||
|
||||
@ -21,7 +21,7 @@ if(!empty($arParams['REGION']) && $arParams['REGION'] !== "root")
|
||||
|
||||
if(!empty($arResult['TITLES']['BRAND']))
|
||||
{
|
||||
$title .= " ".$arResult['TITLES']['BRAND'];
|
||||
$title = "Подержанные автомобили ".$arResult['TITLES']['BRAND'];
|
||||
|
||||
if(!empty($arResult['TITLES']['MODEL']))
|
||||
{
|
||||
@ -40,15 +40,20 @@ else
|
||||
{
|
||||
if(!empty($arResult['TITLES']['BRAND']))
|
||||
{
|
||||
$title .= "Подержанные автомобили ".$arResult['TITLES']['BRAND'];
|
||||
$title = $arResult['TITLES']['BRAND']." с пробегом";
|
||||
|
||||
if(!empty($arResult['TITLES']['MODEL']))
|
||||
{
|
||||
$title = $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL'];
|
||||
$title = $arResult['TITLES']['BRAND']." ".$arResult['TITLES']['MODEL']." с пробегом";
|
||||
}
|
||||
|
||||
$subtitle = " в лизинг для юридических лиц и ИП";
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = "Лизинг б/у автомобилей";
|
||||
$subtitle = " для юридических лиц и ИП";
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($arResult['TITLE']))
|
||||
@ -77,11 +82,7 @@ if(!empty($arResult['SUBTITLE']))
|
||||
<div id="view"></div>
|
||||
<div class="pageWithSide">
|
||||
<div class="leftColumn">
|
||||
<? if($arParams['PROGRAM'] !== "" && !is_null($arParams['PROGRAM'])): ?>
|
||||
<h2 class="section_title_with_em"><em><?= !empty($title) ? $title : "Подержанные автомобили в лизинг"; ?></em><?= $subtitle !== "" ? "<br>".$subtitle : ""; ?></h2>
|
||||
<? else: ?>
|
||||
<h1 class="section_title_with_em"><em><?= !empty($title) ? $title : "Подержанные автомобили в лизинг"; ?></em><?= $subtitle !== "" ? "<br>".$subtitle : ""; ?></h1>
|
||||
<? endif; ?>
|
||||
<h1 class="section_title_with_em"><em><?= !empty($title) ? $title : "Подержанные автомобили в лизинг"; ?></em><?= $subtitle !== "" ? "<br>".$subtitle : ""; ?></h1>
|
||||
<div class="special_detail">
|
||||
<? if(!$arParams['top_banners']): ?>
|
||||
<? else: ?>
|
||||
|
||||
1865
local/iblock_edit_form_advertising.php
Normal file
1865
local/iblock_edit_form_advertising.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -40,6 +40,8 @@ $bitrix_enabled_models = [];
|
||||
|
||||
$api_brands = [];
|
||||
$api_models = [];
|
||||
$api_bodies = [];
|
||||
$api_engine_fuels = [];
|
||||
|
||||
$bitrix_existed_modifications = [];
|
||||
$bitrix_enabled_modifications = [];
|
||||
@ -47,6 +49,12 @@ $bitrix_enabled_modifications = [];
|
||||
$bitrix_existed_cars = [];
|
||||
$bitrix_enabled_cars = [];
|
||||
|
||||
$bitrix_existed_bodies = [];
|
||||
$bitrix_enabled_bodies = [];
|
||||
|
||||
$bitrix_existed_engine_fuels = [];
|
||||
$bitrix_enabled_engine_fuels = [];
|
||||
|
||||
$all_brands_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_BRANDS, "ACTIVE" => "Y" ], false, false, [] );
|
||||
while($all_brands_search_ob = $all_brands_search_res->GetNextElement())
|
||||
{
|
||||
@ -73,7 +81,7 @@ while($all_models_search_ob = $all_models_search_res->GetNextElement())
|
||||
}
|
||||
}
|
||||
|
||||
$all_modifications_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => 10, "ACTIVE" => "Y" ], false, false, [] );
|
||||
$all_modifications_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS, "ACTIVE" => "Y" ], false, false, [] );
|
||||
while($all_modifications_search_ob = $all_modifications_search_res->GetNextElement())
|
||||
{
|
||||
$modification_search = $all_modifications_search_ob->GetFields();
|
||||
@ -85,7 +93,7 @@ while($all_modifications_search_ob = $all_modifications_search_res->GetNextEleme
|
||||
}
|
||||
}
|
||||
|
||||
$all_cars_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => 1, ], false, false, [] );
|
||||
$all_cars_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, ], false, false, [] );
|
||||
while($all_cars_search_ob = $all_cars_search_res->GetNextElement())
|
||||
{
|
||||
$car_search = $all_cars_search_ob->GetFields();
|
||||
@ -98,6 +106,32 @@ while($all_cars_search_ob = $all_cars_search_res->GetNextElement())
|
||||
}
|
||||
}
|
||||
|
||||
//наполняем массивы имеющихся и активных типов кузова
|
||||
$all_bodies_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_BODIES, ], false, false, [] );
|
||||
while($all_bodies_search_ob = $all_bodies_search_res->GetNextElement())
|
||||
{
|
||||
$body_search = $all_bodies_search_ob->GetFields();
|
||||
|
||||
array_push( $bitrix_existed_bodies, $body_search['NAME'] );
|
||||
if($body_search['ACTIVE'] == "Y")
|
||||
{
|
||||
array_push( $bitrix_enabled_bodies, $body_search['NAME'] );
|
||||
}
|
||||
}
|
||||
|
||||
//наполняем массивы имеющихся и активных типов двигателя
|
||||
$all_engine_fuels_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_ENGINE_FUELS, ], false, false, [] );
|
||||
while($all_engine_fuels_search_ob = $all_engine_fuels_search_res->GetNextElement())
|
||||
{
|
||||
$engine_fuel_search = $all_engine_fuels_search_ob->GetFields();
|
||||
|
||||
array_push( $bitrix_existed_engine_fuels, $engine_fuel_search['NAME'] );
|
||||
if($engine_fuel_search['ACTIVE'] == "Y")
|
||||
{
|
||||
array_push( $bitrix_enabled_engine_fuels, $engine_fuel_search['NAME'] );
|
||||
}
|
||||
}
|
||||
|
||||
print "bitrix_existed_brands = ".count($bitrix_existed_brands)."\n";
|
||||
print "bitrix_existed_models = ".count($bitrix_existed_models)."\n";
|
||||
print "bitrix_existed_modifications = ".count($bitrix_existed_modifications)."\n";
|
||||
@ -403,7 +437,7 @@ function set_model_activity($model_uid, $active = "N")
|
||||
function set_modification_activity($modification_code, $active = "N")
|
||||
{
|
||||
$modification_id = null;
|
||||
$modification_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => 10, "CODE" => $modification_code ], false, false, [] );
|
||||
$modification_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS, "CODE" => $modification_code ], false, false, [] );
|
||||
|
||||
while($modification_search_ob = $modification_search_res->GetNextElement())
|
||||
{
|
||||
@ -437,6 +471,42 @@ function set_car_activity($car_uid, $active = "N")
|
||||
}
|
||||
}
|
||||
|
||||
function set_body_activity($body_name, $active = "N")
|
||||
{
|
||||
$body_id = null;
|
||||
$body_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_BODIES, "NAME" => $body_name ], false, false, [] );
|
||||
|
||||
while($body_search_ob = $body_search_res->GetNextElement())
|
||||
{
|
||||
$body_search = $body_search_ob->GetFields();
|
||||
$body_id = $body_search['ID'];
|
||||
}
|
||||
|
||||
if($body_id !== null)
|
||||
{
|
||||
$update_element = new CIBlockElement;
|
||||
$update_result = $update_element->Update($body_id, [ "ACTIVE" => $active, ]);
|
||||
}
|
||||
}
|
||||
|
||||
function set_engine_fuel_activity($engine_fuel_name, $active = "N")
|
||||
{
|
||||
$engine_fuel_id = null;
|
||||
$engine_fuel_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_ENGINE_FUELS, "NAME" => $engine_fuel_name ], false, false, [] );
|
||||
|
||||
while($engine_fuel_search_ob = $engine_fuel_search_res->GetNextElement())
|
||||
{
|
||||
$engine_fuel_search = $engine_fuel_search_ob->GetFields();
|
||||
$engine_fuel_id = $engine_fuel_search['ID'];
|
||||
}
|
||||
|
||||
if($engine_fuel_id !== null)
|
||||
{
|
||||
$update_element = new CIBlockElement;
|
||||
$update_result = $update_element->Update($engine_fuel_id, [ "ACTIVE" => $active, ]);
|
||||
}
|
||||
}
|
||||
|
||||
function models_check($bitrix_models, $bitrix_modifications, $bitrix_modifications_codes, $brand_uid, $brand)
|
||||
{
|
||||
foreach($brand['models'] AS $model_uid => $model)
|
||||
@ -503,7 +573,7 @@ function models_check($bitrix_models, $bitrix_modifications, $bitrix_modificatio
|
||||
$CODE = CUtil::translit( $NAME, "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] );
|
||||
|
||||
//"ID"
|
||||
$modification_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => 10, "CODE" => $CODE ], false, ["nPageSize" => 1], [] );
|
||||
$modification_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS, "CODE" => $CODE ], false, ["nPageSize" => 1], [] );
|
||||
while($modification_search_ob = $modification_search_res->GetNextElement())
|
||||
{
|
||||
$m_res = $modification_search_ob->GetFields();
|
||||
@ -518,7 +588,7 @@ function models_check($bitrix_models, $bitrix_modifications, $bitrix_modificatio
|
||||
if($modification_existed === null)
|
||||
{
|
||||
$modification_element = new CIBlockElement;
|
||||
$modification_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => 10, "PROPERTY_VALUES" => [ "MODEL_UID" => $model_uid, "TITLE" => $modification ], "NAME" => $NAME, "CODE" => $CODE, "ACTIVE" => "Y", ];
|
||||
$modification_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => IBLOCK_ID_MODIFICATIONS, "PROPERTY_VALUES" => [ "MODEL_UID" => $model_uid, "TITLE" => $modification ], "NAME" => $NAME, "CODE" => $CODE, "ACTIVE" => "Y", ];
|
||||
|
||||
if($new_modification_id = $modification_element->Add($modification_payload))
|
||||
{
|
||||
@ -601,6 +671,16 @@ foreach($json AS $car)
|
||||
"LEASING_PROGRAMS" => $car['programms'],
|
||||
];
|
||||
|
||||
if(!in_array($car['body'], $api_bodies))
|
||||
{
|
||||
array_push($api_bodies, $car['body']);
|
||||
}
|
||||
|
||||
if(!in_array($car['engine']['fuel'], $api_engine_fuels))
|
||||
{
|
||||
array_push($api_engine_fuels, $car['engine']['fuel']);
|
||||
}
|
||||
|
||||
//"ID"
|
||||
$car_existed = null;
|
||||
$car_search_res = CIBlockElement::GetList( [], [ "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "PROPERTY_UID" => $car['uid'] ], false, ["nPageSize" => 1], [] );
|
||||
@ -625,7 +705,7 @@ foreach($json AS $car)
|
||||
//if($c === 0)
|
||||
//{
|
||||
$car_element = new CIBlockElement;
|
||||
$car_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => 1, "NAME" => $name, "CODE" => $code, "PROPERTY_VALUES" => $PROPERTY_VALUES, "ACTIVE" => "Y", ];
|
||||
$car_payload = [ "IBLOCK_SECTION_ID" => false, "IBLOCK_ID" => IBLOCK_ID_CATALOG_CARS_NEW, "NAME" => $name, "CODE" => $code, "PROPERTY_VALUES" => $PROPERTY_VALUES, "ACTIVE" => "Y", ];
|
||||
|
||||
if($new_car_id = $car_element->Add($car_payload))
|
||||
{
|
||||
@ -764,6 +844,93 @@ foreach($bitrix_enabled_brands AS $enabled_brand_uid)
|
||||
}
|
||||
}
|
||||
|
||||
//кузов
|
||||
foreach($api_bodies AS $api_body)
|
||||
{
|
||||
if(!in_array($api_body, $bitrix_enabled_bodies))
|
||||
{
|
||||
//выключено
|
||||
if(!in_array($api_body, $bitrix_existed_bodies))
|
||||
{
|
||||
//не существует, создаем
|
||||
|
||||
$code = CUtil::translit( $api_body, "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] );
|
||||
$body_element = new CIBlockElement;
|
||||
$body_payload = [
|
||||
"IBLOCK_ID" => IBLOCK_ID_BODIES,
|
||||
"PROPERTY_VALUES" => [
|
||||
"SINGULAR_NAME" => $api_body,
|
||||
"PLURAL_NAME" => $api_body,
|
||||
"GENITIVE_NAME" => $api_body,
|
||||
],
|
||||
"NAME" => $api_body,
|
||||
"CODE" => $code,
|
||||
"ACTIVE" => "Y",
|
||||
];
|
||||
|
||||
$body_element->Add($body_payload);
|
||||
array_push($bitrix_existed_bodies, $api_body);
|
||||
}
|
||||
else
|
||||
{
|
||||
//существует, включаем
|
||||
set_body_activity($api_body, "Y");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($bitrix_existed_bodies AS $bitrix_body)
|
||||
{
|
||||
if(!in_array($bitrix_body, $api_bodies))
|
||||
{
|
||||
//выключаем
|
||||
set_body_activity($bitrix_body, "N");
|
||||
}
|
||||
}
|
||||
|
||||
//топливо
|
||||
foreach($api_engine_fuels AS $api_engine_fuel)
|
||||
{
|
||||
if(!in_array($api_engine_fuel, $bitrix_enabled_engine_fuels))
|
||||
{
|
||||
//выключено
|
||||
if(!in_array($api_engine_fuel, $bitrix_existed_engine_fuels))
|
||||
{
|
||||
//не существует, создаем
|
||||
$code = CUtil::translit( $api_engine_fuel, "ru", [ "max_len" => 255, "change_case" => "L", "replace_space" => "-", "replace_other" => "-", ] );
|
||||
$engine_fuel_element = new CIBlockElement;
|
||||
$engine_fuel_payload = [
|
||||
"IBLOCK_ID" => IBLOCK_ID_ENGINE_FUELS,
|
||||
"PROPERTY_VALUES" => [
|
||||
"SINGULAR_NAME" => "автомобиль с двигателем ".$api_engine_fuel,
|
||||
"PLURAL_NAME" => "автомобили с двигателем ".$api_engine_fuel,
|
||||
"GENITIVE_NAME" => "автомобилей с двигателем ".$api_engine_fuel,
|
||||
],
|
||||
"NAME" => $api_engine_fuel,
|
||||
"CODE" => $code,
|
||||
"ACTIVE" => "Y",
|
||||
];
|
||||
|
||||
$engine_fuel_element->Add($engine_fuel_payload);
|
||||
array_push($bitrix_existed_engine_fuels, $api_engine_fuel);
|
||||
}
|
||||
else
|
||||
{
|
||||
//существует, включаем
|
||||
set_engine_fuel_activity($api_engine_fuel, "Y");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($bitrix_existed_engine_fuels AS $bitrix_engine_fuel)
|
||||
{
|
||||
if(!in_array($bitrix_engine_fuel, $api_engine_fuels))
|
||||
{
|
||||
//выключаем
|
||||
set_engine_fuel_activity($bitrix_engine_fuel, "N");
|
||||
}
|
||||
}
|
||||
|
||||
$trace = "Снято с публикации марок: ".$b;
|
||||
$traceback_message .= $trace."\n";
|
||||
print "\n\n".$trace."\n\n";
|
||||
|
||||
@ -79,9 +79,9 @@
|
||||
<button class="close" area-label="Закрыть"></button>
|
||||
<p>Мы <a href="/cookies/">используем cookies</a> для улучшения использования сайта.</p>
|
||||
</div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://www.google.com/recaptcha/api.js?render=<?= RECAPTCHA_SITE_KEY; ?>"></script>
|
||||
<script src="/local/templates/evolution/js/jquery.inputmask.min.js" defer></script>
|
||||
<script src="/local/templates/evolution/js/embla-carousel.umd.min.js"></script>
|
||||
<script src="/local/templates/evolution/js/rangeslider.min.js"></script>
|
||||
<script src="/local/templates/evolution/js/main.js"></script>
|
||||
@ -93,107 +93,10 @@
|
||||
Array()
|
||||
);
|
||||
?>
|
||||
|
||||
<?/*
|
||||
<!-- Предварительное одобрение --->
|
||||
<div id="preaprove_block">
|
||||
<button class="block_open block_toggle">
|
||||
<i>
|
||||
<img src="/images/icons/approve_icon.svg" loading="lazy" alt="Одобрение" width="34" height="40" />
|
||||
</i>
|
||||
<span>Предварительное одобрение за 1 минуту</span>
|
||||
</button>
|
||||
|
||||
<div class="block_form">
|
||||
<div class="block_header">
|
||||
<button class="block_close block_toggle" title="Свернуть"></button>
|
||||
<p class="block_title"></p>
|
||||
</div>
|
||||
|
||||
<form>
|
||||
<div class="step">
|
||||
<div class="form_field">
|
||||
<input type="text" placeholder="ИНН" />
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select>
|
||||
<option selected disabled value="">Тип программы лизинга</option>
|
||||
<option value="1">2</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select>
|
||||
<option selected disabled value="">Марка</option>
|
||||
<option value="BMW">BMW</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<select>
|
||||
<option selected disabled value="">Модель</option>
|
||||
<option value="X6">X6</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<input type="text" placeholder="Стоимость" />
|
||||
</div>
|
||||
<button class="button button-blue next">Отправить на одобрение</button>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="form_field">
|
||||
<input type="text" placeholder="Ваше имя" />
|
||||
</div>
|
||||
<div class="form_field">
|
||||
<input type="phone" placeholder="Номер телефона" />
|
||||
</div>
|
||||
<button class="button button-blue" type="submit">Отправить</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function InitAprrove() {
|
||||
const wrap = $("#preaprove_block");
|
||||
const form = $(wrap).find("form");
|
||||
|
||||
const checkFields = () => {
|
||||
var currentStep = $(".step.active");
|
||||
var inputsFilled = currentStep.find("input,select").filter(function() {
|
||||
return $(this).val() === ""|| $(this).val() === null;
|
||||
}).length === 0;
|
||||
|
||||
if(!inputsFilled) {
|
||||
alert("Пожалуйста, заполните все поля.");
|
||||
}
|
||||
return inputsFilled;
|
||||
}
|
||||
|
||||
$(wrap).on("click", ".block_toggle", function(e) {
|
||||
e.preventDefault();
|
||||
$(wrap).toggleClass("active");
|
||||
$(wrap).find(".block_title").text("Получите предварительное одобрение за 1 минуту");
|
||||
$(wrap).find(".step").eq(0).addClass("active").siblings().removeClass("active");
|
||||
});
|
||||
|
||||
$(wrap).on("click", ".next", function(e) {
|
||||
e.preventDefault();
|
||||
var currentStep = $(".step.active");
|
||||
|
||||
if (checkFields()) {
|
||||
currentStep.removeClass("active");
|
||||
$(wrap).find(".block_title").text("Вам предварительно одобрено всё");
|
||||
currentStep.next(".step").addClass("active");
|
||||
}
|
||||
});
|
||||
|
||||
$(form).on("submit", function(e) {
|
||||
e.preventDefault();
|
||||
if(checkFields()) {
|
||||
console.log("send");
|
||||
$(form).reset();
|
||||
$(wrap).find(".block_close").click();
|
||||
}
|
||||
})
|
||||
}());
|
||||
</script>
|
||||
*/?>
|
||||
<?
|
||||
$APPLICATION->IncludeComponent(
|
||||
"evolution:preapproval",
|
||||
"",
|
||||
Array()
|
||||
);
|
||||
?>
|
||||
@ -85,6 +85,7 @@ footer .container {
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 50px;
|
||||
padding-bottom: 70px;
|
||||
}
|
||||
}
|
||||
footer .column {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -659,21 +659,28 @@
|
||||
#cookie {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
left: 20px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
background: #fff;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
padding: 25px 15px;
|
||||
max-width: 320px;
|
||||
z-index: 99;
|
||||
border: 1px solid #EDEFF5;
|
||||
|
||||
@media all and (max-width: 1280px) {
|
||||
bottom: 95px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
max-width: none;
|
||||
bottom: 165px;
|
||||
width: ~"calc(100% - 32px)";
|
||||
p { white-space: pre-wrap !important; }
|
||||
// bottom: 0;
|
||||
// left: 0;
|
||||
// left: 0;
|
||||
// margin: auto;
|
||||
// max-width: none;
|
||||
}
|
||||
|
||||
.close {
|
||||
@ -683,17 +690,24 @@
|
||||
background: url("/images/icons/close-blue.svg") no-repeat center;
|
||||
outline: none;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
}
|
||||
|
||||
p {
|
||||
white-space: nowrap;
|
||||
a {
|
||||
color: var(--blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cookie_spacer {
|
||||
@media all and (max-width: 768px) {
|
||||
padding-bottom: 155px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.page_search {
|
||||
margin-bottom: 25px;
|
||||
|
||||
@ -712,15 +726,107 @@
|
||||
}
|
||||
|
||||
// Предварительное одобрение
|
||||
#preaprove_block {
|
||||
#preapproval_block {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
z-index: 1000;
|
||||
left: 20px;
|
||||
bottom: 25px;
|
||||
|
||||
@media all and (max-width: 1200px) {
|
||||
display: none;
|
||||
}
|
||||
@media all and (max-width: 1280px) {
|
||||
//display: none;
|
||||
bottom: 95px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 540px) {
|
||||
&.active {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
#preapproval_block_span_wrapper {
|
||||
overflow: hidden;
|
||||
margin-left: -40px;
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
.span_hidden {
|
||||
z-index: 1;
|
||||
transform: translate(-500px, 0px);
|
||||
}
|
||||
|
||||
.span_animate_out {
|
||||
z-index: 1;
|
||||
transform: translate(0px, 0px);
|
||||
animation: preapproval_span_hide 1s normal forwards ease-in-out 1s;
|
||||
}
|
||||
|
||||
.span_animate_hide {
|
||||
z-index: 1;
|
||||
transform: translate(0px, 0px);
|
||||
animation: preapproval_span_hide 1s normal forwards ease-in-out;
|
||||
}
|
||||
|
||||
.span_animate_show {
|
||||
z-index: 1;
|
||||
transform: translate(-500px, 0px);
|
||||
animation: preapproval_span_show 1s normal forwards ease-in-out;
|
||||
}
|
||||
|
||||
i {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@keyframes preapproval_span_hide {
|
||||
from {
|
||||
transform: translate(0px, 0px);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translate(-500px, 0px);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes preapproval_span_show {
|
||||
from {
|
||||
transform: translate(-500px, 0px);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translate(0px, 0px);
|
||||
}
|
||||
}
|
||||
|
||||
.preapproval_form_policy {
|
||||
label {
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
line-height: 14px;
|
||||
color: rgb(12, 12, 12);
|
||||
font-weight: 300;
|
||||
padding-left: 28px;
|
||||
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
|
||||
&:before {
|
||||
background: #fff;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
input:checked+label:before {
|
||||
background: url("/images/icons/checkbox_white.svg") no-repeat center #1c01a9;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
.block_open {
|
||||
@ -729,6 +835,12 @@
|
||||
|
||||
.block_form {
|
||||
display: block;
|
||||
|
||||
@media all and (max-width: 540px) {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
border-radius: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -764,6 +876,10 @@
|
||||
background: var(--blue);
|
||||
position: relative;
|
||||
|
||||
@media all and (max-width: 768px) {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
display: block;
|
||||
@ -826,9 +942,25 @@
|
||||
.step {
|
||||
text-align: center;
|
||||
|
||||
&:not(.active) {
|
||||
p {
|
||||
padding: 0px 20px 20px 20px;
|
||||
}
|
||||
|
||||
&:not(.active) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.error {
|
||||
input {
|
||||
border-color: #A8026B;
|
||||
|
||||
}
|
||||
|
||||
&:after {
|
||||
color: #A8026B;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -114,7 +114,7 @@ body {
|
||||
|
||||
@media all and (max-width: 1600px) and (min-width: 1280px) {
|
||||
padding-top: 45px;
|
||||
padding-bottom: 45px;
|
||||
padding-bottom: 85px;
|
||||
}
|
||||
|
||||
@media all and (max-width: 960px) {
|
||||
@ -1099,7 +1099,7 @@ section[data-page] {
|
||||
|
||||
[data-custom-scroll]::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
[data-custom-scroll]::-webkit-scrollbar-track {
|
||||
@ -1109,4 +1109,69 @@ section[data-page] {
|
||||
[data-custom-scroll]::-webkit-scrollbar-thumb {
|
||||
background: var(--blue);
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.advwrapper {
|
||||
position: relative;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.advblock {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
justify-content: flex-start;
|
||||
overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
}
|
||||
}
|
||||
|
||||
.adv_button_slider {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 2px;
|
||||
top: 0px;
|
||||
z-index: 1;
|
||||
font-size: 10px;
|
||||
color: rgba(0,0,0,0.75);
|
||||
padding: 6px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
cursor: pointer;
|
||||
background: rgba(255,255,255,0.55);
|
||||
border-radius: 0px;
|
||||
line-height: 15px;
|
||||
width: 57px;
|
||||
height: 17px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.adv_button_news {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
top: 0px;
|
||||
z-index: 4;
|
||||
font-size: 9px;
|
||||
color: rgba(0,0,0,1);
|
||||
padding: 6px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
cursor: pointer;
|
||||
background: rgba(255,255,255,1);
|
||||
line-height: 14px;
|
||||
width: 53px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.adv_button_slider_erir {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.adv_button_news_article {
|
||||
right: 12px !important;
|
||||
top: 2px !important;
|
||||
}
|
||||
8
local/templates/evolution/js/jquery.inputmask.min.js
vendored
Normal file
8
local/templates/evolution/js/jquery.inputmask.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -52,11 +52,13 @@ function init()
|
||||
if(cookies != 'true')
|
||||
{
|
||||
$("#cookie").show();
|
||||
$("footer").find(".container").addClass("cookie_spacer");
|
||||
}
|
||||
|
||||
$('#cookie .close').click(function()
|
||||
{
|
||||
$('#cookie').hide();
|
||||
$('#cookie').hide();
|
||||
$(".cookie_spacer").removeClass("cookie_spacer");
|
||||
setCookie('Policy', 'true', '365', '/');
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user