var app = getApp();
var $ = require('../../../../js/util.js');
Page({
  data: {
    info: [],
    aff_config:[],
    //公共提示
    hasMore: false,//无更多数据提示
    dataNull: true//未获取到数据提示
  },
  onLoad: function (options) {//接收上个页面传的参数
    var self = this;
    if (options.invite_key) {
      app.globalData.invite_key = options.invite_key;
    }
  },
  onShow: function () {
    var self = this;
    app.getUserInfo(function (ret) {
      self.setData({
        info: ret,
      });
      self.getIndex();
    });

  },
  getIndex: function () {
    var self = this;
    var action = 'c=Extension&a=member_poster';
    app.showLoading('加载中...');
    app.ajaxRequest(action, 'GET', '', function (ret) {
     // console.log(ret.data);return; 
      if (ret.status == 1) {
        self.setData({
          info: ret.data,
        })
      }
    }, true);
  },
  goToPoster: function (event) {
    app.HCredirectTo('../member_poster/member_poster');
  },
  goToExtensionList: function (event) {
    app.HCredirectTo('../invite_list/invite_list');
  },
  goToExtension: function (event) {
    app.HCredirectTo('../list/list');
  },
})