| | |
| | | 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({ |