Commit d98137e4 authored by 张伯涛's avatar 张伯涛

首页轮播图点击事件

parent 4c87b98a
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
<!-- </view>--> <!-- </view>-->
<!-- </u-col>--> <!-- </u-col>-->
<u-col> <u-col>
<view bindtap="navigateToPage">
<u-swiper <u-swiper
:list="topicList" :list="topicList"
indicator indicator
indicatorMode="line" indicatorMode="line"
circular circular
></u-swiper> ></u-swiper>
</view>
</u-col> </u-col>
</u-row> </u-row>
<view style="padding-bottom: 30rpx;"> <view style="padding-bottom: 30rpx;">
...@@ -141,6 +143,16 @@ import USwiper from "../../uview-ui/components/u-swiper/u-swiper.vue"; ...@@ -141,6 +143,16 @@ import USwiper from "../../uview-ui/components/u-swiper/u-swiper.vue";
this.queryVideo() this.queryVideo()
this.queryTopic(); this.queryTopic();
}, },
navigateToPage(e) {
// 获取点击的u-swiper组件的索引
const index = e.currentTarget.dataset.index;
// 根据索引或其他逻辑确定跳转的页面
const link = this.topicList[index].url;
// 执行页面跳转
wx.navigateTo({
url: link,
});
},
sectionChange(index) { sectionChange(index) {
this.curNow = index; this.curNow = index;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment