wxml:
<swiper catchtap="onSwiperTap" indicator-dots="true" autoplay="true" interval="5000">
<swiper-item>
<image src="/images/demo.png" data-Id="1"></image>
</swiper-item>
<swiper-item>
<image src="/demo/demo.png" data-Id="2"></image>
</swiper-item>
</swiper>
js:
onSwiperTap: function (event) {
var id= event.target.dataset.Id;
wx.navigateTo({
url: "详细页的地址?id=" + id
})
}