<!--轮播图-->
xml
<view>
<swiper autoplay indicator-dots='true'>
<block wx:for="{{xxxx}}" wx:key="index">
<swiper-item data-xxxxx="{{xxxx(获取循环的跳转路径)}}" bindtap="点击事件">
<image src='xxxxx' lazy-load class='swipt'></image>
</swiper-item>
</block>
</swiper>
</view>
js
//轮播图跳转页面
点击事件名: function (e) {
wx.navigateTo({
url: `${e.currentTarget.dataset.(这里是xml中data-xxxx名字)}`,
success: function (res) {
// success
},
fail: function () {
// fail
},
complete: function () {
// complete
}
})
},