fix: прямые ссылки на PDF документов техники (инструкция + паспорт)

This commit is contained in:
wasrusgen 2026-05-28 17:04:12 +03:00
parent 88c69e36e6
commit 7414b69419

View File

@ -250,7 +250,7 @@ window._managerOrders = window._managerOrders || [
rooms:['Кухня'], rooms:['Кухня'],
tech:[ tech:[
{name:'Духовой шкаф', wkey:'oven', status:'wait', dims:'', brand:'', source:null}, {name:'Духовой шкаф', wkey:'oven', status:'wait', dims:'', brand:'', source:null},
{name:'Варочная панель', wkey:'cooktop', status:'done', dims:'60×52 см', brand:'Bosch', model:'HXA050B20R', source:'ai'}, {name:'Варочная панель', wkey:'cooktop', status:'done', dims:'60×52 см', brand:'Bosch', model:'PUE611BB5E', source:'ai'},
{name:'Вытяжка', wkey:'hood', status:'client_chosen', dims:'60 см', brand:'Elica', model:'FLAT GLASS IX/A/60', source:'client'}, {name:'Вытяжка', wkey:'hood', status:'client_chosen', dims:'60 см', brand:'Elica', model:'FLAT GLASS IX/A/60', source:'client'},
{name:'Посудомойка', wkey:'dishwasher', status:'wait', dims:'', brand:'', source:null}, {name:'Посудомойка', wkey:'dishwasher', status:'wait', dims:'', brand:'', source:null},
{name:'Холодильник', wkey:'fridge', status:'wait', dims:'', brand:'', source:null}, {name:'Холодильник', wkey:'fridge', status:'wait', dims:'', brand:'', source:null},
@ -2257,26 +2257,65 @@ function screenOrder() {
} }
// ─── Документы изделия (инструкция + паспорт) ─── // ─── Документы изделия (инструкция + паспорт) ───
function _techDocLinks(t){ // Верифицированные прямые ссылки на PDF/страницы документов
if(!t.brand) return ''; var _TECH_DOCS = {
var base=''; // Bosch варочные панели
var b=(t.brand||'').toLowerCase(); 'PUE611BB5E': {
var m=t.model||''; manual: 'https://bosch-centre.ru/upload/iblock/14b/dztw8oc73p5ssxnwr5f5m1qzk8223mtx/9001608943_E.pdf',
var q=encodeURIComponent((t.brand+' '+m).trim()); passport: 'https://bosch-centre.ru/bosch/varochnye-paneli/elektricheskie/varochnaya-panel-bosch-pue-611-bb5e.html'
if(b==='bosch'){ },
base='https://www.bosch-home.com/ru/search.html?query='+encodeURIComponent(m||t.brand); 'PIE631FB1E': {
} else { manual: 'https://www.hausdorf.ru/upload/iblock/808/installation_hausdorf_elektricheskaya_varochnaya_panel_bosch_pie631fb1e.pdf',
base='https://www.google.com/search?q='+q; passport: 'https://media3.bosch-home.com/Documents/specsheet/ru-RU/PIE631FB1E.pdf'
},
'PIF612BB1E': {
manual: 'https://www.hausdorf.ru/search/?q=Bosch+PIF612BB1E',
passport: 'https://media3.bosch-home.com/Documents/specsheet/ru-RU/PIF612BB1E.pdf'
},
// Bosch холодильники
'KGN56LW31U': {
manual: 'https://bosch-centre.ru/technical-documentation/holodilniki/',
passport: 'https://bosch-centre.ru/bosch/holodilniki/dvuhkamernye-holodilniki/dvukhkamernyy-kholodilnik-bosch-kgn56lw31u.html'
},
// Bosch посудомойки
'SPV4HMX10E': {
manual: 'https://www.hausdorf.ru/search/?q=Bosch+SPV4HMX10E',
passport: 'https://media3.bosch-home.com/Documents/specsheet/ru-RU/SPV4HMX10E.pdf'
},
// Elica вытяжки
'FLAT GLASS IX/A/60': {
manual: 'https://www.hausdorf.ru/upload/iblock/d4b/instruction_hausdorf_vytyazhka_elica_flat_glass_ix_a_60_1.pdf',
passport: 'https://www.manualslib.com/products/Elica-Flat-Glass-Ix-A-60-13710296.html'
}
};
function _techDocLinks(t){
if(!t.brand || !t.model) return '';
var m = (t.model||'').trim();
var b = (t.brand||'').toLowerCase();
var docs = _TECH_DOCS[m];
var manualUrl, passportUrl;
if(docs){
manualUrl = docs.manual;
passportUrl = docs.passport;
} else if(b==='bosch'){
// Для Bosch без известного файла — hausdorf.ru поиск + страница продукта на bosch-centre.ru
var mq = encodeURIComponent('Bosch '+m);
manualUrl = 'https://www.hausdorf.ru/search/?q='+mq;
passportUrl = 'https://bosch-centre.ru/search/?q='+mq;
} else {
// Для других брендов — Google
var q = encodeURIComponent(t.brand+' '+m);
manualUrl = 'https://www.google.com/search?q='+q+'+%D0%B8%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%86%D0%B8%D1%8F+PDF';
passportUrl = 'https://www.google.com/search?q='+q+'+%D0%BF%D0%B0%D1%81%D0%BF%D0%BE%D1%80%D1%82+%D1%85%D0%B0%D1%80%D0%B0%D0%BA%D1%82%D0%B5%D1%80%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B8';
} }
var manualUrl = b==='bosch' ? base : 'https://www.google.com/search?q='+encodeURIComponent((t.brand+' '+m+' инструкция по установке').trim());
var passportUrl= b==='bosch' ? base : 'https://www.google.com/search?q='+encodeURIComponent((t.brand+' '+m+' паспорт характеристики').trim());
return '<div style="display:flex;gap:5px;margin-top:7px;width:100%">' return '<div style="display:flex;gap:5px;margin-top:7px;width:100%">'
+'<a href="'+manualUrl+'" target="_blank" rel="noopener" style="flex:1;display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:5px 6px;background:#EFF6FF;border:1px solid #BFDBFE;border-radius:8px;text-decoration:none;font-size:10px;font-weight:700;color:#1D4ED8">' +'<a href="'+manualUrl+'" target="_blank" rel="noopener" style="flex:1;display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:5px 6px;background:#EFF6FF;border:1px solid #BFDBFE;border-radius:8px;text-decoration:none;font-size:10px;font-weight:700;color:#1D4ED8">'
+'<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>' +'<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>'
+'Инструкция</a>' +'📄 Инструкция</a>'
+'<a href="'+passportUrl+'" target="_blank" rel="noopener" style="flex:1;display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:5px 6px;background:#F0FDF4;border:1px solid #BBF7D0;border-radius:8px;text-decoration:none;font-size:10px;font-weight:700;color:#15803D">' +'<a href="'+passportUrl+'" target="_blank" rel="noopener" style="flex:1;display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:5px 6px;background:#F0FDF4;border:1px solid #BBF7D0;border-radius:8px;text-decoration:none;font-size:10px;font-weight:700;color:#15803D">'
+'<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M9 9h6M9 12h6M9 15h4"/></svg>' +'<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M9 9h6M9 12h6M9 15h4"/></svg>'
+'Паспорт</a>' +'📋 Паспорт</a>'
+'</div>'; +'</div>';
} }