| | |
| | | menuButtonInfo: Object |
| | | }, |
| | | data: { |
| | | acVid: '', |
| | | viewIdList: [], |
| | | // 动画 |
| | | showTouch: true, |
| | | animationData: {}, |
| | |
| | | }, |
| | | touchmove(e) { |
| | | var touchMove = e.detail.scrollTop; |
| | | if (touchDot - touchMove > 16) { |
| | | if(touchMove - touchDot > 24){ |
| | | touchDot = touchMove |
| | | this.fadeOut(); |
| | | } |
| | | if (touchDot - touchMove > 16) { |
| | | if(touchDot - touchMove > 24){ |
| | | touchDot = touchMove |
| | | setTimeout(() => { |
| | | this.setData({ showTouch: true }) |
| | |
| | | } |
| | | }, |
| | | videoClick(e) { |
| | | const { |
| | | videourl |
| | | } = e.currentTarget.dataset |
| | | |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if (videoPlay) { |
| | | videoPlay.startPlayVideo(videourl, this); |
| | | const { id } = e.currentTarget.dataset |
| | | const { dataList, acVid, viewIdList } = this.data |
| | | const index = viewIdList.findIndex(i => i === 'video' + id) |
| | | if(acVid){ |
| | | if('video' + id != acVid){ |
| | | wx.createVideoContext(acVid, this).pause() |
| | | wx.createVideoContext('video' + id, this).play() |
| | | this.setData({ acVid: 'video' + id }) |
| | | } |
| | | }else{ |
| | | this.setData({ acVid: 'video' + id }) |
| | | wx.createVideoContext('video' + id, this).play() |
| | | } |
| | | console.log(videourl + "-------------------------------------") |
| | | // wx.previewMedia({ |
| | | // sources: [{ url: videourl, type: 'video' }] |
| | | // }) |
| | | dataList.forEach(ite => { |
| | | if(id === ite.id && index === -1){ |
| | | ite.viewCount += 1 |
| | | viewIdList.push('video' + id) |
| | | actionDo({ |
| | | actionType: 'view', |
| | | id: id |
| | | }) |
| | | this.setData({ viewIdList }) |
| | | } |
| | | }) |
| | | this.setData({ dataList }) |
| | | }, |
| | | priviewFull(e) { |
| | | const item = e.currentTarget.dataset.item |
| | |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | if (item.openType == 'video') { |
| | | |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if (videoPlay) { |
| | | videoPlay.startPlayVideo(item.openContent, this); |
| | | } |
| | | // wx.previewMedia({ |
| | | // sources: [{ url: item.openContent, type: 'video' }] |
| | | // }) |
| | | return |
| | | } |
| | | if (item.openType == 'link') { |
| | | wx.navigateTo({ |