|
@@ -9,38 +9,45 @@
|
|
|
|
|
|
<div id="all">
|
|
|
|
|
|
- <!-- {{ partial "top.html" . }} -->
|
|
|
-
|
|
|
{{ partial "nav.html" . }}
|
|
|
|
|
|
{{ partial "carousel.html" . }}
|
|
|
|
|
|
{{ partial "features.html" . }}
|
|
|
|
|
|
- <!-- {{ partial "testimonials.html" . }}
|
|
|
-
|
|
|
- {{ partial "see_more.html" . }}
|
|
|
-
|
|
|
- {{ partial "recent_posts.html" . }}
|
|
|
-
|
|
|
- {{ partial "clients.html" . }} -->
|
|
|
-
|
|
|
{{ partial "footer.html" . }}
|
|
|
|
|
|
</div>
|
|
|
- <!-- /#all -->
|
|
|
|
|
|
{{ partial "scripts.html" . }}
|
|
|
|
|
|
<script>
|
|
|
- // $(".responsive").slick({
|
|
|
- // dots: true,
|
|
|
- // slidesToShow: 1,
|
|
|
- // slidesToScroll: 1,
|
|
|
- // autoplay: true,
|
|
|
- // autoplaySpeed: 3000,
|
|
|
- // arrows: false,
|
|
|
- // });
|
|
|
+ (function getContentsData() {
|
|
|
+ // 線上版網址 https://bhouse3.ptt.cx:9002/api/
|
|
|
+ // 本地端網址 http://localhost:9001/api/
|
|
|
+ fetch('https://bhouse3.ptt.cx:9002/api/contents?url=/collection').then(res => res.json()).then(list => {
|
|
|
+ let collectionContent = document.querySelector('.collection-content');
|
|
|
+ let collectionList = [];
|
|
|
+
|
|
|
+ for (let i = 0; i < 3; i++) {
|
|
|
+ const e = list[i];
|
|
|
+
|
|
|
+ let content = `
|
|
|
+ <div class="col-12 p-0 bottom-box">
|
|
|
+ <a style="text-decoration: none;" href="${e.url}">
|
|
|
+ <img src="${e.image}" style="max-width: 100%;">
|
|
|
+ <div>
|
|
|
+ <p>${e.banner_img_text}</p>
|
|
|
+ <p>${e.homeowner}|${e.room_count}|${e.house_size}</p>
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+ </div>`;
|
|
|
+
|
|
|
+ collectionList.push(content);
|
|
|
+ }
|
|
|
+ collectionContent.innerHTML = collectionList.join(" ");
|
|
|
+ })
|
|
|
+ })();
|
|
|
</script>
|
|
|
|
|
|
</body>
|