aa
jiangping
2024-08-02 7dc29ed74ebaa8a0e66f68264d9a13f95dc3af21
wechat_staff/components/disRealpic/index.js
@@ -18,13 +18,35 @@
    pageNum: 1,
    pageSize: 10,
    query: '',
    sortType: 'NORMAL',
    sortType: '',
    catalogCode: 'real_case'
  },
  attached() {
    this.getCatelist()
  },
  methods: {
    refreshCount(){
      let  temData = wx.getStorageSync('conentCountTemp')
      if(temData && this.data.dataList){
          var dataList =this.data.dataList;
          dataList.forEach(item =>{
              if(item.id+'' == temData.id+'' ){
                  item.viewCount = (item.viewCount ||0)+1;
                  if( item.isCollection != temData.isCollection){
                    if(item.isCollection){
                        item.collectCount = (item.collectCount || 0)-1
                        item.collectCount  =   item.collectCount >=0?  item.collectCount :0;
                    } else{
                        item.collectCount = (item.collectCount || 0)+1
                    }
                    item.isCollection = temData.isCollection
                }
              }
          })
          this.setData({dataList:dataList})
           wx.setStorageSync('conentCountTemp',null)
      }
    },
    getCatelist(){
      const { catalogCode } = this.data
      getCataLogTagList({
@@ -76,7 +98,7 @@
      let videoPlay = this.selectComponent('.videoPlay'); 
      if(videoPlay){ 
        videoPlay.startPlayVideo(videourl,this );
      }
      }
    },
    priviewFull(e){
      const item = e.currentTarget.dataset.item
@@ -109,9 +131,10 @@
      const item = e.currentTarget.dataset.item
      console.log('item', item);
      if(item.openType == 'video'){
        wx.previewMedia({
          sources: [{ url: item.openContent, type: 'video' }]
        })
        let videoPlay = this.selectComponent('.videoPlay');
        if(videoPlay){
          videoPlay.startPlayVideo(item.openContent,this );
        }
      }
      if(item.openType == 'link'){
        wx.navigateTo({
@@ -134,28 +157,19 @@
      }
      const code = e.currentTarget.dataset.code
      const paramIndex = e.currentTarget.dataset.index
      const { cateList, tagCodes, activeParam, activeIndex } = this.data
      const index = tagCodes.indexOf(code)
      if(index === -1){
        // if(activeParam && activeParam.length > 0){
        //   activeParam.forEach(item => {
        //     const indexTemp = tagCodes.indexOf(item.labelValueCode)
        //     if(indexTemp > -1){
        //       tagCodes.splice(indexTemp, 1)
        //     }
        //   })
        // }
        // tagCodes.push(code)
      const { cateList, tagCodes, activeParam, activeIndex } = this.data
      if(   cateList[activeIndex].tempParamIndex==null ||     cateList[activeIndex].tempParamIndex != paramIndex){
        cateList[activeIndex].tempParamIndex = paramIndex
        cateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName
        cateList[activeIndex].tempParamCode = code
        console.log(code)
      }else{
        cateList[activeIndex].tempParamIndex = -1
        cateList[activeIndex].tempParamName = null
        cateList[activeIndex].tempParamCode = null
        cateList[activeIndex].tempParamCode = null
        console.log(1)
      }
      this.setData({  cateList })
      this.setData({  cateList })
    },
    cancelParam() {
      const { cateList } = this.data