var app = getApp();
var $ = require('../../../../js/util.js');
Page({
  data: {
    data: [],
    param: {
      id:0
    },
    hasMore: false,//无更多数据提示
    dataNull: true//未获取到数据提示
  },
  onLoad: function (options) {//接收上个页面传的参数
    if (options.invite_key) {
      app.globalData.invite_key = options.invite_key;
    }
    if (options.id){
      this.setData({
        param: {
          id: options.id
        },
        id: options.id
      });
    }
  },
  onReady: function () {
    //初始化数据
    var self = this;
    app.getUserInfo(function (ret) {
      self.getIndex();
    });
  },
  getIndex: function () {
    var self = this;
    var action = 'c=Member&a=money_change_dec';
    app.showLoading('加载中...');
    app.ajaxRequest(action, 'GET', $.ObjectToStr(self.data.param), function (ret) {
      if (ret.status == 1) {
        self.setData({
          data: ret.data
        });
      } else{
        app.HCerror(ret.msg); 
      }
    }, true);
  },
})