lll
liukangdong
2024-08-07 138db89b3193d60850e203e1847e2f91d2b00ebc
wechat_jiaxuan/components/disRealpic/index.js
@@ -15,6 +15,8 @@
    menuButtonInfo: Object
  },
  data: {
    acVid: '',
    viewIdList: [],
    // 动画
    showTouch: true,
    animationData: {},
@@ -77,11 +79,11 @@
    },
    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 })
@@ -186,18 +188,31 @@
      }
    },
    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
@@ -239,14 +254,7 @@
      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({