|
@@ -1,22 +1,6 @@
|
|
|
|
|
|
|
|
|
-console.log(1);
|
|
|
-$(document).ready(function () {
|
|
|
-console.log(1);
|
|
|
- $('#hhh-cases').scroll(function () {
|
|
|
- var h = $(this).height();
|
|
|
- var sh = $(this).scrollHeight;
|
|
|
- var st = $(this).scrollTop;
|
|
|
-
|
|
|
- console.log(h);
|
|
|
- console.log(sh);
|
|
|
- console.log(st);
|
|
|
- if(h+st>= sh){
|
|
|
- alert('底部了')
|
|
|
- }
|
|
|
|
|
|
- });
|
|
|
-});
|
|
|
|
|
|
$(document).on("click", ".article__readMore", function (event) {
|
|
|
$('.article__contexts_cases').css('height', 'auto');
|
|
@@ -36,9 +20,28 @@ $(document).on("click", ".likeSee__state__filter--item", function (event) {
|
|
|
|
|
|
|
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
|
+
|
|
|
let id = urlParams.get('cid');
|
|
|
+
|
|
|
console.log(id);
|
|
|
|
|
|
+
|
|
|
+var datahref = String(window.location.href);
|
|
|
+var datahref2 = "http://127.0.0.1:5501/cases.html/";
|
|
|
+
|
|
|
+
|
|
|
+console.log(datahref2);
|
|
|
+
|
|
|
+let posit = datahref2.indexOf("d");
|
|
|
+
|
|
|
+if (posit == -1) {
|
|
|
+ console.log('沒有d');
|
|
|
+
|
|
|
+} else {
|
|
|
+ console.log('有d');
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
function get_data() {
|
|
|
|
|
|
|
|
@@ -46,12 +49,13 @@ function get_data() {
|
|
|
|
|
|
$.ajax({
|
|
|
method: "GET",
|
|
|
- url: `json/cases-${id}.json`,
|
|
|
+
|
|
|
|
|
|
+ url: `https://m3.hhh.com.tw:18686/gencase?id=${id}&sort=new&page=1`,
|
|
|
dataType: "json",
|
|
|
})
|
|
|
.done(function (msg) {
|
|
|
-
|
|
|
+ console.log(msg);
|
|
|
let designersinfo = "";
|
|
|
let CaseInfo = "";
|
|
|
let CaseInfo_mb = "";
|
|
@@ -65,14 +69,19 @@ function get_data() {
|
|
|
let article__contexts = "";
|
|
|
let CaseCoverImg = "";
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
for (let i = 0; i < msg.length; i++) {
|
|
|
|
|
|
CaseCoverImg = `
|
|
|
- <img class="img-fluid" src="${msg[i].CaseCoverImg}" alt="">
|
|
|
-
|
|
|
+ <div class="CaseCoverImg">
|
|
|
+ <a style="text-decoration: none;" href="https://hhh.com.tw/photos/detail/${id}/" target="_blank">
|
|
|
+ <img class="img-fluid" src="${msg[i].CaseCoverImg}" alt="">
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <div class="morePhotoTip">
|
|
|
+ <a style="text-decoration: none; color:#fff;" href="https://hhh.com.tw/photos/detail/${id}/" target="_blank">
|
|
|
+ <i class="fa fa-clone case-img-quantity" aria-hidden="true"><span class="ms-2 case-img-quantity">${msg[i].CaseImgAmount}</span></i>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
`
|
|
|
designersinfo = `
|
|
|
<div class="container container-width-column px-md-0">
|
|
@@ -264,24 +273,24 @@ function get_data() {
|
|
|
</div>
|
|
|
</div>`
|
|
|
|
|
|
- for (var k = 0; k<msg[i].DesignerProfile.length; k++) {
|
|
|
+ for (var k = 0; k < msg[i].StyleProfile.length; k++) {
|
|
|
|
|
|
CaseNews +=
|
|
|
'<div class="col-6 col-md-4 ps-0"\
|
|
|
<div class="vue-waterfall-slot">\
|
|
|
- <div class="card CaseNews-Card">\
|
|
|
- <a href="'+ msg[i].DesignerProfile[k].ProfileLink + '">\
|
|
|
+ <div class="card">\
|
|
|
+ <a href="'+ msg[i].StyleProfile[k].ProfileLink + '">\
|
|
|
<img class="img-fluid"\
|
|
|
- src="'+ msg[i].DesignerProfile[k].ProfileImg + '"\
|
|
|
+ src="'+ msg[i].StyleProfile[k].ProfileImg + '"\
|
|
|
alt="幸福空間個案圖" class="card-img-top">\
|
|
|
</a>\
|
|
|
</div>'
|
|
|
CaseNews += '<div class="card-body">'
|
|
|
- for (var z = 0; z < msg[i].DesignerProfile[k].ProfileTag.length; z++) {
|
|
|
+ for (var z = 0; z < msg[i].StyleProfile[k].ProfileTag.length; z++) {
|
|
|
|
|
|
CaseNews += '\
|
|
|
- <a target="_blank" href="https://hhh.com.tw/cases/lists/' + msg[i].DesignerProfile[k].ProfileTag[z].Tag + '-keyword/">\
|
|
|
- '+ msg[i].DesignerProfile[k].ProfileTag[z].Tag + '\
|
|
|
+ <a target="_blank" href="https://hhh.com.tw/cases/lists/' + msg[i].StyleProfile[k].ProfileTag[z].Tag + '-keyword/">\
|
|
|
+ '+ msg[i].StyleProfile[k].ProfileTag[z].Tag + '\
|
|
|
</a>\
|
|
|
';
|
|
|
}
|
|
@@ -289,6 +298,30 @@ function get_data() {
|
|
|
};
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -310,218 +343,218 @@ function get_data() {
|
|
|
|
|
|
|
|
|
|
|
|
- CaseDetail += '<div class="row px-0 mx-0">'
|
|
|
- CaseDetail += '<div class="col-md-8 case-slick-box" style="overflow-y: hidden;"><button type="button" class="btn-close close-window d-block d-md-none mt-3 btn-close-white" style="margin-left:auto"></button><div class="img-wrapper-desktopp"><div class="CaseDetail-slick">'
|
|
|
-
|
|
|
- for (let j = 0; j < msg[i].CaseDetail.length; j++) {
|
|
|
- CaseDetail +=
|
|
|
- '<div style="width: 960px;" class="CaseSlider" data-info="' + j + '"><div class="img-wrapper-desktop"><div class="swiper-zoom-container-desktop"><img src="' + msg[i].CaseDetail[j].CaseDetailImg + '" alt=""></div></div></div>'
|
|
|
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- CaseDetail += '</div></div></div>'
|
|
|
-
|
|
|
- CaseDetail +=
|
|
|
- '<div class="col-md-4" style="background-color:#fff;">\
|
|
|
- <div class="modal-header border-0 display-pc close-window">\
|
|
|
- <button type="button" class="btn-close"></button>\
|
|
|
- </div>\
|
|
|
- <div class="d-flex justify-content-start align-items-center pt-5">\
|
|
|
- <a href="">\
|
|
|
- <div class="contact-section-avatar me-2">\
|
|
|
- <img class="img-fluid" src="'+ msg[i].ContactDesignerImg + '" alt="">\
|
|
|
- </div>\
|
|
|
- </a>\
|
|
|
- <div class="ms-2" style="width: 100%;">\
|
|
|
- <a href="" class="contact-section-company">\
|
|
|
- <div>\
|
|
|
- '+ msg[i].CaseCompany + '\
|
|
|
- </div>\
|
|
|
- </a>\
|
|
|
- <div style="display: flex;" class="contact-section-detail-box mt-3">\
|
|
|
- <div class="contact-section-detail-lf">\
|
|
|
- <div><i aria-hidden="true" class="fa fa-phone"></i></div>\
|
|
|
- </div>\
|
|
|
- <div class="contact-section-detail-rt">\
|
|
|
- <div><a href="tel:'+ msg[i].ContactFreeTel + '">免付費 ' + msg[i].ContactFreeTel + '</a></div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- '
|
|
|
- CaseDetail +=
|
|
|
- '<div class="info-area-title-desktop">\
|
|
|
- <a href="'+ msg[i].CasePageLink + '" target="_blank">\
|
|
|
- '+ msg[i].Casetitle + '\
|
|
|
- </a>\
|
|
|
- </div>\
|
|
|
- <div class="divider"></div>\
|
|
|
- '
|
|
|
- CaseDetail +=
|
|
|
- '<div class="info-area-other-case-desktop py-3">\
|
|
|
- <div class="ml-1">該個案的其他圖片(<span id="index" class="slickNumber">1</span>/'+ msg[i].CaseDetail.length + ')</div>\
|
|
|
- <div class="other-case-desktop-items d-flex flex-wrap">\
|
|
|
- '
|
|
|
- for (let j = 0; j < msg[i].CaseDetail.length; j++) {
|
|
|
-
|
|
|
- CaseDetail +=
|
|
|
- '<div id="img-0" data-thisid=(' + j + ') class="w-20 m-1 p-1 img_all CaseOtherImg" style="cursor: pointer;" onclick="slickGoTo(' + j + ')">\
|
|
|
- <img src=" '+ msg[i].CaseDetail[j].CaseDetailImg + '" width="70" height="70" alt="該個案的其他圖片">\
|
|
|
- </div>'
|
|
|
-
|
|
|
- };
|
|
|
+
|
|
|
|
|
|
|
|
|
- CaseDetail += '</div></div>';
|
|
|
+
|
|
|
|
|
|
- CaseDetail += '<div class="divider"></div>';
|
|
|
+
|
|
|
|
|
|
- CaseDetail +=
|
|
|
- '<div class="info-area-same-case-desktop py-3">\
|
|
|
- <div class="ml-1"><span>工業風</span> 其他作品</div>\
|
|
|
- <div class="same-case-desktop-items d-flex flex-wrap">\
|
|
|
- '
|
|
|
- for (let j = 0; j < msg[i].OtherStylePortfolio.length; j++) {
|
|
|
- CaseDetail +=
|
|
|
- '<div class="w-20 m-1 p-1 ">\
|
|
|
- <a href="'+ msg[i].OtherStylePortfolio[j].PortfoliolLink + '">\
|
|
|
- <img src="'+ msg[i].OtherStylePortfolio[j].PortfoliolImg + '" width="70" height="70" alt="' + msg[i].OtherStylePortfolio.PortfoliolImgAlt + '">\
|
|
|
- </a>\
|
|
|
- </div>'
|
|
|
- };
|
|
|
- CaseDetail += '</div></div>';
|
|
|
- CaseDetail += '<div class="divider"></div>';
|
|
|
-
|
|
|
- CaseDetail +=
|
|
|
- '<div class="info-area-data-desktop py-3">\
|
|
|
- <div class="ml-2">CASE DATA</div>\
|
|
|
- <div class="data-table-desktop ml-2">\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>裝潢費用:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseProject + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>居住成員:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseDataMember + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>設計風格:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseStyle + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>房屋類型:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseDataType + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>房屋坪數:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseSize + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>房屋狀況:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseDataSituation + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>圖片提供:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseCompany + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>空間格局:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseDataSpace + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-items d-flex">\
|
|
|
- <div class="data-table-lf">\
|
|
|
- <div>主要建材:</div>\
|
|
|
- </div>\
|
|
|
- <div class="data-table-rt">\
|
|
|
- <div>'+ msg[i].CaseDataMaterial + '</div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>';
|
|
|
-
|
|
|
- CaseDetail += '<div class="divider"></div>';
|
|
|
- CaseDetail +=
|
|
|
- '<div class="info-area-contact-desktop py-3 mb-2">\
|
|
|
- <div class="ml-2">聯絡資訊 Info</div>\
|
|
|
- <div class="contact-section-desktop ml-2 mt-2">\
|
|
|
- <div class="contact-section-detail-desktop mt-3">\
|
|
|
- <div class="d-flex">\
|
|
|
- <div class="contact-section-detail-lf">\
|
|
|
- <div><i aria-hidden="true" class="fa fa-phone"></i></div>\
|
|
|
- </div>\
|
|
|
- <div class="contact-section-detail-rt">\
|
|
|
- <div>\
|
|
|
- <a href="tel:'+ msg[i].CaseCompanyTel + '">' + msg[i].CaseCompanyTel + '</a>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="d-flex">\
|
|
|
- <div class="contact-section-detail-lf">\
|
|
|
- <div><i class="fas fa-map-marker-alt"></i></div>\
|
|
|
- </div>\
|
|
|
- <div class="contact-section-detail-rt">\
|
|
|
- <div><a href="'+ msg[i].CaseCompanyMap + '" target="_blank">' + msg[i].CaseCompanyAddress + '</a></div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="d-flex">\
|
|
|
- <div class="contact-section-detail-lf">\
|
|
|
- <div><i class="far fa-envelope"></i></div>\
|
|
|
- </div>\
|
|
|
- <div class="contact-section-detail-rt">\
|
|
|
- <div><a href="mailto:'+ msg[i].CaseCompanyEmail + '">' + msg[i].CaseCompanyEmail + '</a></div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- <div class="d-flex">\
|
|
|
- <div class="contact-section-detail-lf">\
|
|
|
- <div><i aria-hidden="true" class="fa fa-home"></i></div>\
|
|
|
- </div>\
|
|
|
- <div class="contact-section-detail-rt">\
|
|
|
- <div><a href="'+ msg[i].CaseCompanyWeb + '"\
|
|
|
- target="_blank">'+ msg[i].CaseCompanyWeb + '</a></div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>\
|
|
|
- </div>'
|
|
|
- CaseDetail += '</div>'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
CasePageTitle += '' + msg[i].Casetitle + ''
|
|
|
|
|
|
- CaseImgQuantity += '<span class="ms-2 case-img-quantity">' + msg[i].CaseDetail.length + '</span>'
|
|
|
}
|
|
|
- $('.CaseCoverImg').html(CaseCoverImg);
|
|
|
+ $('.CaseCover_Box').html(CaseCoverImg);
|
|
|
|
|
|
$('.article').html(designersinfo);
|
|
|
$('.CaseInfo').html(CaseInfo);
|
|
@@ -532,30 +565,30 @@ function get_data() {
|
|
|
$('.caseData-PC-right').html(CaseData2);
|
|
|
$('.CaseNews-Card').html(CaseNews);
|
|
|
|
|
|
- $('.CaseModel').html(CaseDetail);
|
|
|
+
|
|
|
$('#case-page-title').html(CasePageTitle);
|
|
|
- $('.case-img-quantity').html(CaseImgQuantity);
|
|
|
+
|
|
|
$('.article__contexts-box').html(article__contexts);
|
|
|
|
|
|
|
|
|
|
|
|
- $('.CaseDetail-slick').slick({
|
|
|
- slidesToShow: 1,
|
|
|
- slidesToScroll: 1,
|
|
|
- arrows: true,
|
|
|
- prevArrow: '<button type="button" class="slick-prev"><i class="fas fa-chevron-left" style="font-size: 32px;color: white; transform: translateY(-10px);"></i></button>',
|
|
|
- nextArrow: '<button type="button" class="slick-next"><i class="fas fa-chevron-right" style="font-size: 32px;color: white;transform: translateY(-10px);"></i></button>'
|
|
|
- });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- var activeimg = $(".slick-active img")[0];
|
|
|
+
|
|
|
|
|
|
- console.log(activeimg);
|
|
|
+
|
|
|
|
|
|
- var imgwidth = activeimg.width;
|
|
|
+
|
|
|
|
|
|
- var imgheight = activeimg.height;
|
|
|
+
|
|
|
|
|
|
- console.log(imgwidth);
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -564,9 +597,9 @@ function get_data() {
|
|
|
|
|
|
|
|
|
|
|
|
- if (imgwidth < imgheight) {
|
|
|
- activeimg.style.width = 'auto';
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -577,98 +610,104 @@ get_data();
|
|
|
|
|
|
$('.morePhotoTip > a').attr('href', `./casedetail.html?cid=${id}`);
|
|
|
|
|
|
-function slickGoTo(key) {
|
|
|
+
|
|
|
|
|
|
- let slickNumber = "";
|
|
|
- $('.CaseDetail-slick').slick('slickGoTo', key);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- let slickNo = key + 1;
|
|
|
- console.log(slickNo);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- slickNumber += '' + slickNo + ''
|
|
|
+
|
|
|
|
|
|
- $('.slickNumber').html(slickNumber);
|
|
|
+
|
|
|
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
|
|
|
-$(document).on("click", ".slick-prev", function (event) {
|
|
|
- let slickNumbertest = '';
|
|
|
- console.log(desid - 1);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- let slickNumber1 = desid + 1;
|
|
|
+
|
|
|
|
|
|
- slickNumbertest += '' + slickNumber1 + ''
|
|
|
+
|
|
|
|
|
|
- $('.slickNumber').html(slickNumbertest);
|
|
|
+
|
|
|
|
|
|
|
|
|
-});
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-$(document).on("click", ".slick-next", function (event) {
|
|
|
- var desid = $(".slick-active").data("info");
|
|
|
|
|
|
- let slickNumbertest = '';
|
|
|
- console.log(desid + 1);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- let slickNumber1 = desid + 1;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- slickNumbertest += '' + slickNumber1 + ''
|
|
|
+
|
|
|
|
|
|
- $('.slickNumber').html(slickNumbertest);
|
|
|
+
|
|
|
|
|
|
-});
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-$(document).on("click", ".close-window", function (event) {
|
|
|
- window.close();
|
|
|
-});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+let filter;
|
|
|
|
|
|
-$( ".views" ).click(function() {
|
|
|
+$(".views").click(function () {
|
|
|
+ filter = "hot";
|
|
|
get_views_data();
|
|
|
+
|
|
|
});
|
|
|
|
|
|
-$( ".recently" ).click(function() {
|
|
|
- get_data();
|
|
|
+$(".recently").click(function () {
|
|
|
+ filter = "new";
|
|
|
+ get_views_data();
|
|
|
+
|
|
|
});
|
|
|
|
|
|
function get_views_data() {
|
|
|
+
|
|
|
$.ajax({
|
|
|
method: "GET",
|
|
|
- url: `json/cases-${id}.json`,
|
|
|
+
|
|
|
|
|
|
+ url: `https://m3.hhh.com.tw:18686/gencase?id=${id}&sort=${filter}&page=1`,
|
|
|
dataType: "json",
|
|
|
})
|
|
|
- .done(function (msg) {
|
|
|
|
|
|
- console.log(msg);
|
|
|
+ .done(function (msg) {
|
|
|
let CaseNews = "";
|
|
|
- msg[0].DesignerProfile.sort(function (a,b){
|
|
|
- return a['Views'] > b['Views']? -1:1;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ console.log(msg);
|
|
|
|
|
|
- console.log(msg[0].DesignerProfile);
|
|
|
+ console.log(msg[0].StyleProfile);
|
|
|
|
|
|
- for (var k = 0; k < msg[0].DesignerProfile.length; k++) {
|
|
|
+ for (var k = 0; k < msg[0].StyleProfile.length; k++) {
|
|
|
CaseNews +=
|
|
|
- '<div class="col-6 col-md-4 ps-0" >\
|
|
|
+ '<div class="col-6 col-md-4 ps-0"\
|
|
|
<div class="vue-waterfall-slot">\
|
|
|
<div class="card CaseNews-Card">\
|
|
|
- <a href="'+ msg[0].DesignerProfile[k].ProfileLink + '">\
|
|
|
+ <a href="'+ msg[0].StyleProfile[k].ProfileLink + '">\
|
|
|
<img class="img-fluid"\
|
|
|
- src="'+ msg[0].DesignerProfile[k].ProfileImg + '"\
|
|
|
+ src="'+ msg[0].StyleProfile[k].ProfileImg + '"\
|
|
|
alt="幸福空間個案圖" class="card-img-top">\
|
|
|
</a>\
|
|
|
</div>'
|
|
|
CaseNews += '<div class="card-body">'
|
|
|
- for (var z = 0; z < msg[0].DesignerProfile[k].ProfileTag.length; z++) {
|
|
|
+ for (var z = 0; z < msg[0].StyleProfile[k].ProfileTag.length; z++) {
|
|
|
|
|
|
CaseNews += '\
|
|
|
- <a target="_blank" href="https://hhh.com.tw/cases/lists/' + msg[0].DesignerProfile[k].ProfileTag[z].Tag + '-keyword/">\
|
|
|
- '+ msg[0].DesignerProfile[k].ProfileTag[z].Tag + '\
|
|
|
+ <a target="_blank" href="https://hhh.com.tw/cases/lists/' + msg[0].StyleProfile[k].ProfileTag[z].Tag + '-keyword/">\
|
|
|
+ '+ msg[0].StyleProfile[k].ProfileTag[z].Tag + '\
|
|
|
</a>\
|
|
|
';
|
|
|
}
|
|
@@ -676,12 +715,185 @@ function get_views_data() {
|
|
|
};
|
|
|
|
|
|
$('.CaseNews-Card').html(CaseNews);
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
+if ($(".views").hasClass("active")) {
|
|
|
+ filter = "hot";
|
|
|
+
|
|
|
+} else {
|
|
|
+ filter = "new";
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function scroll_bottom_load_data(page) {
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ method: "GET",
|
|
|
+
|
|
|
+
|
|
|
+ url: `https://m3.hhh.com.tw:18686/gencase?id=${id}&sort=${filter}&page=${page}`,
|
|
|
+ dataType: "json",
|
|
|
+ })
|
|
|
+ .done(function (msg) {
|
|
|
+ let CaseNews = "";
|
|
|
+
|
|
|
+ for (var k = 0; k < msg[0].StyleProfile.length; k++) {
|
|
|
+
|
|
|
+ CaseNews +=
|
|
|
+ '<div class="col-6 col-md-4 ps-0">\
|
|
|
+ <div class="vue-waterfall-slot">\
|
|
|
+ <div class="card">\
|
|
|
+ <a href="'+ msg[0].StyleProfile[k].ProfileLink + '">\
|
|
|
+ <img class="img-fluid" src="'+ msg[0].StyleProfile[k].ProfileImg + '" alt="幸福空間個案圖" class="card-img-top">\
|
|
|
+ </a>\
|
|
|
+ </div>'
|
|
|
+ CaseNews += '<div class="card-body">'
|
|
|
+ for (var z = 0; z < msg[0].StyleProfile[k].ProfileTag.length; z++) {
|
|
|
+
|
|
|
+ CaseNews += '\
|
|
|
+ <a target="_blank" href="https://hhh.com.tw/cases/lists/' + msg[0].StyleProfile[k].ProfileTag[z].Tag + '-keyword/">\
|
|
|
+ '+ msg[0].StyleProfile[k].ProfileTag[z].Tag + '\
|
|
|
+ </a>\
|
|
|
+ ';
|
|
|
+ }
|
|
|
+ CaseNews += '</div></div></div></div>'
|
|
|
+ };
|
|
|
+ $('.CaseNews-Card').append(CaseNews);
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+$(window).scroll(function () {
|
|
|
+ var scrollTop = $(this).scrollTop();
|
|
|
+ var scrollHeight = $('body').prop("scrollHeight");
|
|
|
+
|
|
|
+ var clientHeight = document.documentElement.clientHeight;
|
|
|
+ if (jQuery(window).width() < 767) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (scrollTop + clientHeight >= scrollHeight - 5) {
|
|
|
+ loadMore_m();
|
|
|
+ console.log(page);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (scrollTop + clientHeight >= scrollHeight - 5) {
|
|
|
+ loadMore();
|
|
|
+ console.log(page);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+var page = 1;
|
|
|
+function loadMore() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ setTimeout(function () {
|
|
|
+ page++;
|
|
|
+
|
|
|
+ scroll_bottom_load_data(page);
|
|
|
+
|
|
|
+ return page
|
|
|
+ }, 1000);
|
|
|
+}
|
|
|
+
|
|
|
+function loadMore_m() {
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ setTimeout(function () {
|
|
|
+ page++;
|
|
|
+
|
|
|
+ scroll_bottom_load_data(page);
|
|
|
+
|
|
|
+ return page
|
|
|
+ }, 500);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -699,5 +911,4 @@ function get_views_data() {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|