세부검색
목록 지도
목록
지도 영역
${item.desc}
`); } else if (item.type === 'subway') { $dropdown.append(` `); } }); $dropdown.show(); }); }); $dropdown.on('click', '.dropdown-item', function () { $input.val($(this).data('value')); moveTo($(this).data('lat'),$(this).data('lng')); $dropdown.hide(); }); $(document).on('click', function (e) { if (!$(e.target).closest('.position-relative').length) { $dropdown.hide(); } }); $dropdown.on('click', '.dropdown-item', function () { const title = $(this).data('title'); const type = $(this).data('type'); const value = $(this).data('value'); $('#address').val(title); $dropdown.hide(); if (type === 'address') { $('#address_id').val(value); $('#subway_id').val(''); } else if (type === 'subway') { $('#subway_id').val(value); $('#address_id').val(''); } $('form[tibosearch]').trigger('submit'); }); /************************************************ * 모바일에서 세부검색창 열기 ************************************************/ $('.btn-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').addClass('mobile-active'); $('body').css('overflow', 'hidden'); }); /************************************************ * 모바일에서 세부검색창 닫기 ************************************************/ $('.btn-close-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').removeClass('mobile-active'); $('body').css('overflow', ''); }); }); var price_sell_max = 150000; var price_full_max = 100000; var price_deposit_max = 10000; var price_monthly_max = 200; $(function () { // 매매가 슬라이더 $("#price_sell_slider").ionRangeSlider({ type: "double", min: 0, max: price_sell_max, from: 0, to: price_sell_max, step: 5000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_sell_max), onFinish: function (data) { $('#price_sell_min').val(data.from); $('#price_sell_max').val(data.to); } }); // 전세가 슬라이더 $("#price_full_slider").ionRangeSlider({ type: "double", min: 0, max: price_full_max, from: 0, to: price_full_max, step: 1000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_full_max), onFinish: function (data) { $('#price_full_min').val(data.from); $('#price_full_max').val(data.to); } }); // 보증금 슬라이더 $("#price_deposit_slider").ionRangeSlider({ type: "double", min: 0, max: price_deposit_max, from: 0, to: price_deposit_max, step: 100, grid: true, skin: 'round', prettify: makeLabelingFunc(price_deposit_max), onFinish: function (data) { $('#price_deposit_min').val(data.from); $('#price_deposit_max').val(data.to); } }); // 임대료 슬라이더 $("#price_monthly_slider").ionRangeSlider({ type: "double", min: 0, max: price_monthly_max, from: 0, to: price_monthly_max, step: 10, grid: true, skin: 'round', prettify: makeLabelingFunc(price_monthly_max), onFinish: function (data) { $('#price_monthly_min').val(data.from); $('#price_monthly_max').val(data.to); } }); /******************************************** * 거래 종류에 따른 가격 슬라이더 보이는 거 제어 *******************************************/ updateSliderVisibilityMulti(); $('.btn-trade_type').on('change', function () { updateSliderVisibilityMulti(); }); }); function makeLabelingFunc(max) { return function(ts) { if (ts == 0) return "0"; else if (ts >= max) return "제한없음"; else return numberToKorean(ts); } } function numberToKorean(number){ number = number *10000; /* 사이트에서 기본으로 1만원 기준으로 하니까 */ var inputNumber = number =1000){ resultArray[i] = Math.floor(unitResult / 1000) + "천"; } else if (unitResult >= 100){ resultArray[i] = Math.floor(unitResult / 100) + "백"; } else if (unitResult > 0){ resultArray[i] = unitResult; } } for (var i = 0; i { (tradeTypeMap[type] || []).forEach(priceKey => priceTypes.add(priceKey)); }); $('.price-box').each(function () { const key = $(this).data('price'); $(this).toggle(priceTypes.has(key)); }); } function updateTradeTypeLabel() { const checkedTypes = $('.btn-trade_type:checked'); const $label = $('#trade_typeLabel'); const defaultText = $label.data('label'); // '거래종류' if (checkedTypes.length === 0) { $label.text(defaultText); return; } const labels = checkedTypes.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updatePriceLabel() { const labels = { price_sell: '매', price_full: '전', price_deposit: '보', price_monthly: '월' }; let labelParts = []; for (const key in labels) { const sliderElem = $("#" + key + "_slider"); const slider = sliderElem.data("ionRangeSlider"); if (!slider) continue; const min = slider.result.from; const max = slider.result.to; const minLimit = slider.options.min; const maxLimit = slider.options.max; // 슬라이더 전체 범위 사용 시 생략 if (min === minLimit && max === maxLimit) continue; const labelChar = labels[key]; const minText = numberToKorean(min); let displayText = ""; if (max === maxLimit) { // 최대값 == 최댓값일 때 → 무제한 displayText = `${labelChar} ${minText}~`; } else { const maxText = numberToKorean(max); displayText = `${labelChar} ${minText} ~ ${maxText}`; } labelParts.push(displayText); } const $label = $("#priceLabel"); if (labelParts.length > 0) { $label.text(labelParts.join(", ")); } else { $label.text($label.data("label") || "금액"); } } function updateCategoryLabel() { const checked = $('input[name="category_id[]"]:checked'); const $label = $('#categoryLabel'); const defaultText = $label.data('label'); // 예: '매물종류' if (checked.length === 0) { $label.text(defaultText); return; } const labels = checked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updateRoomLabel() { const $label = $('#roomLabel'); const defaultText = $label.data('label') || '방/욕실수'; const roomMin = $('select[name="opt_room_min"]').val(); const roomMax = $('select[name="opt_room_max"]').val(); const bathMin = $('select[name="opt_bath_min"]').val(); const bathMax = $('select[name="opt_bath_max"]').val(); let labelParts = []; if (roomMin || roomMax) { let roomText = '방 '; if (roomMin) roomText += roomMin; if (roomMin && roomMax) roomText += '~' + roomMax; else if (!roomMin && roomMax) roomText += '~' + roomMax; else if (roomMin && !roomMax) roomText += '~'; labelParts.push(roomText.trim()); } if (bathMin || bathMax) { let bathText = '욕실 '; if (bathMin) bathText += bathMin; if (bathMin && bathMax) bathText += '~' + bathMax; else if (!bathMin && bathMax) bathText += '~' + bathMax; else if (bathMin && !bathMax) bathText += '~'; labelParts.push(bathText.trim()); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateAreaLabel() { const $label = $('#areaLabel'); const defaultText = $label.data('label') || '면적'; const getSelectedPyeong = function(name) { const val = $(`select[name="${name}"]`).val(); if (!val) return ''; const pyeong = parseInt(val, 10); return (pyeong > 3300) ? '1000' : (pyeong / 3.3).toFixed(0); }; const exclusiveMin = getSelectedPyeong('opt_exclusive_area_min'); const exclusiveMax = getSelectedPyeong('opt_exclusive_area_max'); const landMin = getSelectedPyeong('opt_land_area_min'); const landMax = getSelectedPyeong('opt_land_area_max'); let labelParts = []; if (exclusiveMin || exclusiveMax) { let text = '전 '; if (exclusiveMin) text += exclusiveMin; if (exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (!exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (exclusiveMin && !exclusiveMax) text += '~'; labelParts.push(text); } if (landMin || landMax) { let text = '대 '; if (landMin) text += landMin; if (landMin && landMax) text += '~' + landMax; else if (!landMin && landMax) text += '~' + landMax; else if (landMin && !landMax) text += '~'; labelParts.push(text); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateEtcLabel() { const $label = $('#etcLabel'); const defaultText = $label.data('label') || '추가검색'; const floorMin = $('select[name="opt_floor_min"]').val(); const floorMax = $('select[name="opt_floor_max"]').val(); const themeChecked = $('input[name="themes[]"]:checked'); let labelParts = []; // 층수 라벨 처리 if (floorMin || floorMax) { const floorText = (value) => { if (value === "-1") return "지하 1층"; return value + "층"; }; let text = "층 "; if (floorMin) text += floorText(floorMin); if (floorMin && floorMax) text += " ~ " + floorText(floorMax); else if (!floorMin && floorMax) text += "~" + floorText(floorMax); else if (floorMin && !floorMax) text += "~"; labelParts.push(text.trim()); } // 테마 선택 처리 if (themeChecked.length > 0) { const themeLabels = themeChecked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); labelParts.push(themeLabels.join(', ')); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } }
${item.desc}

`); } else if (item.type === 'subway') { $dropdown.append(` `); } }); $dropdown.show(); }); }); $dropdown.on('click', '.dropdown-item', function () { $input.val($(this).data('value')); moveTo($(this).data('lat'),$(this).data('lng')); $dropdown.hide(); }); $(document).on('click', function (e) { if (!$(e.target).closest('.position-relative').length) { $dropdown.hide(); } }); $dropdown.on('click', '.dropdown-item', function () { const title = $(this).data('title'); const type = $(this).data('type'); const value = $(this).data('value'); $('#address').val(title); $dropdown.hide(); if (type === 'address') { $('#address_id').val(value); $('#subway_id').val(''); } else if (type === 'subway') { $('#subway_id').val(value); $('#address_id').val(''); } $('form[tibosearch]').trigger('submit'); }); /************************************************ * 모바일에서 세부검색창 열기 ************************************************/ $('.btn-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').addClass('mobile-active'); $('body').css('overflow', 'hidden'); }); /************************************************ * 모바일에서 세부검색창 닫기 ************************************************/ $('.btn-close-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').removeClass('mobile-active'); $('body').css('overflow', ''); }); }); var price_sell_max = 150000; var price_full_max = 100000; var price_deposit_max = 10000; var price_monthly_max = 200; $(function () { // 매매가 슬라이더 $("#price_sell_slider").ionRangeSlider({ type: "double", min: 0, max: price_sell_max, from: 0, to: price_sell_max, step: 5000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_sell_max), onFinish: function (data) { $('#price_sell_min').val(data.from); $('#price_sell_max').val(data.to); } }); // 전세가 슬라이더 $("#price_full_slider").ionRangeSlider({ type: "double", min: 0, max: price_full_max, from: 0, to: price_full_max, step: 1000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_full_max), onFinish: function (data) { $('#price_full_min').val(data.from); $('#price_full_max').val(data.to); } }); // 보증금 슬라이더 $("#price_deposit_slider").ionRangeSlider({ type: "double", min: 0, max: price_deposit_max, from: 0, to: price_deposit_max, step: 100, grid: true, skin: 'round', prettify: makeLabelingFunc(price_deposit_max), onFinish: function (data) { $('#price_deposit_min').val(data.from); $('#price_deposit_max').val(data.to); } }); // 임대료 슬라이더 $("#price_monthly_slider").ionRangeSlider({ type: "double", min: 0, max: price_monthly_max, from: 0, to: price_monthly_max, step: 10, grid: true, skin: 'round', prettify: makeLabelingFunc(price_monthly_max), onFinish: function (data) { $('#price_monthly_min').val(data.from); $('#price_monthly_max').val(data.to); } }); /******************************************** * 거래 종류에 따른 가격 슬라이더 보이는 거 제어 *******************************************/ updateSliderVisibilityMulti(); $('.btn-trade_type').on('change', function () { updateSliderVisibilityMulti(); }); }); function makeLabelingFunc(max) { return function(ts) { if (ts == 0) return "0"; else if (ts >= max) return "제한없음"; else return numberToKorean(ts); } } function numberToKorean(number){ number = number *10000; /* 사이트에서 기본으로 1만원 기준으로 하니까 */ var inputNumber = number =1000){ resultArray[i] = Math.floor(unitResult / 1000) + "천"; } else if (unitResult >= 100){ resultArray[i] = Math.floor(unitResult / 100) + "백"; } else if (unitResult > 0){ resultArray[i] = unitResult; } } for (var i = 0; i { (tradeTypeMap[type] || []).forEach(priceKey => priceTypes.add(priceKey)); }); $('.price-box').each(function () { const key = $(this).data('price'); $(this).toggle(priceTypes.has(key)); }); } function updateTradeTypeLabel() { const checkedTypes = $('.btn-trade_type:checked'); const $label = $('#trade_typeLabel'); const defaultText = $label.data('label'); // '거래종류' if (checkedTypes.length === 0) { $label.text(defaultText); return; } const labels = checkedTypes.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updatePriceLabel() { const labels = { price_sell: '매', price_full: '전', price_deposit: '보', price_monthly: '월' }; let labelParts = []; for (const key in labels) { const sliderElem = $("#" + key + "_slider"); const slider = sliderElem.data("ionRangeSlider"); if (!slider) continue; const min = slider.result.from; const max = slider.result.to; const minLimit = slider.options.min; const maxLimit = slider.options.max; // 슬라이더 전체 범위 사용 시 생략 if (min === minLimit && max === maxLimit) continue; const labelChar = labels[key]; const minText = numberToKorean(min); let displayText = ""; if (max === maxLimit) { // 최대값 == 최댓값일 때 → 무제한 displayText = `${labelChar} ${minText}~`; } else { const maxText = numberToKorean(max); displayText = `${labelChar} ${minText} ~ ${maxText}`; } labelParts.push(displayText); } const $label = $("#priceLabel"); if (labelParts.length > 0) { $label.text(labelParts.join(", ")); } else { $label.text($label.data("label") || "금액"); } } function updateCategoryLabel() { const checked = $('input[name="category_id[]"]:checked'); const $label = $('#categoryLabel'); const defaultText = $label.data('label'); // 예: '매물종류' if (checked.length === 0) { $label.text(defaultText); return; } const labels = checked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updateRoomLabel() { const $label = $('#roomLabel'); const defaultText = $label.data('label') || '방/욕실수'; const roomMin = $('select[name="opt_room_min"]').val(); const roomMax = $('select[name="opt_room_max"]').val(); const bathMin = $('select[name="opt_bath_min"]').val(); const bathMax = $('select[name="opt_bath_max"]').val(); let labelParts = []; if (roomMin || roomMax) { let roomText = '방 '; if (roomMin) roomText += roomMin; if (roomMin && roomMax) roomText += '~' + roomMax; else if (!roomMin && roomMax) roomText += '~' + roomMax; else if (roomMin && !roomMax) roomText += '~'; labelParts.push(roomText.trim()); } if (bathMin || bathMax) { let bathText = '욕실 '; if (bathMin) bathText += bathMin; if (bathMin && bathMax) bathText += '~' + bathMax; else if (!bathMin && bathMax) bathText += '~' + bathMax; else if (bathMin && !bathMax) bathText += '~'; labelParts.push(bathText.trim()); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateAreaLabel() { const $label = $('#areaLabel'); const defaultText = $label.data('label') || '면적'; const getSelectedPyeong = function(name) { const val = $(`select[name="${name}"]`).val(); if (!val) return ''; const pyeong = parseInt(val, 10); return (pyeong > 3300) ? '1000' : (pyeong / 3.3).toFixed(0); }; const exclusiveMin = getSelectedPyeong('opt_exclusive_area_min'); const exclusiveMax = getSelectedPyeong('opt_exclusive_area_max'); const landMin = getSelectedPyeong('opt_land_area_min'); const landMax = getSelectedPyeong('opt_land_area_max'); let labelParts = []; if (exclusiveMin || exclusiveMax) { let text = '전 '; if (exclusiveMin) text += exclusiveMin; if (exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (!exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (exclusiveMin && !exclusiveMax) text += '~'; labelParts.push(text); } if (landMin || landMax) { let text = '대 '; if (landMin) text += landMin; if (landMin && landMax) text += '~' + landMax; else if (!landMin && landMax) text += '~' + landMax; else if (landMin && !landMax) text += '~'; labelParts.push(text); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateEtcLabel() { const $label = $('#etcLabel'); const defaultText = $label.data('label') || '추가검색'; const floorMin = $('select[name="opt_floor_min"]').val(); const floorMax = $('select[name="opt_floor_max"]').val(); const themeChecked = $('input[name="themes[]"]:checked'); let labelParts = []; // 층수 라벨 처리 if (floorMin || floorMax) { const floorText = (value) => { if (value === "-1") return "지하 1층"; return value + "층"; }; let text = "층 "; if (floorMin) text += floorText(floorMin); if (floorMin && floorMax) text += " ~ " + floorText(floorMax); else if (!floorMin && floorMax) text += "~" + floorText(floorMax); else if (floorMin && !floorMax) text += "~"; labelParts.push(text.trim()); } // 테마 선택 처리 if (themeChecked.length > 0) { const themeLabels = themeChecked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); labelParts.push(themeLabels.join(', ')); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } }

${item.desc}

`); } else if (item.type === 'subway') { $dropdown.append(` `); } }); $dropdown.show(); }); }); $dropdown.on('click', '.dropdown-item', function () { $input.val($(this).data('value')); moveTo($(this).data('lat'),$(this).data('lng')); $dropdown.hide(); }); $(document).on('click', function (e) { if (!$(e.target).closest('.position-relative').length) { $dropdown.hide(); } }); $dropdown.on('click', '.dropdown-item', function () { const title = $(this).data('title'); const type = $(this).data('type'); const value = $(this).data('value'); $('#address').val(title); $dropdown.hide(); if (type === 'address') { $('#address_id').val(value); $('#subway_id').val(''); } else if (type === 'subway') { $('#subway_id').val(value); $('#address_id').val(''); } $('form[tibosearch]').trigger('submit'); }); /************************************************ * 모바일에서 세부검색창 열기 ************************************************/ $('.btn-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').addClass('mobile-active'); $('body').css('overflow', 'hidden'); }); /************************************************ * 모바일에서 세부검색창 닫기 ************************************************/ $('.btn-close-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').removeClass('mobile-active'); $('body').css('overflow', ''); }); }); var price_sell_max = 150000; var price_full_max = 100000; var price_deposit_max = 10000; var price_monthly_max = 200; $(function () { // 매매가 슬라이더 $("#price_sell_slider").ionRangeSlider({ type: "double", min: 0, max: price_sell_max, from: 0, to: price_sell_max, step: 5000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_sell_max), onFinish: function (data) { $('#price_sell_min').val(data.from); $('#price_sell_max').val(data.to); } }); // 전세가 슬라이더 $("#price_full_slider").ionRangeSlider({ type: "double", min: 0, max: price_full_max, from: 0, to: price_full_max, step: 1000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_full_max), onFinish: function (data) { $('#price_full_min').val(data.from); $('#price_full_max').val(data.to); } }); // 보증금 슬라이더 $("#price_deposit_slider").ionRangeSlider({ type: "double", min: 0, max: price_deposit_max, from: 0, to: price_deposit_max, step: 100, grid: true, skin: 'round', prettify: makeLabelingFunc(price_deposit_max), onFinish: function (data) { $('#price_deposit_min').val(data.from); $('#price_deposit_max').val(data.to); } }); // 임대료 슬라이더 $("#price_monthly_slider").ionRangeSlider({ type: "double", min: 0, max: price_monthly_max, from: 0, to: price_monthly_max, step: 10, grid: true, skin: 'round', prettify: makeLabelingFunc(price_monthly_max), onFinish: function (data) { $('#price_monthly_min').val(data.from); $('#price_monthly_max').val(data.to); } }); /******************************************** * 거래 종류에 따른 가격 슬라이더 보이는 거 제어 *******************************************/ updateSliderVisibilityMulti(); $('.btn-trade_type').on('change', function () { updateSliderVisibilityMulti(); }); }); function makeLabelingFunc(max) { return function(ts) { if (ts == 0) return "0"; else if (ts >= max) return "제한없음"; else return numberToKorean(ts); } } function numberToKorean(number){ number = number *10000; /* 사이트에서 기본으로 1만원 기준으로 하니까 */ var inputNumber = number =1000){ resultArray[i] = Math.floor(unitResult / 1000) + "천"; } else if (unitResult >= 100){ resultArray[i] = Math.floor(unitResult / 100) + "백"; } else if (unitResult > 0){ resultArray[i] = unitResult; } } for (var i = 0; i { (tradeTypeMap[type] || []).forEach(priceKey => priceTypes.add(priceKey)); }); $('.price-box').each(function () { const key = $(this).data('price'); $(this).toggle(priceTypes.has(key)); }); } function updateTradeTypeLabel() { const checkedTypes = $('.btn-trade_type:checked'); const $label = $('#trade_typeLabel'); const defaultText = $label.data('label'); // '거래종류' if (checkedTypes.length === 0) { $label.text(defaultText); return; } const labels = checkedTypes.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updatePriceLabel() { const labels = { price_sell: '매', price_full: '전', price_deposit: '보', price_monthly: '월' }; let labelParts = []; for (const key in labels) { const sliderElem = $("#" + key + "_slider"); const slider = sliderElem.data("ionRangeSlider"); if (!slider) continue; const min = slider.result.from; const max = slider.result.to; const minLimit = slider.options.min; const maxLimit = slider.options.max; // 슬라이더 전체 범위 사용 시 생략 if (min === minLimit && max === maxLimit) continue; const labelChar = labels[key]; const minText = numberToKorean(min); let displayText = ""; if (max === maxLimit) { // 최대값 == 최댓값일 때 → 무제한 displayText = `${labelChar} ${minText}~`; } else { const maxText = numberToKorean(max); displayText = `${labelChar} ${minText} ~ ${maxText}`; } labelParts.push(displayText); } const $label = $("#priceLabel"); if (labelParts.length > 0) { $label.text(labelParts.join(", ")); } else { $label.text($label.data("label") || "금액"); } } function updateCategoryLabel() { const checked = $('input[name="category_id[]"]:checked'); const $label = $('#categoryLabel'); const defaultText = $label.data('label'); // 예: '매물종류' if (checked.length === 0) { $label.text(defaultText); return; } const labels = checked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updateRoomLabel() { const $label = $('#roomLabel'); const defaultText = $label.data('label') || '방/욕실수'; const roomMin = $('select[name="opt_room_min"]').val(); const roomMax = $('select[name="opt_room_max"]').val(); const bathMin = $('select[name="opt_bath_min"]').val(); const bathMax = $('select[name="opt_bath_max"]').val(); let labelParts = []; if (roomMin || roomMax) { let roomText = '방 '; if (roomMin) roomText += roomMin; if (roomMin && roomMax) roomText += '~' + roomMax; else if (!roomMin && roomMax) roomText += '~' + roomMax; else if (roomMin && !roomMax) roomText += '~'; labelParts.push(roomText.trim()); } if (bathMin || bathMax) { let bathText = '욕실 '; if (bathMin) bathText += bathMin; if (bathMin && bathMax) bathText += '~' + bathMax; else if (!bathMin && bathMax) bathText += '~' + bathMax; else if (bathMin && !bathMax) bathText += '~'; labelParts.push(bathText.trim()); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateAreaLabel() { const $label = $('#areaLabel'); const defaultText = $label.data('label') || '면적'; const getSelectedPyeong = function(name) { const val = $(`select[name="${name}"]`).val(); if (!val) return ''; const pyeong = parseInt(val, 10); return (pyeong > 3300) ? '1000' : (pyeong / 3.3).toFixed(0); }; const exclusiveMin = getSelectedPyeong('opt_exclusive_area_min'); const exclusiveMax = getSelectedPyeong('opt_exclusive_area_max'); const landMin = getSelectedPyeong('opt_land_area_min'); const landMax = getSelectedPyeong('opt_land_area_max'); let labelParts = []; if (exclusiveMin || exclusiveMax) { let text = '전 '; if (exclusiveMin) text += exclusiveMin; if (exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (!exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (exclusiveMin && !exclusiveMax) text += '~'; labelParts.push(text); } if (landMin || landMax) { let text = '대 '; if (landMin) text += landMin; if (landMin && landMax) text += '~' + landMax; else if (!landMin && landMax) text += '~' + landMax; else if (landMin && !landMax) text += '~'; labelParts.push(text); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateEtcLabel() { const $label = $('#etcLabel'); const defaultText = $label.data('label') || '추가검색'; const floorMin = $('select[name="opt_floor_min"]').val(); const floorMax = $('select[name="opt_floor_max"]').val(); const themeChecked = $('input[name="themes[]"]:checked'); let labelParts = []; // 층수 라벨 처리 if (floorMin || floorMax) { const floorText = (value) => { if (value === "-1") return "지하 1층"; return value + "층"; }; let text = "층 "; if (floorMin) text += floorText(floorMin); if (floorMin && floorMax) text += " ~ " + floorText(floorMax); else if (!floorMin && floorMax) text += "~" + floorText(floorMax); else if (floorMin && !floorMax) text += "~"; labelParts.push(text.trim()); } // 테마 선택 처리 if (themeChecked.length > 0) { const themeLabels = themeChecked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); labelParts.push(themeLabels.join(', ')); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } }

${item.desc}

`); } else if (item.type === 'subway') { $dropdown.append(` `); } }); $dropdown.show(); }); }); $dropdown.on('click', '.dropdown-item', function () { $input.val($(this).data('value')); moveTo($(this).data('lat'),$(this).data('lng')); $dropdown.hide(); }); $(document).on('click', function (e) { if (!$(e.target).closest('.position-relative').length) { $dropdown.hide(); } }); $dropdown.on('click', '.dropdown-item', function () { const title = $(this).data('title'); const type = $(this).data('type'); const value = $(this).data('value'); $('#address').val(title); $dropdown.hide(); if (type === 'address') { $('#address_id').val(value); $('#subway_id').val(''); } else if (type === 'subway') { $('#subway_id').val(value); $('#address_id').val(''); } $('form[tibosearch]').trigger('submit'); }); /************************************************ * 모바일에서 세부검색창 열기 ************************************************/ $('.btn-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').addClass('mobile-active'); $('body').css('overflow', 'hidden'); }); /************************************************ * 모바일에서 세부검색창 닫기 ************************************************/ $('.btn-close-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').removeClass('mobile-active'); $('body').css('overflow', ''); }); }); var price_sell_max = 150000; var price_full_max = 100000; var price_deposit_max = 10000; var price_monthly_max = 200; $(function () { // 매매가 슬라이더 $("#price_sell_slider").ionRangeSlider({ type: "double", min: 0, max: price_sell_max, from: 0, to: price_sell_max, step: 5000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_sell_max), onFinish: function (data) { $('#price_sell_min').val(data.from); $('#price_sell_max').val(data.to); } }); // 전세가 슬라이더 $("#price_full_slider").ionRangeSlider({ type: "double", min: 0, max: price_full_max, from: 0, to: price_full_max, step: 1000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_full_max), onFinish: function (data) { $('#price_full_min').val(data.from); $('#price_full_max').val(data.to); } }); // 보증금 슬라이더 $("#price_deposit_slider").ionRangeSlider({ type: "double", min: 0, max: price_deposit_max, from: 0, to: price_deposit_max, step: 100, grid: true, skin: 'round', prettify: makeLabelingFunc(price_deposit_max), onFinish: function (data) { $('#price_deposit_min').val(data.from); $('#price_deposit_max').val(data.to); } }); // 임대료 슬라이더 $("#price_monthly_slider").ionRangeSlider({ type: "double", min: 0, max: price_monthly_max, from: 0, to: price_monthly_max, step: 10, grid: true, skin: 'round', prettify: makeLabelingFunc(price_monthly_max), onFinish: function (data) { $('#price_monthly_min').val(data.from); $('#price_monthly_max').val(data.to); } }); /******************************************** * 거래 종류에 따른 가격 슬라이더 보이는 거 제어 *******************************************/ updateSliderVisibilityMulti(); $('.btn-trade_type').on('change', function () { updateSliderVisibilityMulti(); }); }); function makeLabelingFunc(max) { return function(ts) { if (ts == 0) return "0"; else if (ts >= max) return "제한없음"; else return numberToKorean(ts); } } function numberToKorean(number){ number = number *10000; /* 사이트에서 기본으로 1만원 기준으로 하니까 */ var inputNumber = number =1000){ resultArray[i] = Math.floor(unitResult / 1000) + "천"; } else if (unitResult >= 100){ resultArray[i] = Math.floor(unitResult / 100) + "백"; } else if (unitResult > 0){ resultArray[i] = unitResult; } } for (var i = 0; i { (tradeTypeMap[type] || []).forEach(priceKey => priceTypes.add(priceKey)); }); $('.price-box').each(function () { const key = $(this).data('price'); $(this).toggle(priceTypes.has(key)); }); } function updateTradeTypeLabel() { const checkedTypes = $('.btn-trade_type:checked'); const $label = $('#trade_typeLabel'); const defaultText = $label.data('label'); // '거래종류' if (checkedTypes.length === 0) { $label.text(defaultText); return; } const labels = checkedTypes.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updatePriceLabel() { const labels = { price_sell: '매', price_full: '전', price_deposit: '보', price_monthly: '월' }; let labelParts = []; for (const key in labels) { const sliderElem = $("#" + key + "_slider"); const slider = sliderElem.data("ionRangeSlider"); if (!slider) continue; const min = slider.result.from; const max = slider.result.to; const minLimit = slider.options.min; const maxLimit = slider.options.max; // 슬라이더 전체 범위 사용 시 생략 if (min === minLimit && max === maxLimit) continue; const labelChar = labels[key]; const minText = numberToKorean(min); let displayText = ""; if (max === maxLimit) { // 최대값 == 최댓값일 때 → 무제한 displayText = `${labelChar} ${minText}~`; } else { const maxText = numberToKorean(max); displayText = `${labelChar} ${minText} ~ ${maxText}`; } labelParts.push(displayText); } const $label = $("#priceLabel"); if (labelParts.length > 0) { $label.text(labelParts.join(", ")); } else { $label.text($label.data("label") || "금액"); } } function updateCategoryLabel() { const checked = $('input[name="category_id[]"]:checked'); const $label = $('#categoryLabel'); const defaultText = $label.data('label'); // 예: '매물종류' if (checked.length === 0) { $label.text(defaultText); return; } const labels = checked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updateRoomLabel() { const $label = $('#roomLabel'); const defaultText = $label.data('label') || '방/욕실수'; const roomMin = $('select[name="opt_room_min"]').val(); const roomMax = $('select[name="opt_room_max"]').val(); const bathMin = $('select[name="opt_bath_min"]').val(); const bathMax = $('select[name="opt_bath_max"]').val(); let labelParts = []; if (roomMin || roomMax) { let roomText = '방 '; if (roomMin) roomText += roomMin; if (roomMin && roomMax) roomText += '~' + roomMax; else if (!roomMin && roomMax) roomText += '~' + roomMax; else if (roomMin && !roomMax) roomText += '~'; labelParts.push(roomText.trim()); } if (bathMin || bathMax) { let bathText = '욕실 '; if (bathMin) bathText += bathMin; if (bathMin && bathMax) bathText += '~' + bathMax; else if (!bathMin && bathMax) bathText += '~' + bathMax; else if (bathMin && !bathMax) bathText += '~'; labelParts.push(bathText.trim()); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateAreaLabel() { const $label = $('#areaLabel'); const defaultText = $label.data('label') || '면적'; const getSelectedPyeong = function(name) { const val = $(`select[name="${name}"]`).val(); if (!val) return ''; const pyeong = parseInt(val, 10); return (pyeong > 3300) ? '1000' : (pyeong / 3.3).toFixed(0); }; const exclusiveMin = getSelectedPyeong('opt_exclusive_area_min'); const exclusiveMax = getSelectedPyeong('opt_exclusive_area_max'); const landMin = getSelectedPyeong('opt_land_area_min'); const landMax = getSelectedPyeong('opt_land_area_max'); let labelParts = []; if (exclusiveMin || exclusiveMax) { let text = '전 '; if (exclusiveMin) text += exclusiveMin; if (exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (!exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (exclusiveMin && !exclusiveMax) text += '~'; labelParts.push(text); } if (landMin || landMax) { let text = '대 '; if (landMin) text += landMin; if (landMin && landMax) text += '~' + landMax; else if (!landMin && landMax) text += '~' + landMax; else if (landMin && !landMax) text += '~'; labelParts.push(text); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateEtcLabel() { const $label = $('#etcLabel'); const defaultText = $label.data('label') || '추가검색'; const floorMin = $('select[name="opt_floor_min"]').val(); const floorMax = $('select[name="opt_floor_max"]').val(); const themeChecked = $('input[name="themes[]"]:checked'); let labelParts = []; // 층수 라벨 처리 if (floorMin || floorMax) { const floorText = (value) => { if (value === "-1") return "지하 1층"; return value + "층"; }; let text = "층 "; if (floorMin) text += floorText(floorMin); if (floorMin && floorMax) text += " ~ " + floorText(floorMax); else if (!floorMin && floorMax) text += "~" + floorText(floorMax); else if (floorMin && !floorMax) text += "~"; labelParts.push(text.trim()); } // 테마 선택 처리 if (themeChecked.length > 0) { const themeLabels = themeChecked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); labelParts.push(themeLabels.join(', ')); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } }

${item.desc}

`); } else if (item.type === 'subway') { $dropdown.append(` `); } }); $dropdown.show(); }); }); $dropdown.on('click', '.dropdown-item', function () { $input.val($(this).data('value')); moveTo($(this).data('lat'),$(this).data('lng')); $dropdown.hide(); }); $(document).on('click', function (e) { if (!$(e.target).closest('.position-relative').length) { $dropdown.hide(); } }); $dropdown.on('click', '.dropdown-item', function () { const title = $(this).data('title'); const type = $(this).data('type'); const value = $(this).data('value'); $('#address').val(title); $dropdown.hide(); if (type === 'address') { $('#address_id').val(value); $('#subway_id').val(''); } else if (type === 'subway') { $('#subway_id').val(value); $('#address_id').val(''); } $('form[tibosearch]').trigger('submit'); }); /************************************************ * 모바일에서 세부검색창 열기 ************************************************/ $('.btn-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').addClass('mobile-active'); $('body').css('overflow', 'hidden'); }); /************************************************ * 모바일에서 세부검색창 닫기 ************************************************/ $('.btn-close-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').removeClass('mobile-active'); $('body').css('overflow', ''); }); }); var price_sell_max = 150000; var price_full_max = 100000; var price_deposit_max = 10000; var price_monthly_max = 200; $(function () { // 매매가 슬라이더 $("#price_sell_slider").ionRangeSlider({ type: "double", min: 0, max: price_sell_max, from: 0, to: price_sell_max, step: 5000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_sell_max), onFinish: function (data) { $('#price_sell_min').val(data.from); $('#price_sell_max').val(data.to); } }); // 전세가 슬라이더 $("#price_full_slider").ionRangeSlider({ type: "double", min: 0, max: price_full_max, from: 0, to: price_full_max, step: 1000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_full_max), onFinish: function (data) { $('#price_full_min').val(data.from); $('#price_full_max').val(data.to); } }); // 보증금 슬라이더 $("#price_deposit_slider").ionRangeSlider({ type: "double", min: 0, max: price_deposit_max, from: 0, to: price_deposit_max, step: 100, grid: true, skin: 'round', prettify: makeLabelingFunc(price_deposit_max), onFinish: function (data) { $('#price_deposit_min').val(data.from); $('#price_deposit_max').val(data.to); } }); // 임대료 슬라이더 $("#price_monthly_slider").ionRangeSlider({ type: "double", min: 0, max: price_monthly_max, from: 0, to: price_monthly_max, step: 10, grid: true, skin: 'round', prettify: makeLabelingFunc(price_monthly_max), onFinish: function (data) { $('#price_monthly_min').val(data.from); $('#price_monthly_max').val(data.to); } }); /******************************************** * 거래 종류에 따른 가격 슬라이더 보이는 거 제어 *******************************************/ updateSliderVisibilityMulti(); $('.btn-trade_type').on('change', function () { updateSliderVisibilityMulti(); }); }); function makeLabelingFunc(max) { return function(ts) { if (ts == 0) return "0"; else if (ts >= max) return "제한없음"; else return numberToKorean(ts); } } function numberToKorean(number){ number = number *10000; /* 사이트에서 기본으로 1만원 기준으로 하니까 */ var inputNumber = number =1000){ resultArray[i] = Math.floor(unitResult / 1000) + "천"; } else if (unitResult >= 100){ resultArray[i] = Math.floor(unitResult / 100) + "백"; } else if (unitResult > 0){ resultArray[i] = unitResult; } } for (var i = 0; i { (tradeTypeMap[type] || []).forEach(priceKey => priceTypes.add(priceKey)); }); $('.price-box').each(function () { const key = $(this).data('price'); $(this).toggle(priceTypes.has(key)); }); } function updateTradeTypeLabel() { const checkedTypes = $('.btn-trade_type:checked'); const $label = $('#trade_typeLabel'); const defaultText = $label.data('label'); // '거래종류' if (checkedTypes.length === 0) { $label.text(defaultText); return; } const labels = checkedTypes.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updatePriceLabel() { const labels = { price_sell: '매', price_full: '전', price_deposit: '보', price_monthly: '월' }; let labelParts = []; for (const key in labels) { const sliderElem = $("#" + key + "_slider"); const slider = sliderElem.data("ionRangeSlider"); if (!slider) continue; const min = slider.result.from; const max = slider.result.to; const minLimit = slider.options.min; const maxLimit = slider.options.max; // 슬라이더 전체 범위 사용 시 생략 if (min === minLimit && max === maxLimit) continue; const labelChar = labels[key]; const minText = numberToKorean(min); let displayText = ""; if (max === maxLimit) { // 최대값 == 최댓값일 때 → 무제한 displayText = `${labelChar} ${minText}~`; } else { const maxText = numberToKorean(max); displayText = `${labelChar} ${minText} ~ ${maxText}`; } labelParts.push(displayText); } const $label = $("#priceLabel"); if (labelParts.length > 0) { $label.text(labelParts.join(", ")); } else { $label.text($label.data("label") || "금액"); } } function updateCategoryLabel() { const checked = $('input[name="category_id[]"]:checked'); const $label = $('#categoryLabel'); const defaultText = $label.data('label'); // 예: '매물종류' if (checked.length === 0) { $label.text(defaultText); return; } const labels = checked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updateRoomLabel() { const $label = $('#roomLabel'); const defaultText = $label.data('label') || '방/욕실수'; const roomMin = $('select[name="opt_room_min"]').val(); const roomMax = $('select[name="opt_room_max"]').val(); const bathMin = $('select[name="opt_bath_min"]').val(); const bathMax = $('select[name="opt_bath_max"]').val(); let labelParts = []; if (roomMin || roomMax) { let roomText = '방 '; if (roomMin) roomText += roomMin; if (roomMin && roomMax) roomText += '~' + roomMax; else if (!roomMin && roomMax) roomText += '~' + roomMax; else if (roomMin && !roomMax) roomText += '~'; labelParts.push(roomText.trim()); } if (bathMin || bathMax) { let bathText = '욕실 '; if (bathMin) bathText += bathMin; if (bathMin && bathMax) bathText += '~' + bathMax; else if (!bathMin && bathMax) bathText += '~' + bathMax; else if (bathMin && !bathMax) bathText += '~'; labelParts.push(bathText.trim()); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateAreaLabel() { const $label = $('#areaLabel'); const defaultText = $label.data('label') || '면적'; const getSelectedPyeong = function(name) { const val = $(`select[name="${name}"]`).val(); if (!val) return ''; const pyeong = parseInt(val, 10); return (pyeong > 3300) ? '1000' : (pyeong / 3.3).toFixed(0); }; const exclusiveMin = getSelectedPyeong('opt_exclusive_area_min'); const exclusiveMax = getSelectedPyeong('opt_exclusive_area_max'); const landMin = getSelectedPyeong('opt_land_area_min'); const landMax = getSelectedPyeong('opt_land_area_max'); let labelParts = []; if (exclusiveMin || exclusiveMax) { let text = '전 '; if (exclusiveMin) text += exclusiveMin; if (exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (!exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (exclusiveMin && !exclusiveMax) text += '~'; labelParts.push(text); } if (landMin || landMax) { let text = '대 '; if (landMin) text += landMin; if (landMin && landMax) text += '~' + landMax; else if (!landMin && landMax) text += '~' + landMax; else if (landMin && !landMax) text += '~'; labelParts.push(text); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateEtcLabel() { const $label = $('#etcLabel'); const defaultText = $label.data('label') || '추가검색'; const floorMin = $('select[name="opt_floor_min"]').val(); const floorMax = $('select[name="opt_floor_max"]').val(); const themeChecked = $('input[name="themes[]"]:checked'); let labelParts = []; // 층수 라벨 처리 if (floorMin || floorMax) { const floorText = (value) => { if (value === "-1") return "지하 1층"; return value + "층"; }; let text = "층 "; if (floorMin) text += floorText(floorMin); if (floorMin && floorMax) text += " ~ " + floorText(floorMax); else if (!floorMin && floorMax) text += "~" + floorText(floorMax); else if (floorMin && !floorMax) text += "~"; labelParts.push(text.trim()); } // 테마 선택 처리 if (themeChecked.length > 0) { const themeLabels = themeChecked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); labelParts.push(themeLabels.join(', ')); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } }

${item.desc}

`); } else if (item.type === 'subway') { $dropdown.append(` `); } }); $dropdown.show(); }); }); $dropdown.on('click', '.dropdown-item', function () { $input.val($(this).data('value')); moveTo($(this).data('lat'),$(this).data('lng')); $dropdown.hide(); }); $(document).on('click', function (e) { if (!$(e.target).closest('.position-relative').length) { $dropdown.hide(); } }); $dropdown.on('click', '.dropdown-item', function () { const title = $(this).data('title'); const type = $(this).data('type'); const value = $(this).data('value'); $('#address').val(title); $dropdown.hide(); if (type === 'address') { $('#address_id').val(value); $('#subway_id').val(''); } else if (type === 'subway') { $('#subway_id').val(value); $('#address_id').val(''); } $('form[tibosearch]').trigger('submit'); }); /************************************************ * 모바일에서 세부검색창 열기 ************************************************/ $('.btn-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').addClass('mobile-active'); $('body').css('overflow', 'hidden'); }); /************************************************ * 모바일에서 세부검색창 닫기 ************************************************/ $('.btn-close-mobile-more').on('click', function (e) { e.preventDefault(); $('#section-mobile-more').removeClass('mobile-active'); $('body').css('overflow', ''); }); }); var price_sell_max = 150000; var price_full_max = 100000; var price_deposit_max = 10000; var price_monthly_max = 200; $(function () { // 매매가 슬라이더 $("#price_sell_slider").ionRangeSlider({ type: "double", min: 0, max: price_sell_max, from: 0, to: price_sell_max, step: 5000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_sell_max), onFinish: function (data) { $('#price_sell_min').val(data.from); $('#price_sell_max').val(data.to); } }); // 전세가 슬라이더 $("#price_full_slider").ionRangeSlider({ type: "double", min: 0, max: price_full_max, from: 0, to: price_full_max, step: 1000, grid: true, skin: 'round', prettify: makeLabelingFunc(price_full_max), onFinish: function (data) { $('#price_full_min').val(data.from); $('#price_full_max').val(data.to); } }); // 보증금 슬라이더 $("#price_deposit_slider").ionRangeSlider({ type: "double", min: 0, max: price_deposit_max, from: 0, to: price_deposit_max, step: 100, grid: true, skin: 'round', prettify: makeLabelingFunc(price_deposit_max), onFinish: function (data) { $('#price_deposit_min').val(data.from); $('#price_deposit_max').val(data.to); } }); // 임대료 슬라이더 $("#price_monthly_slider").ionRangeSlider({ type: "double", min: 0, max: price_monthly_max, from: 0, to: price_monthly_max, step: 10, grid: true, skin: 'round', prettify: makeLabelingFunc(price_monthly_max), onFinish: function (data) { $('#price_monthly_min').val(data.from); $('#price_monthly_max').val(data.to); } }); /******************************************** * 거래 종류에 따른 가격 슬라이더 보이는 거 제어 *******************************************/ updateSliderVisibilityMulti(); $('.btn-trade_type').on('change', function () { updateSliderVisibilityMulti(); }); }); function makeLabelingFunc(max) { return function(ts) { if (ts == 0) return "0"; else if (ts >= max) return "제한없음"; else return numberToKorean(ts); } } function numberToKorean(number){ number = number *10000; /* 사이트에서 기본으로 1만원 기준으로 하니까 */ var inputNumber = number =1000){ resultArray[i] = Math.floor(unitResult / 1000) + "천"; } else if (unitResult >= 100){ resultArray[i] = Math.floor(unitResult / 100) + "백"; } else if (unitResult > 0){ resultArray[i] = unitResult; } } for (var i = 0; i { (tradeTypeMap[type] || []).forEach(priceKey => priceTypes.add(priceKey)); }); $('.price-box').each(function () { const key = $(this).data('price'); $(this).toggle(priceTypes.has(key)); }); } function updateTradeTypeLabel() { const checkedTypes = $('.btn-trade_type:checked'); const $label = $('#trade_typeLabel'); const defaultText = $label.data('label'); // '거래종류' if (checkedTypes.length === 0) { $label.text(defaultText); return; } const labels = checkedTypes.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updatePriceLabel() { const labels = { price_sell: '매', price_full: '전', price_deposit: '보', price_monthly: '월' }; let labelParts = []; for (const key in labels) { const sliderElem = $("#" + key + "_slider"); const slider = sliderElem.data("ionRangeSlider"); if (!slider) continue; const min = slider.result.from; const max = slider.result.to; const minLimit = slider.options.min; const maxLimit = slider.options.max; // 슬라이더 전체 범위 사용 시 생략 if (min === minLimit && max === maxLimit) continue; const labelChar = labels[key]; const minText = numberToKorean(min); let displayText = ""; if (max === maxLimit) { // 최대값 == 최댓값일 때 → 무제한 displayText = `${labelChar} ${minText}~`; } else { const maxText = numberToKorean(max); displayText = `${labelChar} ${minText} ~ ${maxText}`; } labelParts.push(displayText); } const $label = $("#priceLabel"); if (labelParts.length > 0) { $label.text(labelParts.join(", ")); } else { $label.text($label.data("label") || "금액"); } } function updateCategoryLabel() { const checked = $('input[name="category_id[]"]:checked'); const $label = $('#categoryLabel'); const defaultText = $label.data('label'); // 예: '매물종류' if (checked.length === 0) { $label.text(defaultText); return; } const labels = checked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); $label.text(labels.join(', ')); } function updateRoomLabel() { const $label = $('#roomLabel'); const defaultText = $label.data('label') || '방/욕실수'; const roomMin = $('select[name="opt_room_min"]').val(); const roomMax = $('select[name="opt_room_max"]').val(); const bathMin = $('select[name="opt_bath_min"]').val(); const bathMax = $('select[name="opt_bath_max"]').val(); let labelParts = []; if (roomMin || roomMax) { let roomText = '방 '; if (roomMin) roomText += roomMin; if (roomMin && roomMax) roomText += '~' + roomMax; else if (!roomMin && roomMax) roomText += '~' + roomMax; else if (roomMin && !roomMax) roomText += '~'; labelParts.push(roomText.trim()); } if (bathMin || bathMax) { let bathText = '욕실 '; if (bathMin) bathText += bathMin; if (bathMin && bathMax) bathText += '~' + bathMax; else if (!bathMin && bathMax) bathText += '~' + bathMax; else if (bathMin && !bathMax) bathText += '~'; labelParts.push(bathText.trim()); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateAreaLabel() { const $label = $('#areaLabel'); const defaultText = $label.data('label') || '면적'; const getSelectedPyeong = function(name) { const val = $(`select[name="${name}"]`).val(); if (!val) return ''; const pyeong = parseInt(val, 10); return (pyeong > 3300) ? '1000' : (pyeong / 3.3).toFixed(0); }; const exclusiveMin = getSelectedPyeong('opt_exclusive_area_min'); const exclusiveMax = getSelectedPyeong('opt_exclusive_area_max'); const landMin = getSelectedPyeong('opt_land_area_min'); const landMax = getSelectedPyeong('opt_land_area_max'); let labelParts = []; if (exclusiveMin || exclusiveMax) { let text = '전 '; if (exclusiveMin) text += exclusiveMin; if (exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (!exclusiveMin && exclusiveMax) text += '~' + exclusiveMax; else if (exclusiveMin && !exclusiveMax) text += '~'; labelParts.push(text); } if (landMin || landMax) { let text = '대 '; if (landMin) text += landMin; if (landMin && landMax) text += '~' + landMax; else if (!landMin && landMax) text += '~' + landMax; else if (landMin && !landMax) text += '~'; labelParts.push(text); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } } function updateEtcLabel() { const $label = $('#etcLabel'); const defaultText = $label.data('label') || '추가검색'; const floorMin = $('select[name="opt_floor_min"]').val(); const floorMax = $('select[name="opt_floor_max"]').val(); const themeChecked = $('input[name="themes[]"]:checked'); let labelParts = []; // 층수 라벨 처리 if (floorMin || floorMax) { const floorText = (value) => { if (value === "-1") return "지하 1층"; return value + "층"; }; let text = "층 "; if (floorMin) text += floorText(floorMin); if (floorMin && floorMax) text += " ~ " + floorText(floorMax); else if (!floorMin && floorMax) text += "~" + floorText(floorMax); else if (floorMin && !floorMax) text += "~"; labelParts.push(text.trim()); } // 테마 선택 처리 if (themeChecked.length > 0) { const themeLabels = themeChecked.map(function () { return $('label[for="' + this.id + '"]').text(); }).get(); labelParts.push(themeLabels.join(', ')); } if (labelParts.length > 0) { $label.text(labelParts.join(', ')); } else { $label.text(defaultText); } }

장바구니
찜한 상품
찜한 매물