Component({ properties: { userInfo: { type: Object, value: {} }, bannerList: { type: Array, value: [], observer() { this.setData({ current: 0 }) } } // banner的classify是:1:官方推荐;2:作品展播;3:官方活动;4:关注作品;5:我的作品 6:收藏作品; }, data: { current: 0 }, methods: { bannelEvent({ currentTarget }) { //1:图片,2:邀新榜,3:热播榜,4:挑战pk榜,5,朗读赛,6,领取勋章,8跳购买页 let { type, content } = currentTarget.dataset if ([2, 3, 4].includes(type)) { wx.navigateTo({ url: `/pages/ranking/index?id=${content}&type=${type}`, }) } else if (type == 5) { wx.navigateTo({ url: `/pages/match/index?activityId=${content}`, }) } else if (type == 1) { wx.navigateTo({ url: `/pages/rankIntro/index?img=${content}`, }) } else if (type == 8) { this.selectComponent('#buyVip').open() } else if (type == 9) { wx.navigateTo({ url: '/pages/invite/index', }) } else if (type == 7) { let url = '' if (!this.properties.userInfo.saleUserId) { url = '/salesperson/pages/sale/index' } else { url = '/salesperson/pages/saleOffice/index' } wx.navigateTo({ url }) } }, } })