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) {