const app = getApp();
Page({
  data: {
    menuList: [
      { icon: '/static/image/me-1.png', title: '活动规则' },
      { icon: '/static/image/me-2.png', title: '免责声明' },
      { icon: '/static/image/me-3.png', title: '报名记录' },
      { icon: '/static/image/me-4.png', title: '优惠券' },
      { icon: '/static/image/me-5.png', title: '设置' },
      { icon: '/static/image/me-6.png', title: '联系客服' }
    ],
    userInfo: {}
  },
  goPage(e){
    const index = e.currentTarget.dataset.index;
    if(index == 0){
      wx.navigateTo({
        url: `/pages/rules/rules?type=${index}`
      })
    }else if(index == 1){
      wx.navigateTo({
        url: `/pages/rules/rules?type=${index}`
      })
    }else if(index == 4){
      wx.navigateTo({
        url: `/pages/setting/setting`
      })
    }else if(index == 2){
      wx.navigateTo({
        url: `/pages/registrationRecords/registrationRecords`
      })
    }
  },
  onLoad(options) {
    this.setData({
      userInfo: app.globalData.userInfo
    });
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({ selected: 2 })
    }
    this.setData({
      userInfo: app.globalData.userInfo
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})