jiangping
2024-07-29 d9a89d83c2048a964f16ca179feb2b7f21b9d33a
wechat_staff/pages/discover/discover.js
@@ -1,4 +1,6 @@
// pages/discover/discover.js
import { getCataLogTagList, getCatalogList,refreshEnjoy } from '../../api/index'
const { HYEventBus } = require('hy-event-store')
const eventBus = new HYEventBus()
Page({
  /**
@@ -6,32 +8,36 @@
   */
  data: {
    menuButtonInfo: {},
    activeTabs: '0'
  },
    catalogCode: "product_intro",
    activeCate: '',
  /**
   * 生命周期函数--监听页面加载
   */
    height: 0,
    top: 0,
  },
  onLoad(options) {
    let menuButtonInfo = wx.getMenuButtonBoundingClientRect();
    this.setData({menuButtonInfo})
    console.log('WindowInfo', menuButtonInfo);
  },
  },
  onShow(){
    console.log('onShow')
    refreshEnjoy(this)
    let discoverKey = wx.getStorageSync('discoverKey') || ''
    if(discoverKey){
      this.setData({ catalogCode: discoverKey })
      setTimeout(() => {
        wx.setStorageSync('discoverKey', '')
      }, 500)
    }
  },
  tabsClick(e) {
    const activeTabs = e.currentTarget.dataset.tab
    this.setData({activeTabs})
    const catalogCode = e.currentTarget.dataset.code
    this.setData({catalogCode})
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },