Skip to content

Commit a390600

Browse files
committed
banner点击跳转到公告详情
1 parent 8e23aeb commit a390600

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/views/home/home.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<van-pull-refresh v-model="loading" @refresh="load">
33
<div class="home-content">
44
<van-swipe class="swipe-content" :autoplay="3000">
5-
<van-swipe-item v-for="(image, index) in images" :key="index">
6-
<img v-if="image" v-lazy="image" />
5+
<van-swipe-item v-for="(item, index) in images" :key="index">
6+
<img v-if="item.imgUrl" v-lazy="item.imgUrl" @click.stop="messageDetailClick(item)"/>
77
<div v-else class="default-image"></div>
88
</van-swipe-item>
99
</van-swipe>
@@ -133,10 +133,10 @@ export default {
133133
if (res.data.length) {
134134
this.images = [];
135135
res.data.forEach(item => {
136-
this.images.push(item.imgUrl);
136+
this.images.push(item);
137137
});
138138
} else {
139-
this.images = [""];
139+
this.images = [{}];
140140
}
141141
}
142142
})
@@ -184,6 +184,9 @@ export default {
184184
},
185185
messageClick() {
186186
this.$router.push({ path: "/message" });
187+
},
188+
messageDetailClick(data) {
189+
this.$router.push({ path: "/message/detail", query: { id: data.id } });
187190
}
188191
}
189192
};

0 commit comments

Comments
 (0)