my_active.js 1.9 KB
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
   
  },
  getdatalist() {
    let that = this;
    let url = '/index/member_center/joined';
    let head = {
      'XX-Token': wx.getStorageSync('token')
    }
    let params = {}
    app.post(url, params, head).then((res) => {
      console.log(res)
      that.setData({
        activity: res
      })
      // let activity = res.activity;
      // let tem = [];
      // let temactivity = [];
      // for (let i = 0; i < activity.length; i++) {
      //   tem.push(activity[i])
      //   if ((i + 1) != activity.length) {
      //     if ((i + 1) % 2 == 0) {
      //       temactivity.push(tem);
      //       tem = [];
      //     }
      //   } else {
      //     temactivity.push(tem);
      //     tem = [];
      //   }


      // }
      // let dataactivity = that.data.activity;
      // let temdataactivity = dataactivity.concat(temactivity);
      // that.setData({
      //   datalist: res,
      //   activity: temdataactivity,
      //   activity_page: res.activity_page
      // })
    }).catch((err) => {
      console.log(err)
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let that = this;

    that.getdatalist();

  },

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

  },

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

  },

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

  },

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

  },

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

  }
})