From 3e884f1b1a829e29a22170794344e102a69bca15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Wed, 6 Aug 2025 15:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=91=E7=9A=84=E5=B0=8F?= =?UTF-8?q?=E5=8C=BA=E5=B1=95=E7=A4=BA=E6=95=B0=E6=8D=AE=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/community/index/index.vue | 46 +++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/packages/community/index/index.vue b/packages/community/index/index.vue index c2d89dde..49a1138a 100644 --- a/packages/community/index/index.vue +++ b/packages/community/index/index.vue @@ -209,12 +209,14 @@ export default { loadMoreText: "", isShowBill: false, + + houseVal: "", }; }, async onLoad(options) { - if(!uni.getStorageSync("changeCommData")){ - return - } + // if (!uni.getStorageSync("changeCommData")) { + // return; + // } await request(apiArr2.commInfo, "POST", { user_id: uni.getStorageSync("userId"), longitude: uni.getStorageSync("location").lng, @@ -222,14 +224,30 @@ export default { page_num: this.page_num, page_size: this.page_size, }).then((res) => { - res.rows.find((item) => { - if (item.community_id == uni.getStorageSync("changeCommData").id) { - this.isShowBill = item.bill_front_end_display == 1 ? true : false; - } - }); if (res.rows.length == 0) { uni.removeStorageSync("changeCommData"); + return; } + + const targetItem = res.rows.find((item) => { + return item.community_id == uni.getStorageSync("changeCommData").id; + }); + + if (targetItem) { + //是否跳转物业缴费 + this.isShowBill = targetItem.bill_front_end_display == 1; + //小区是否隐藏 + if (targetItem.front_end_display == 1) { + uni.removeStorageSync("changeCommData"); + } + } + + res.rows = res.rows.filter((item) => { + return item.front_end_display != 1; + }); + console.log("🚀 ~ onLoad ~ res.rows:", res.rows) + uni.setStorageSync("changeCommData",{ name: res.rows[0].name, id: res.rows[0].community_id }) + this.communityList = res.rows; }); const meun = menuButtonInfo(); @@ -331,8 +349,8 @@ export default { }, async getfunctionList() { - if(!uni.getStorageSync("changeCommData")){ - return + if (!uni.getStorageSync("changeCommData")) { + return; } const res = await request(apiArr.navPage, "POST", { community_id: Number(uni.getStorageSync("changeCommData").id), @@ -355,8 +373,8 @@ export default { }, async getAdvertising() { - if(!uni.getStorageSync("changeCommData")){ - return + if (!uni.getStorageSync("changeCommData")) { + return; } const res = await request(apiArr.advPage, "POST", { community_id: Number(uni.getStorageSync("changeCommData").id), @@ -515,8 +533,8 @@ export default { }, async getCategoryList() { - if(!uni.getStorageSync("changeCommData")){ - return + if (!uni.getStorageSync("changeCommData")) { + return; } const res = await request(apiArr.categoryPage, "POST", { community_id: Number(uni.getStorageSync("changeCommData").id),