// pages/mine/wxml/operating/operating.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    record: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.lotteryRecord()
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },
  resetLottery: function (e) {
    wx.request({
      url: app.globalData.prodUrl + 'web-pm/wx/pm/update_lottery_count',
      data: '',
      header: { 'ydw-token': wx.getStorageSync('key').ydw_token},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function(res) {
        //console.log(res)
      },
      fail: function(res) {},
      complete: function(res) {},
    })
  },
  lotteryRecord: function () {
    let _this = this;
    wx.request({
      url: app.globalData.prodUrl + 'web-pm/wx/pm/list_lottery_raffle_count',
      data: '',
      header: { 'ydw-token': wx.getStorageSync('key').ydw_token },
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: function(res) {
        //console.log(res)
        _this.setData({
          record: res.data.data
        })
      },
      fail: function(res) {},
      complete: function(res) {},
    })
  }
})