footer
This commit is contained in:
@ -175,39 +175,33 @@ const VehicleSearchResultsPage: React.FC<VehicleSearchResultsPageProps> = () =>
|
||||
<>
|
||||
|
||||
|
||||
<main className="bg-gray-50 min-h-screen">
|
||||
{/* Breadcrumb */}
|
||||
<div className="bg-white border-b">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
|
||||
<nav className="flex" aria-label="Breadcrumb">
|
||||
<ol className="flex items-center space-x-4">
|
||||
<li>
|
||||
<Link href="/" className="text-gray-400 hover:text-gray-500">
|
||||
Главная
|
||||
</Link>
|
||||
</li>
|
||||
<li>
|
||||
<div className="flex items-center">
|
||||
<svg className="flex-shrink-0 h-5 w-5 text-gray-300" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
|
||||
<path d="M5.555 17.776l8-16 .894.448-8 16-.894-.448z" />
|
||||
</svg>
|
||||
<span className="ml-4 text-sm font-medium text-red-600">
|
||||
{searchType === 'vin' ? 'Найденные автомобили' : 'Найденные автомобили'}
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<main className="bg-[#F5F8FB] min-h-screen">
|
||||
{/* Breadcrumb (InfoSearch style) */}
|
||||
<section className="section-info">
|
||||
<div className="w-layout-blockcontainer container info w-container">
|
||||
<div className="w-layout-vflex flex-block-9">
|
||||
<div className="w-layout-hflex flex-block-7">
|
||||
<a href="/" className="link-block w-inline-block">
|
||||
<div>Главная</div>
|
||||
</a>
|
||||
<div className="text-block-3">→</div>
|
||||
<a href="#" className="link-block-2 w-inline-block">
|
||||
<div>Найденные автомобили</div>
|
||||
</a>
|
||||
</div>
|
||||
<div className="w-layout-hflex flex-block-8">
|
||||
<div className="w-layout-hflex flex-block-10">
|
||||
<h1 className="heading">{searchType === 'vin' ? 'Поиск по VIN номеру' : 'Поиск по государственному номеру'}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Search Results Header */}
|
||||
<div className="bg-white">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<div className="mb-6">
|
||||
<h1 className="text-3xl font-bold text-gray-900 mb-2">
|
||||
{searchType === 'vin' ? 'Поиск по VIN номеру' : 'Поиск по государственному номеру'}
|
||||
</h1>
|
||||
<div className="flex flex-col items-center pt-10 pb-16 max-md:px-5">
|
||||
<div className="w-full max-w-[1580px]">
|
||||
{/* <div className="mb-6">
|
||||
<p className="text-lg text-gray-600">
|
||||
Запрос: <span className="font-mono font-bold">{searchQuery}</span>
|
||||
</p>
|
||||
@ -216,18 +210,13 @@ const VehicleSearchResultsPage: React.FC<VehicleSearchResultsPageProps> = () =>
|
||||
Найдено {vehicles.length} автомобилей
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
{/* Loading State */}
|
||||
{isLoading && (
|
||||
<div className="flex items-center justify-center py-12">
|
||||
<div className="flex items-center space-x-3">
|
||||
<svg className="animate-spin h-8 w-8 text-red-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
|
||||
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
||||
</svg>
|
||||
<span className="text-lg text-gray-600">Поиск автомобилей...</span>
|
||||
</div>
|
||||
<div className="bg-white rounded-2xl shadow p-10 flex flex-col items-center justify-center min-h-[300px]">
|
||||
<div className="animate-spin rounded-full h-24 w-24 border-b-2 border-red-600 mb-6"></div>
|
||||
<p className="text-lg text-gray-600">Поиск автомобилей...</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -247,9 +236,9 @@ const VehicleSearchResultsPage: React.FC<VehicleSearchResultsPageProps> = () =>
|
||||
{vehicles[0]?.year && ` (${vehicles[0].year} г.)`}
|
||||
{vehicles[0]?.engine && `, двигатель: ${vehicles[0].engine}`}
|
||||
</p>
|
||||
<p className="text-sm text-green-600 mt-1">
|
||||
🚀 Переходим сразу к категориям запчастей...
|
||||
</p>
|
||||
<p className="text-sm text-green-600 mt-1">
|
||||
🚀 Переходим сразу к категориям запчастей...
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
@ -262,209 +251,58 @@ const VehicleSearchResultsPage: React.FC<VehicleSearchResultsPageProps> = () =>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Results Table */}
|
||||
{/* Results List (Search-like style, not table) */}
|
||||
{!isLoading && vehicles.length > 0 && !isRedirecting && (
|
||||
<div className="bg-white shadow-sm rounded-lg overflow-hidden">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="min-w-full divide-y divide-gray-200">
|
||||
<thead className="bg-gray-50">
|
||||
<tr>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Бренд
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Название
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Модель
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Год
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Двигатель
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
КПП
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Рынок
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Дата выпуска
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Период производства
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Дополнительно
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="bg-white divide-y divide-gray-200">
|
||||
{vehicles.map((vehicle, index) => {
|
||||
console.log('🔍 Отображаем автомобиль в таблице:', {
|
||||
index,
|
||||
vehicleid: vehicle.vehicleid,
|
||||
name: vehicle.name,
|
||||
brand: vehicle.brand,
|
||||
catalog: vehicle.catalog,
|
||||
model: vehicle.model,
|
||||
year: vehicle.year,
|
||||
engine: vehicle.engine,
|
||||
ssd: vehicle.ssd ? vehicle.ssd.substring(0, 30) + '...' : 'отсутствует'
|
||||
});
|
||||
|
||||
return (
|
||||
<tr
|
||||
key={vehicle.vehicleid || index}
|
||||
onClick={() => handleVehicleSelect(vehicle)}
|
||||
className="hover:bg-gray-50 cursor-pointer transition-colors"
|
||||
>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
|
||||
{vehicle.brand}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{vehicle.name}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{vehicle.model}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{(() => {
|
||||
const year = vehicle.year || vehicle.manufactured || (vehicle.date ? vehicle.date.split('.').pop() : '') || '';
|
||||
console.log(`🗓️ Год для автомобиля ${vehicle.vehicleid}:`, { year, original_year: vehicle.year, manufactured: vehicle.manufactured, date: vehicle.date });
|
||||
return year || '-';
|
||||
})()}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{(() => {
|
||||
const engine = vehicle.engine || vehicle.engine_info || vehicle.engineno || '';
|
||||
console.log(`🔧 Двигатель для автомобиля ${vehicle.vehicleid}:`, { engine, original_engine: vehicle.engine, engine_info: vehicle.engine_info, engineno: vehicle.engineno });
|
||||
return engine || '-';
|
||||
})()}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{(() => {
|
||||
const transmission = vehicle.transmission || vehicle.bodytype || '';
|
||||
console.log(`⚙️ КПП для автомобиля ${vehicle.vehicleid}:`, { transmission, original_transmission: vehicle.transmission, bodytype: vehicle.bodytype });
|
||||
return transmission || '-';
|
||||
})()}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{(() => {
|
||||
const market = vehicle.market || vehicle.destinationregion || vehicle.creationregion || '';
|
||||
console.log(`🌍 Рынок для автомобиля ${vehicle.vehicleid}:`, { market, original_market: vehicle.market, destinationregion: vehicle.destinationregion, creationregion: vehicle.creationregion });
|
||||
return market || '-';
|
||||
})()}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{(() => {
|
||||
const releaseDate = vehicle.date || vehicle.manufactured || '';
|
||||
console.log(`📅 Дата выпуска для автомобиля ${vehicle.vehicleid}:`, { releaseDate, date: vehicle.date, manufactured: vehicle.manufactured });
|
||||
return releaseDate || '-';
|
||||
})()}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-900">
|
||||
{(() => {
|
||||
let prodPeriod = '';
|
||||
if (vehicle.prodRange) {
|
||||
prodPeriod = vehicle.prodRange;
|
||||
} else if (vehicle.prodPeriod) {
|
||||
prodPeriod = vehicle.prodPeriod;
|
||||
} else if (vehicle.datefrom && vehicle.dateto) {
|
||||
prodPeriod = `${vehicle.datefrom} - ${vehicle.dateto}`;
|
||||
} else if (vehicle.modelyearfrom && vehicle.modelyearto) {
|
||||
prodPeriod = `${vehicle.modelyearfrom} - ${vehicle.modelyearto}`;
|
||||
}
|
||||
console.log(`📈 Период производства для автомобиля ${vehicle.vehicleid}:`, {
|
||||
prodPeriod,
|
||||
prodRange: vehicle.prodRange,
|
||||
original_prodPeriod: vehicle.prodPeriod,
|
||||
datefrom: vehicle.datefrom,
|
||||
dateto: vehicle.dateto,
|
||||
modelyearfrom: vehicle.modelyearfrom,
|
||||
modelyearto: vehicle.modelyearto
|
||||
});
|
||||
return prodPeriod || '-';
|
||||
})()}
|
||||
</td>
|
||||
<td className="px-6 py-4 text-sm text-gray-900">
|
||||
<div className="space-y-1">
|
||||
{vehicle.framecolor && (
|
||||
<div className="text-xs">
|
||||
<span className="font-medium">Цвет кузова:</span> {vehicle.framecolor}
|
||||
</div>
|
||||
)}
|
||||
{vehicle.trimcolor && (
|
||||
<div className="text-xs">
|
||||
<span className="font-medium">Цвет салона:</span> {vehicle.trimcolor}
|
||||
</div>
|
||||
)}
|
||||
{vehicle.engineno && (
|
||||
<div className="text-xs">
|
||||
<span className="font-medium">Номер двигателя:</span> {vehicle.engineno}
|
||||
</div>
|
||||
)}
|
||||
{vehicle.engine_info && (
|
||||
<div className="text-xs max-w-xs truncate" title={vehicle.engine_info}>
|
||||
<span className="font-medium">Двигатель:</span> {vehicle.engine_info}
|
||||
</div>
|
||||
)}
|
||||
{vehicle.options && (
|
||||
<div className="text-xs max-w-xs truncate" title={vehicle.options}>
|
||||
<span className="font-medium">Опции:</span> {vehicle.options}
|
||||
</div>
|
||||
)}
|
||||
{vehicle.description && (
|
||||
<div className="text-xs max-w-xs truncate" title={vehicle.description}>
|
||||
<span className="font-medium">Описание:</span> {vehicle.description}
|
||||
</div>
|
||||
)}
|
||||
{vehicle.modification && (
|
||||
<div className="text-xs max-w-xs truncate" title={vehicle.modification}>
|
||||
<span className="font-medium">Модификация:</span> {vehicle.modification}
|
||||
</div>
|
||||
)}
|
||||
{vehicle.grade && (
|
||||
<div className="text-xs">
|
||||
<span className="font-medium">Класс:</span> {vehicle.grade}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
<div className="bg-white rounded-2xl shadow p-10">
|
||||
<div className="flex flex-wrap items-center gap-6 font-bold text-gray-900 text-base mb-2 px-2">
|
||||
<div className="min-w-[100px] flex-1 break-words">Бренд</div>
|
||||
<div className="min-w-[120px] flex-1 break-words">Название</div>
|
||||
<div className="min-w-[120px] flex-1 break-words">Модель</div>
|
||||
<div className="min-w-[60px] flex-1 break-words">Год</div>
|
||||
<div className="min-w-[120px] flex-1 break-words">Двигатель</div>
|
||||
<div className="min-w-[80px] flex-1 break-words">КПП</div>
|
||||
<div className="min-w-[80px] flex-1 break-words">Рынок</div>
|
||||
<div className="min-w-[100px] flex-1 break-words">Дата выпуска</div>
|
||||
<div className="min-w-[140px] flex-1 break-words">Период производства</div>
|
||||
</div>
|
||||
<div className="space-y-0">
|
||||
{vehicles.map((vehicle, index) => (
|
||||
<div
|
||||
key={vehicle.vehicleid || index}
|
||||
className="flex flex-wrap items-center gap-6 bg-white border-b border-gray-200 px-6 py-3 cursor-pointer hover:bg-slate-100 transition-colors max-w-full"
|
||||
onClick={() => handleVehicleSelect(vehicle)}
|
||||
style={{ minWidth: 0 }}
|
||||
>
|
||||
<div className="font-bold text-gray-900 text-base min-w-[100px] flex-1 break-words">{vehicle.brand}</div>
|
||||
<div className="text-gray-900 text-base min-w-[120px] flex-1 break-words">{vehicle.name}</div>
|
||||
<div className="text-gray-900 text-base min-w-[120px] flex-1 break-words">{vehicle.model}</div>
|
||||
<div className="text-gray-900 text-base min-w-[60px] flex-1 break-words">{vehicle.year || '-'}</div>
|
||||
<div className="text-gray-900 text-base min-w-[120px] flex-1 break-words">{vehicle.engine || '-'}</div>
|
||||
<div className="text-gray-900 text-base min-w-[80px] flex-1 break-words">{vehicle.transmission || '-'}</div>
|
||||
<div className="text-gray-900 text-base min-w-[80px] flex-1 break-words">{vehicle.market || '-'}</div>
|
||||
<div className="text-gray-900 text-base min-w-[100px] flex-1 break-words">{vehicle.date || vehicle.manufactured || '-'}</div>
|
||||
<div className="text-gray-900 text-base min-w-[140px] flex-1 break-words">{vehicle.prodRange || vehicle.prodPeriod || ((vehicle.datefrom && vehicle.dateto) ? `${vehicle.datefrom} - ${vehicle.dateto}` : (vehicle.modelyearfrom && vehicle.modelyearto) ? `${vehicle.modelyearfrom} - ${vehicle.modelyearto}` : '-')}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* No Results */}
|
||||
{!isLoading && vehicles.length === 0 && searchQuery && (
|
||||
<div className="text-center py-12">
|
||||
<div className="text-yellow-400 mb-4">
|
||||
<svg className="w-16 h-16 mx-auto" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.728-.833-2.498 0L4.316 14.5c-.77.833.192 2.5 1.732 2.5z" />
|
||||
</svg>
|
||||
</div>
|
||||
<h3 className="text-xl font-medium text-gray-900 mb-2">
|
||||
{searchType === 'vin' ? 'VIN не найден' : 'Госномер не найден'}
|
||||
<div className="bg-[#eaf0fa] border border-[#b3c6e6] rounded-2xl shadow p-10 text-center">
|
||||
<svg className="w-16 h-16 mx-auto mb-4" style={{ color: '#0d336c' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 0112 15c-2.34 0-4.29-1.009-5.824-2.562M15 9.75a3 3 0 11-6 0 3 3 0 016 0z" />
|
||||
</svg>
|
||||
<h3 className="text-xl font-semibold mb-2" style={{ color: '#0d336c' }}>
|
||||
Автомобили не найдены
|
||||
</h3>
|
||||
<p className="text-gray-600 mb-6">
|
||||
{searchType === 'vin'
|
||||
? `Автомобиль с VIN номером ${searchQuery} не найден в доступных каталогах`
|
||||
: `Автомобиль с государственным номером ${searchQuery} не найден в базе данных`
|
||||
}
|
||||
<p className="mb-4" style={{ color: '#0d336c' }}>
|
||||
По запросу <span className="font-mono font-semibold">{searchQuery}</span> автомобили не найдены.
|
||||
</p>
|
||||
<p className="text-sm" style={{ color: '#3b5a99' }}>
|
||||
Попробуйте изменить запрос или проверьте правильность написания.
|
||||
</p>
|
||||
<Link
|
||||
href="/"
|
||||
className="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"
|
||||
>
|
||||
Вернуться на главную
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
Reference in New Issue
Block a user