详情页样式优化

This commit is contained in:
luJianJun 2023-08-03 12:16:17 +08:00
parent 0d34bc674e
commit 715005820d
2 changed files with 16 additions and 23 deletions

View File

@ -81,7 +81,7 @@ let imageTab = ref(0)
let prev = () => carousel.value.prev()
//
const carouselChange = value =>{ imageTab.value = value;console.log(value)}
const carouselChange = value =>{ imageTab.value = value}
//
let next = () => carousel.value.next()

View File

@ -182,13 +182,11 @@
style="transform: rotate(180deg);" @click.stop="moveImageList('left')"
v-show="imgListTab > 0 && scrollWidth > clientWidth">
<img src="../assets/img/detail/moreAllow.svg" class="icon right-icon" alt=""
@click.stop="moveImageList('right')"
v-show="imgList.length - 1 !== imgListTab &&
scrollWidth > clientWidth &&
imageLIstLeft[imgListTab] + clientWidth < scrollWidth">
<img src="../assets/img/detail/moreNot.svg" class="icon right-icon" alt=""
style="transform: rotate(180deg);" v-show="
@click.stop="moveImageList('right')" v-show="imgList.length - 1 !== imgListTab &&
scrollWidth > clientWidth &&
imageLIstLeft[imgListTab] + clientWidth < scrollWidth">
<img src="../assets/img/detail/moreNot.svg" class="icon right-icon" alt=""
style="transform: rotate(180deg);" v-show="scrollWidth > clientWidth &&
imageLIstLeft[imgListTab] + clientWidth >= scrollWidth">
<div class="dis-f al-item list-box s-w-100" ref="imageList" v-if="imgList.length > 0">
<div v-for="(item, i) in imgList" :key="i"
@ -496,15 +494,17 @@
v-show="item && !item.address" alt="">
</div>
{{ item && item.name }}
<div v-for="(items, i) in item && item.point" :key="i">
<span class="address-info">
{{ items.title }}
</span>
<span v-html="setDistanceList(items && `${items.distance}`)">
</span>
<!-- <span class="distance-text">
<div class="dis-f" style="flex-wrap: wrap;width:540px;">
<div v-for="(items, i) in item && item.point" :key="i">
<span class="address-info">
{{ items.title }}
</span>
<span v-html="setDistanceList(items && `${items.distance}`)">
</span>
<!-- <span class="distance-text">
1.1公里
</span> -->
</div>
</div>
</div>
</div>
@ -1085,8 +1085,8 @@ let imageLIstLeft = ref([])
let imgListTab = ref(0)
//
let interval = ''
let clientWidth = ref(null)
let scrollWidth = ref(null)
let clientWidth = ref(null)
let scrollWidth = ref(null)
//
let moveImageList = (type) => {
if (type === 'right' && imgScrollBottom()) return
@ -1120,11 +1120,9 @@ let imgData = ref(null)
//
let setImageWidth = (num) => {
imageLIstLeft.value[num] = imgData.value[num] && imgData.value[num].offsetLeft - 20
console.log(imageLIstLeft.value)
if (imageLIstLeft.value.length === imgList.value.length) {
clientWidth.value = imageList.value.clientWidth
scrollWidth.value = imageList.value.scrollWidth
console.log(scrollWidth.value,clientWidth.value)
}
}
@ -1153,7 +1151,6 @@ let setShowDistance = () => {
let titleType = ref(false)
//
let changeTitleType = () => {
// console.log(1)
titleType.value = !titleType.value
}
@ -1224,7 +1221,6 @@ let setNavigation = () => {
if (!location) return
if (pageType.value == 1 || pageType.value == 2) {
// location=3.8,3.13&areaItem=3
// console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`)
store.state.routeList['secondaryIndex'] = {
path: pageType.value === 2 ? '/intermediaryHousing' :
pageType.value === 3 ? '/needHousing' : '/personHousing',
@ -1401,7 +1397,6 @@ let recommendList = () => {
}).then(res => {
console.log(res)
if (res.code === 200) {
// console.log(res.data.data && res.data.data.length >= 30)
if (res.data.data && res.data.data.length >= 30) {
loadMore.value = true
loadText.value = '下拉加载更多'
@ -1443,7 +1438,6 @@ let getPublisherList = () => {
}).then(res => {
console.log(res)
if (res.code === 200) {
// console.log(res.data.length >= 30)
if (res.data.length >= 30) {
loadMore.value = true
} else {
@ -1470,7 +1464,6 @@ watch(route, () => {
let { id } = router.currentRoute.value.query
uniqid.value = id
pageType.value = housingInfo['data']['info'].intermediary === 1 ? 2 : housingInfo['data']['info'].intermediary === 6 ? 3 : 1 //1 2 3
// console.log('pageType', pageType.value)
publisherList.value = []
recommendListData.value = []
getHousingInfo()