diff --git a/packages/community/index/index.vue b/packages/community/index/index.vue index 52487768..9fd78a90 100644 --- a/packages/community/index/index.vue +++ b/packages/community/index/index.vue @@ -277,12 +277,16 @@ page_num: 1, page_size: 50 }) - this.largePopList = res4.rows.map(item => { - return { - ...item, - ad_picture: picUrl + item.ad_picture - }; - }); + if (res4.rows.length != 0) { + this.largePopList = res4.rows.map(item => { + return { + ...item, + ad_picture: picUrl + item.ad_picture + }; + }); + } else { + this.ads1Show = false + } const res5 = await request(apiArr.advPage, "POST", { community_id: Number(uni.getStorageSync('changeCommData').id), @@ -290,12 +294,16 @@ page_num: 1, page_size: 50 }) - this.popList = res5.rows.map(item => { - return { - ...item, - ad_picture: picUrl + item.ad_picture - }; - }); + if (res5.rows.length != 0) { + this.popList = res5.rows.map(item => { + return { + ...item, + ad_picture: picUrl + item.ad_picture + }; + }); + } else { + this.ads2Show = false + } }, headerServerClick(e) {