var app = getApp();
var $ = require('../../../../js/util.js');
Page({
  data: {
    list: [],
    page: 1,//当前页码
    param: {},
    //公共提示
    hasMore: false,//无更多数据提示
    dataNull: true//未获取到数据提示
  },
  onLoad: function () {
  },
  onReady: function () {
    //初始化数据
    var self = this;
    app.getUserInfo(function (ret) {
      self.getIndex();
    });
  },
  getIndex: function () {
    var self = this;
    var action = 'c=Member&a=sign_log';
    self.setData({
      param: {
        page: self.data.page,
      }
    })
    app.showLoading('加载中...');
    app.ajaxRequest(action, 'GET', $.ObjectToStr(self.data.param), function (ret) {
      console.log(ret);
      if (ret.status == 1) {
        $.init_page_list(self, ret.data);
      } else if (ret.status == 2) {
        $.init_page_empty_list(self, ret.msg);
      }
    }, true);
  },
  onReachBottom: function () {
    var self = this;
    self.data.page++;
    self.getIndex();
  },
  // gotoDetial: function (event) {
  //   app.HCnavigateTo('../cont/cont?id=' + event.currentTarget.dataset.gid);
  // }
})