diff --git a/src/App.vue b/src/App.vue index 39ae6cc..e034b4c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -114,4 +114,27 @@ input[type="number"] { font-style: normal; font-display: swap; } + +.no-scrollbar { + scrollbar-width: none; + /* 隐藏滚动条 */ + + &::-webkit-scrollbar { + width: 0; + background-color: transparent; + } + + &::-webkit-scrollbar-thumb { + background-color: transparent; + } + + &::-webkit-scrollbar-track { + background-color: transparent; + } + + &::-webkit-scrollbar { + display: none; + /* 隐藏 Chrome 浏览器的滚动条 */ + } +} diff --git a/src/views/apartmentDetail.vue b/src/views/apartmentDetail.vue index 0529382..c12074c 100644 --- a/src/views/apartmentDetail.vue +++ b/src/views/apartmentDetail.vue @@ -21,15 +21,16 @@
1/3
-
+
-
- - - +
+
+ +
-
+
@@ -98,12 +99,12 @@
- -
-
+
@@ -152,8 +153,8 @@ {{ info.location || '位置' }}
- +
@@ -515,8 +516,8 @@ const handleMediaBtn = (type, index) => { const element = document.querySelector(`.element${index}`); if (element) { let left - if (type == 'left') left = element.scrollLeft - 50 - else left = element.scrollLeft + 50 + if (type == 'left') left = element.scrollLeft - 86 + else left = element.scrollLeft + 86 const scrollOptions = { left, behavior: 'smooth' @@ -524,14 +525,35 @@ const handleMediaBtn = (type, index) => { element.scrollTo(scrollOptions); nextTick(() => { - setTimeout(() => { if (element.scrollLeft == 0) mediaBtnstate.value[index] = 0 else if (element.scrollLeft + 460 == element.scrollWidth) mediaBtnstate.value[index] = 1 else mediaBtnstate.value[index] = 2 }, 150); }) + } +} +// 顶部轮播图的左右按钮 +const handleslideshow = (type) => { + const element = document.querySelector(`.slideshow-list`); + if (element) { + let left + if (type == 'left') left = element.scrollLeft - 100 + else left = element.scrollLeft + 100 + const scrollOptions = { + left, + behavior: 'smooth' + }; + element.scrollTo(scrollOptions); + + nextTick(() => { + setTimeout(() => { + // if (element.scrollLeft == 0) mediaBtnstate.value[index] = 0 + // else if (element.scrollLeft + 460 == element.scrollWidth) mediaBtnstate.value[index] = 1 + // else mediaBtnstate.value[index] = 2 + }, 150); + }) } } @@ -668,7 +690,39 @@ const handleMediaBtn = (type, index) => { } .box { - background-color: #50e3c2; + width: 360px; + overflow: auto; + + .item { + height: 60px; + margin-right: 6px; + position: relative; + cursor: pointer; + + &::after { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(255, 255, 255, 0.501960784313725); + } + + &.pitch { + &::after { + height: 0; + } + } + + // overflow: hidden; + + .img { + height: 100%; + border-radius: 10px; + + } + } } .arrow { @@ -892,26 +946,7 @@ const handleMediaBtn = (type, index) => { .media-list { max-width: 460px; overflow: auto; - scrollbar-width: none; - /* 隐藏滚动条 */ - &::-webkit-scrollbar { - width: 0; - background-color: transparent; - } - - &::-webkit-scrollbar-thumb { - background-color: transparent; - } - - &::-webkit-scrollbar-track { - background-color: transparent; - } - - &::-webkit-scrollbar { - display: none; - /* 隐藏 Chrome 浏览器的滚动条 */ - } } .media-item {