//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    dataList:[],
  },
  //事件处理函数
  onLoad: function () {
    if (app.globalData.openId){
      this.getDataList();
    }else{
      app.globalData.openidSuccessFuc = this.getDataList;
    }
    
  },
  getDataList:function(){
    app.wxRequest(app.globalData.httpUrl + 'couponsell/list', {}, e => {
      // console.log(e)
      if (e.code == 200) {
        this.setData({
          dataList:e.data
        })
      }
    }, this)
  },
  skipPage:function(e){
    // console.log(e)
    var index = e.currentTarget.dataset.index
    wx.navigateTo({
      url: '../buyTicket/buyTicket?index=' + index
    })
  },

})
