-
+
@@ -148,7 +149,9 @@
categoryList: [],
infoList: [],
- selectedTab: 0
+ selectedTab: 0,
+
+ currentAdIndex: 0
}
},
async onLoad(options) {
@@ -351,6 +354,9 @@
// #endif
}
},
+ onSwiperChange(e) {
+ this.currentAdIndex = e.detail.current;
+ },
onDetailClick() {
// 获取当前显示的广告项
const currentAd = this.popList[this.currentAdIndex];
From 19d05689090d1ce0d139b73b2d2384b0b53adfc9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com>
Date: Wed, 9 Jul 2025 11:52:46 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=B9=E7=AA=97?=
=?UTF-8?q?=E5=B9=BF=E5=91=8Abug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/community/index/index.vue | 32 +++++++++++++++++++-----------
1 file changed, 20 insertions(+), 12 deletions(-)
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) {