index.js 997 Bytes
// pages/tab/select/index.js
// import { strategyList } from "./constant/constant";
Page({
  /**
   * 页面的初始数据
   */
  data: {
    strategyList: [],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getStrategyList();
    this.shareTitle = "攻略专区"
  },

  navbarReady(e) {
    let {
      height
    } = e.detail
    this.setData({
      user_box_style: `padding-top:${height + 15}px`
    })
  },

  getStrategyList() {
    wx.p.api.strategyApi.getStrategyList({
      pageNum: 1,
      pageSize: 100
    }).then(res => {
      this.setData({
        strategyList: res.list
      })
    });
  },
  selectStrategy(e) {
    const {id} = e.currentTarget.dataset.item
    wx.p.router.go('/packageStrategy/pages/strategyDetail/index', {
      id,
      notIntercept: true
    })
  },
  onShareAppMessage(){},
  onShow(){
    const FIRST = wx.p.storage.get('first_enter_miniprograme')
    this.setData({
      showStore:!FIRST
    })
  }
});