修改我的小区展示数据的逻辑
This commit is contained in:
parent
7fdf8f342f
commit
3e884f1b1a
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user