From fd0d3c776f15926b4a0e8054300869c503912cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Thu, 31 Oct 2024 10:43:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BA=95=E9=83=A8=E5=8D=95?= =?UTF-8?q?=E5=87=BB=E6=9F=A5=E7=9C=8B=E6=88=B7=EF=BC=8C=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=98=AF=E6=9C=AC=E6=A5=BC=E6=83=85=E5=86=B5=E4=B8=8B=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E5=8F=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/xiaoqu/building.vue | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/views/components/xiaoqu/building.vue b/src/views/components/xiaoqu/building.vue index 4f0bb2b..fe4e7f8 100644 --- a/src/views/components/xiaoqu/building.vue +++ b/src/views/components/xiaoqu/building.vue @@ -124,6 +124,16 @@ export default { this.getBuildingList(); } }, + clickResult: { + handler(newVal, oldVal) { + if (newVal.id && this.loading == false) { + this.handlerWindow(); + console.log("已经是本楼"); + } + }, + deep: true, + // immediate: true, + }, }, created() {}, methods: { @@ -134,6 +144,8 @@ export default { this.currentIndex = 0; }, clickHouse(item) { + this.$store.commit("SET_CLICK_RESULT", {}); + debugger; this.$store.commit("SET_BUILDING_WIDTH", { id: item.id, buildingId: item.building_id, @@ -146,7 +158,6 @@ export default { keyId: item.id, }); this.currentIndex = item.id; - this.$store.commit("SET_CLICK_RESULT", {}); }, async getBuildingInfo() { let info = await getBuilding(this.queryParamsXiaoqu.buildingId); @@ -165,6 +176,11 @@ export default { this.loading = false; this.$store.commit("SET_REFRESH", 1); + this.handlerWindow(); + console.log("接口找"); + }, + + handlerWindow() { this.$nextTick(() => { const list = document.getElementsByClassName("foldPane-bottom")[0]; const build = document.getElementsByClassName("building-container")[0]; @@ -173,12 +189,9 @@ export default { list.style.width = `calc(100% - (390px + ${build.offsetWidth}px) )`; list.style.transform = `translateX(0)`; } - if (this.clickResult.id) { - this.clickHouse(this.clickResult); - } + if (this.clickResult.id) this.clickHouse(this.clickResult); }); }, - // 颜色处理 handleColor(item) { if (!item.color) {