| | |
| | | itemClick(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | if(item.contentType == 'video'){ |
| | | wx.previewMedia({ |
| | | sources: [{ url: item.content, type: 'video' }] |
| | | }) |
| | | }) |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | } |
| | | if(item.contentType == 'link'){ |
| | | wx.navigateTo({ |
| | |
| | | // 通过eventChannel向被打开页面传送数据 |
| | | res.eventChannel.emit('data',{link:item.content} ); |
| | | } |
| | | }) |
| | | }) |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | } |
| | | if(item.contentType == 'page'){ |
| | | getApp().globalData.catalogCode=item.content |
| | | wx.switchTab({ |
| | | url: '/pages/discover/discover' |
| | | }) |
| | | }) |
| | | actionDo({actionType: 'view',id: item.id}) |
| | | } |
| | | }, |
| | | cateClick(e) { |