jiangping
2024-07-30 0e8cc18ee5d35479d30408851c21e5f4c0fb487a
wechat_staff/pages/discover/discover.js
@@ -20,15 +20,30 @@
  }, 
  
  onShow(){
    console.log('onShow')
    refreshEnjoy(this) 
    this.refreshDatacount()
    let discoverKey = wx.getStorageSync('discoverKey') || ''
    if(discoverKey){
      this.setData({ catalogCode: discoverKey })
      setTimeout(() => {
        wx.setStorageSync('discoverKey', '')
      }, 500)
    }
    }
  },
  refreshDatacount(){
    var child =null;
    if(this.data.catalogCode == 'product_intro'){
      child = this.selectComponent(".disProduct")
    }else if(this.data.catalogCode == 'whole_case'){
      child = this.selectComponent(".disCase")
    }else if(this.data.catalogCode == 'real_case'){
      child = this.selectComponent(".disRealpic")
    }
    // 调用子组件中定义的方法
    if(child){
      child.refreshCount();
    }
  },
  tabsClick(e) {
    const catalogCode = e.currentTarget.dataset.code