diff --git a/src/components/indexWaterfallBox/indexWaterfallBox.vue b/src/components/indexWaterfallBox/indexWaterfallBox.vue index 659bea9..86df1e7 100644 --- a/src/components/indexWaterfallBox/indexWaterfallBox.vue +++ b/src/components/indexWaterfallBox/indexWaterfallBox.vue @@ -108,7 +108,8 @@ let watchInfo=()=>{ router.push({ path:itemData.type==='apartment'?'/apartmentDetail':'/detail', query: { - id: itemData.type=='apartment'?itemData.id:itemData.uniqid, + // id: itemData.type=='apartment'?itemData.id:itemData.uniqid, + // [itemData.type=='apartment'?itemData.id:itemData.uniqid,]: itemData.type=='apartment'?itemData.id:itemData.uniqid, type:itemData.intermediary=='1'?2:itemData.intermediary=='6'?3:!itemData.intermediary?'':1 } }) diff --git a/src/components/public/viewMap.vue b/src/components/public/viewMap.vue index 3eef8a7..a77d2ae 100644 --- a/src/components/public/viewMap.vue +++ b/src/components/public/viewMap.vue @@ -28,7 +28,6 @@ const props = defineProps({ let key = ref("MVNBZ-PEFWI-O4OGT-5ADVJ-7QAYJ-NBFY4") -console.log("props.latlng", props.latlng['latitude'], props.latlng['longitude']); const initMap = () => { let center = new TMap.LatLng(props.latlng['latitude'], props.latlng['longitude']); let map = new TMap.Map("container", { diff --git a/src/utils/axios.js b/src/utils/axios.js index 5594cd3..92b74e1 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -14,7 +14,7 @@ axios.interceptors.request.use( //响应拦截 showFullScreenLoading() // 开发时登录用的,可以直接替换小程序的 authorization // if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "x2mmnl9grt51bpplj2k6ioiuummzhnw3" - if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "0h870ovk2xckoqfsh8a3t3sg4sg5z7eg" + // if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "0h870ovk2xckoqfsh8a3t3sg4sg5z7eg" return config; }, error => { diff --git a/src/views/apartmentDetail.vue b/src/views/apartmentDetail.vue index 7b99152..9fa2dd4 100644 --- a/src/views/apartmentDetail.vue +++ b/src/views/apartmentDetail.vue @@ -6,11 +6,14 @@
{{ company.title }}
{{ info['propaganda'] }}
+
+
+
- +
-
{{ info['coordinate'][0] }} 11 {{ info['coordinate'][1] }} + :name="info['address']">
@@ -280,12 +283,12 @@
-
+
{{ item['title'] }}
-
{{ item['propaganda'] }}
+
{{ item['propaganda'] }}
@@ -364,9 +367,37 @@ import footerpage from '@/components/footer/footer.vue' import viewMap from '@/components/public/viewMap.vue' import transmitBtn from '@/components/public/transmitBtn.vue' import imageWatch from '@/components/detail/imageWatch.vue'; -import { useRouter } from 'vue-router' +import { useRouter, useRoute } from 'vue-router' let router = useRouter() +const route = useRoute(); + + +watch(route, () => { + uniqid = router.currentRoute.value.query['uniqid'] + info.value = {} + roomList.value = [] + carouselsconfig.value = { lives: {}, videos: {}, attachment: {} } + navList.value = [] + navTab.value = 'roomEle' + dualBrandList.value = [] + contactReservationState.value = false + customerservicelist.value = [] + mediaBtnstate.value = {} + + + slideshowList.value = null + detailsLeft.value = null + token = "" + + carouselIndex.value = 0 + allCarouselsData.value = [] + // mediaBtnstate.value = {} + + + init() + +}); let { uniqid } = router.currentRoute.value.query @@ -384,8 +415,6 @@ const cloaseImageShow = (list) => { imageShow.value = !imageShow.value } -// allCarouselsData - // 房间类型 let roomList = ref([]) let info = ref({}) @@ -406,29 +435,37 @@ let qrcode = ref("") // 小程序详情二维码 let allCarouselsData = ref([]) -proxy.$get("/tenement/pc/api/apartment/details", { uniqid }).then(res => { - if (res.code != 200) return - let data = res.data - roomList.value = data['roomList'] - data['info']['coordinate'] = data['info']['coordinate'].split(',').map(item => { - return +item - }) - info.value = data['info'] - attachment.value = data['info']['attachment'] - withsameapartments.value = data['withsameapartments'] - company = data['company'] - token = data['token'] - qrcode.value = data['qrcode'] - - handleAllCarouselsData() - - - nextTick(() => handleNavData()) - - if (data.withsameapartments > 0) dualBrandData() +onMounted(() => { + init() }) +const init = () => { + proxy.$get("/tenement/pc/api/apartment/details", { uniqid }).then(res => { + if (res.code != 200) return + let data = res.data + roomList.value = data['roomList'] + data['info']['coordinate'] = data['info']['coordinate'].split(',').map(item => { + return +item + }) + + info.value = data['info'] + attachment.value = data['info']['attachment'] + withsameapartments.value = data['withsameapartments'] + company = data['company'] + token = data['token'] + qrcode.value = data['qrcode'] + + handleAllCarouselsData() + + + nextTick(() => handleNavData()) + + if (data.withsameapartments > 0) dualBrandData() + }) +} + + let carouselsconfig = ref({ lives: {}, videos: {}, attachment: {} }) @@ -514,7 +551,7 @@ const handleNavData = () => { // 处理点击nav 滚动事件 const handleClickNav = value => { let scrollTop = eval(value).value.offsetTop + 136 - if (value != 'eleseEle') navTab.value = value + // if (value != 'eleseEle') navTab.value = value window.scrollTo({ top: scrollTop, behavior: 'smooth' }); } @@ -622,10 +659,23 @@ onUnmounted(() => { window.removeEventListener('scroll', handleScroll); }); +const gobrand = item => { + router.push(`/apartmentDetail?uniqid=${item.uniqid}`) +} + const handleScroll = () => { + if (Math.random() > 0.3) return + for (let i = 0; i < navList.value.length; i++) { + let element = navList.value[i] + const rect = eval(element.value).value.getBoundingClientRect(); + const distanceToTop = rect.top; + if (distanceToTop >= 0) { + navTab.value = element.value + break; + } - // 处理滚动事件 + } } @@ -648,6 +698,7 @@ const handleScroll = () => { background: linear-gradient(93.1004914498078deg, rgba(253, 218, 85, 1) 0%, rgba(229, 215, 190, 1) 50%, rgba(203, 254, 191, 1) 100%); border-radius: 16px 16px 0 0; padding: 0 30px; + position: relative; .brand-name { height: 22px; @@ -666,6 +717,23 @@ const handleScroll = () => { font-size: 14px; padding-top: 13px; } + + .arc-bj { + position: absolute; + bottom: 20px; + right: 0; + width: 20px; + height: 20px; + background-color: #fff; + + .arc { + width: 100%; + height: 100%; + background: rgba(203, 254, 191, 1); + border-radius: 0 0 100% 0; + + } + } } .header-content { @@ -675,13 +743,13 @@ const handleScroll = () => { border-radius: 16px 0 16px 16px; position: relative; - .arc { - position: absolute; - width: 12px; - height: 12px; - top: -12px; - right: 0; - } + // .arc { + // position: absolute; + // width: 12px; + // height: 12px; + // top: -12px; + // right: 0; + // } .header-left { width: 511px; @@ -1407,6 +1475,7 @@ const handleScroll = () => { box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.156862745098039); padding: 8px 0; margin-bottom: 20px; + cursor: pointer; .same-brand-header { width: 288px;