var app = getApp()
Page({
  data: {
    index:0,
    arr:[],
    arr1:[],
    arr2:[],
    img:app.globalData.imgUrl
  },
  onLoad: function (options) {
    var that = this;
    wx.showLoading({
      title: '加载中...',
      mask:true
    })
    app.request('/coupon?status=1', '', 'GET').then(res => {
      //未使用
      console.log(res)
      that.setData({arr:res.data.data})
    })
    app.request('/coupon?status=0', '', 'GET').then(res => {
      //已过期
      console.log(res)
      that.setData({arr1:res.data.data})
    })
    app.request('/coupon?status=2', '', 'GET').then(res => {
      //已使用
      console.log(res)
      that.setData({arr2:res.data.data})
      wx.hideLoading()
    })
  },
  select:function(e){
    // console.log(e)
    this.setData({index:e.currentTarget.dataset.index})
  },
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },
  onUnload: function () {

  },
  onPullDownRefresh: function () {

  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  }
})