|
@@ -59,7 +59,7 @@
|
|
|
<link rel="stylesheet" href="../../css/reset.css" />
|
|
|
<link rel="stylesheet" href="../../css/lists.css" />
|
|
|
<link rel="stylesheet" href="../../css/all.css" />
|
|
|
-
|
|
|
+ <!-- 結構化資料 -->
|
|
|
<script type="application/ld+json">
|
|
|
{
|
|
|
"@context": "https://schema.org",
|
|
@@ -112,26 +112,26 @@
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
- <script type="application/ld+json">
|
|
|
- {
|
|
|
- "@context": "https://schema.org",
|
|
|
- "@type": "BreadcrumbList",
|
|
|
- "itemListElement": [
|
|
|
- {
|
|
|
- "@type": "ListItem",
|
|
|
- "position": 1,
|
|
|
- "name": "幸福空間",
|
|
|
- "item": "https://hhh.com.tw/"
|
|
|
- },
|
|
|
- {
|
|
|
- "@type": "ListItem",
|
|
|
- "position": 2,
|
|
|
- "name": "設計師列表頁",
|
|
|
- "item": "https://hhh.com.tw/designers/lists/"
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
+
|
|
|
+ <script type="application/ld+json">
|
|
|
+ {
|
|
|
+ "@context": "https://schema.org",
|
|
|
+ "@type": "BreadcrumbList",
|
|
|
+ "itemListElement": [
|
|
|
+ {
|
|
|
+ "@type": "ListItem",
|
|
|
+ "position": 1,
|
|
|
+ "name": "幸福空間",
|
|
|
+ "item": "https://hhh.com.tw/"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "@type": "ListItem",
|
|
|
+ "position": 2,
|
|
|
+ "name": "設計師列表頁",
|
|
|
+ "item": "https://hhh.com.tw/designers/lists/"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
</script>
|
|
|
</head>
|
|
|
|
|
@@ -223,7 +223,7 @@
|
|
|
<div class="row w-100 mt-5 filter-list">
|
|
|
<div class="col-12">
|
|
|
<p class="mb-3 text-muted">
|
|
|
- 總共 <span class="text-primary font-weight-bold fs-4">254</span> 筆全國室內設計師符合條件
|
|
|
+ 總共 <span id="totalCount" class="text-primary font-weight-bold fs-4">254</span> 筆全國室內設計師符合條件
|
|
|
</p>
|
|
|
|
|
|
<div class="card text-dark bg-light border-0 mb-3 w-100 shadow-sm">
|
|
@@ -975,271 +975,6 @@
|
|
|
integrity="sha384-skAcpIdS7UcVUC05LJ9Dxay8AXcDYfBJqt1CJ85S/CFujBsIzCIv+l9liuYLaMQ/"
|
|
|
crossorigin="anonymous"></script>
|
|
|
<script src="./js/main.js"></script>
|
|
|
- <script>
|
|
|
- // $('#navbar').load('../../template/navbar.html');
|
|
|
-
|
|
|
- // $('#removeResultBtn').hide(); // 隱藏全部清除按鈕
|
|
|
-
|
|
|
- // // 處理 radio 選取狀態
|
|
|
- // $('.filter-list .form-check').click(function (e) {
|
|
|
- // e.preventDefault();
|
|
|
- // $(this).find('.form-check-input').prop('checked', true);
|
|
|
-
|
|
|
- // // 取得 radio 按鈕的 label
|
|
|
- // let radioLabel = $(this).find('.form-check-label').text().trim().replace(/\s+/g, ' '); // 移除換行空白
|
|
|
- // console.log('radioLabel', radioLabel);
|
|
|
-
|
|
|
- // // 取上一層 search-tab 按鈕文字
|
|
|
- // let buttonValue = $(this).closest('.dropdown').find('.search-tab').text().trim();
|
|
|
- // console.log('Selected button text:', buttonValue);
|
|
|
-
|
|
|
- // let buttonId = $(this).closest('.dropdown').find('.search-tab').attr('id');
|
|
|
- // console.log('buttonId', buttonId);
|
|
|
-
|
|
|
- // updateSelectedOptions(buttonId, buttonValue, radioLabel);
|
|
|
- // });
|
|
|
-
|
|
|
- // let filterList = []; // 篩選條件
|
|
|
-
|
|
|
- // // 更新篩選狀態
|
|
|
- // function updateSelectedOptions(id, button, radio) {
|
|
|
- // console.log('更新篩選狀態', button, radio);
|
|
|
-
|
|
|
- // if (filterList.length) {
|
|
|
- // let exists = false; // 判斷是否已存在
|
|
|
-
|
|
|
- // for (let index = 0; index < filterList.length; index++) {
|
|
|
- // const element = filterList[index];
|
|
|
-
|
|
|
- // // 如有重複 button 只改 radio 狀態
|
|
|
- // if (element.text === button) {
|
|
|
- // element.value = radio;
|
|
|
- // exists = true;
|
|
|
- // // 更新篩選的值
|
|
|
- // $(`.search-tab-result .budget:contains(${button})`).find('p').text(`${button}:${radio}`);
|
|
|
- // // $(`#${id} ul`).find('.form-check-input').prop('checked', true);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // // 如果 filterList 中不存在則新增
|
|
|
- // if (!exists) {
|
|
|
- // const newItem = {
|
|
|
- // id: id,
|
|
|
- // text: button,
|
|
|
- // value: radio
|
|
|
- // };
|
|
|
-
|
|
|
- // filterList.push(newItem);
|
|
|
- // createFilterHtml(newItem);
|
|
|
- // }
|
|
|
-
|
|
|
-
|
|
|
- // } else {
|
|
|
- // // 儲存篩選條件
|
|
|
- // filterList.push({
|
|
|
- // id: id,
|
|
|
- // text: button,
|
|
|
- // value: radio
|
|
|
- // })
|
|
|
-
|
|
|
- // for (let index = 0; index < filterList.length; index++) {
|
|
|
- // const element = filterList[index];
|
|
|
- // createFilterHtml(element);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // designerSearch(); // 搜尋
|
|
|
-
|
|
|
- // console.log('filterList', filterList);
|
|
|
-
|
|
|
- // // 切換按鈕選取狀態
|
|
|
- // $('.dropdown').each(function () {
|
|
|
- // let hasCheckedRadio = $(this).find('input[type="radio"]:checked').length > 0;
|
|
|
- // $(this).find('.search-tab').toggleClass('active', hasCheckedRadio);
|
|
|
- // });
|
|
|
- // }
|
|
|
-
|
|
|
- // // 新增篩選條件 HTML
|
|
|
- // function createFilterHtml(item) {
|
|
|
- // let dom = `
|
|
|
- // <span class="me-3">
|
|
|
- // <span class="d-flex budget">
|
|
|
- // <p class="me-1">${item.text}:${item.value}</p>
|
|
|
- // <img src="https://hhh.com.tw/assets/images/section/icon/close-btn-search.svg" alt="close-btn-search">
|
|
|
- // </span>
|
|
|
- // </span>`;
|
|
|
-
|
|
|
- // $('.search-tab-result').append(dom);
|
|
|
- // $('#removeResultBtn').show();
|
|
|
- // }
|
|
|
-
|
|
|
- // let page = 1; // 當前頁數
|
|
|
- // let pageSize = 18; // 每頁數量
|
|
|
-
|
|
|
- // // 列表篩選
|
|
|
- // async function designerSearch(type = "") {
|
|
|
- // // 預設排序為 recommend
|
|
|
- // let url = `https://m3.hhh.com.tw:18673/designer_search?page=${page}&page_size=${pageSize}&order_by=recommend`;
|
|
|
-
|
|
|
- // console.log('type', type);
|
|
|
-
|
|
|
- // if (type === "order_by") {
|
|
|
- // url += `&${type}=${assignOrder}`
|
|
|
- // }
|
|
|
-
|
|
|
- // if (filterList.length) {
|
|
|
- // filterList.map(item => {
|
|
|
- // if (item.id === 'budget') {
|
|
|
- // switch (item.value) {
|
|
|
- // case "100萬以下":
|
|
|
- // url += `&${item.id}=1`
|
|
|
- // break;
|
|
|
- // case "100~200萬":
|
|
|
- // url += `&${item.id}=2`
|
|
|
- // break;
|
|
|
- // case "200~300萬":
|
|
|
- // url += `&${item.id}=3`
|
|
|
- // break;
|
|
|
- // case "300~400萬":
|
|
|
- // url += `&${item.id}=4`
|
|
|
- // break;
|
|
|
- // case "400~500萬":
|
|
|
- // url += `&${item.id}=5`
|
|
|
- // break;
|
|
|
- // case "500萬以上":
|
|
|
- // url += `&${item.id}=6`
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // break;
|
|
|
- // }
|
|
|
-
|
|
|
- // } else {
|
|
|
- // url += `&${item.id}=${item.value}`
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
-
|
|
|
- // console.log('url >>', url);
|
|
|
-
|
|
|
- // let resultHtml = '';
|
|
|
-
|
|
|
- // try {
|
|
|
- // const response = await axios.get(url);
|
|
|
- // console.log("response", response);
|
|
|
-
|
|
|
- // let totalCount = response.data.total_count;
|
|
|
- // let totalPages = Math.ceil(totalCount / pageSize);
|
|
|
- // console.log('totalCount', totalCount);
|
|
|
- // console.log('totalPages', totalPages);
|
|
|
-
|
|
|
- // setPagination(totalPages); // 分頁處理
|
|
|
-
|
|
|
- // let resultHtml = '';
|
|
|
- // response.data.designers.forEach((item) => {
|
|
|
- // resultHtml += `
|
|
|
- // <div class="col-md-4 mb-4">
|
|
|
- // <a href="${item.DesignerLink}">
|
|
|
- // <div class="card">
|
|
|
- // <img src="${item.CaseCoverImg}" class="cover-img" alt="${item.DesignerName} ${item.DesignerTitle}">
|
|
|
- // <div class="card-body d-flex align-items-center">
|
|
|
- // <img src="${item.DesignerCoverImg}" alt="" class="me-3 person-img">
|
|
|
- // <section>
|
|
|
- // <h5 class="card-text text-muted">${item.DesignerTitle}</h5>
|
|
|
- // <h6 class="card-title mb-0 text-dark">
|
|
|
- // <span class="font-weight-bold">
|
|
|
- // ${item.DesignerName}
|
|
|
- // </span>
|
|
|
- // 設計師
|
|
|
- // </h6>
|
|
|
- // </section>
|
|
|
- // </div>
|
|
|
- // </div>
|
|
|
- // </a>
|
|
|
- // </div>`;
|
|
|
- // });
|
|
|
-
|
|
|
- // $('#designerList').html(resultHtml);
|
|
|
- // } catch (error) {
|
|
|
- // console.log("error", error);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // designerSearch();
|
|
|
-
|
|
|
- // // 分頁
|
|
|
- // function setPagination(pages) {
|
|
|
- // console.log('setPagination pages', pages);
|
|
|
-
|
|
|
- // // 往前一頁
|
|
|
- // let dom = `
|
|
|
- // <li class="page-item" onclick="handlePagination(this, 'previous')">
|
|
|
- // <a class="page-link" href="#" aria-label="Previous">
|
|
|
- // <span aria-hidden="true"><</span>
|
|
|
- // </a>
|
|
|
- // </li>`;
|
|
|
-
|
|
|
- // for (let index = 0; index < pages; index++) {
|
|
|
- // dom += `
|
|
|
- // <li class="page-item" onclick="handlePagination(this)">
|
|
|
- // <a class="page-link" href="#">${index + 1}</a>
|
|
|
- // </li>`;
|
|
|
- // }
|
|
|
-
|
|
|
- // // 往後一頁
|
|
|
- // dom += `
|
|
|
- // <li class="page-item" onclick="handlePagination(this, 'next')">
|
|
|
- // <a class="page-link" href="#" aria-label="Next">
|
|
|
- // <span aria-hidden="true">></span>
|
|
|
- // </a>
|
|
|
- // </li>`;
|
|
|
-
|
|
|
- // $('.designer-list-content .pagination').html(dom);
|
|
|
- // $('.designer-list-content .page-item').removeClass('active');
|
|
|
- // $('.designer-list-content .page-item').eq(page).addClass('active'); // 當前頁數加上選取狀態
|
|
|
- // }
|
|
|
-
|
|
|
- // // 頁碼處理
|
|
|
- // function handlePagination(item, type = "") {
|
|
|
- // if (type === "previous") {
|
|
|
- // // 往前一頁
|
|
|
- // console.log('previous');
|
|
|
- // page--;
|
|
|
- // console.log(page);
|
|
|
- // return;
|
|
|
- // } else if (type === "next") {
|
|
|
- // // 往後一頁
|
|
|
- // console.log('next');
|
|
|
- // page++;
|
|
|
- // console.log(page);
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- // console.log('item', item);
|
|
|
- // // 切換選取狀態
|
|
|
- // $('.designer-list-content .page-item').removeClass('active');
|
|
|
- // $(item).addClass('active');
|
|
|
-
|
|
|
- // page = $(item).find('.page-link')[0].innerText; // 修改當前頁數
|
|
|
-
|
|
|
- // designerSearch();
|
|
|
- // }
|
|
|
-
|
|
|
- // let assignOrder = ""; // 當前排序
|
|
|
-
|
|
|
- // // new, hot, recommend 排序 (預設推薦)
|
|
|
- // $(".search-btn-filter button").click(function () {
|
|
|
- // // 切換選取狀態
|
|
|
- // $('.search-btn-filter').find('.active').removeClass('active');
|
|
|
- // $(this).addClass('active');
|
|
|
-
|
|
|
- // assignOrder = $(this).attr('id');
|
|
|
- // console.log('assignOrder', assignOrder);
|
|
|
-
|
|
|
- // designerSearch("order_by");
|
|
|
- // });
|
|
|
-
|
|
|
- </script>
|
|
|
-
|
|
|
</body>
|
|
|
|
|
|
</html>
|