| | |
| | | sortType: 'NORMAL', |
| | | catalogCode: "" |
| | | }, |
| | | attached() { |
| | | attached() { |
| | | this.getCatelist() |
| | | var app = getApp() |
| | | console.log('globalData', app.globalData); |
| | |
| | | } |
| | | }, |
| | | 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(){ |
| | | getCatalogList({ |
| | | catalogCode: 'product_intro' |