增加点击轮播跳转

This commit is contained in:
TOP糯米 2023-04-02 12:11:42 +08:00
parent fb652664f1
commit 0138d50226
1 changed files with 3 additions and 1 deletions

View File

@ -4,7 +4,7 @@
<widget-search :disabled="true" />
</view>
<view class="banner">
<app-banner :list="bannerList" />
<app-banner :list="bannerList" @onClickItem="toPage($event.page)" />
</view>
<view class="notify">
<view class="icon">
@ -127,6 +127,7 @@ export default {
response.data.forEach((item) => {
this.bannerList.push({
image: item.image,
page: item.url,
});
});
});
@ -149,6 +150,7 @@ export default {
* 跳转
*/
toPage(page) {
if (!page) return;
const params = this.$utils.getUrlParams(page);
if (page.indexOf("service/cate") > 0) {
this.$store.commit("system/currentCateId", params.id);