operating.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // pages/mine/wxml/operating/operating.js
  2. var app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. record: []
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad: function (options) {
  14. this.lotteryRecord()
  15. },
  16. /**
  17. * 生命周期函数--监听页面显示
  18. */
  19. onShow: function () {
  20. },
  21. /**
  22. * 生命周期函数--监听页面隐藏
  23. */
  24. onHide: function () {
  25. },
  26. /**
  27. * 生命周期函数--监听页面卸载
  28. */
  29. onUnload: function () {
  30. },
  31. resetLottery: function (e) {
  32. wx.request({
  33. url: app.globalData.prodUrl + 'web-pm/wx/pm/update_lottery_count',
  34. data: '',
  35. header: { 'ydw-token': wx.getStorageSync('key').ydw_token},
  36. method: 'GET',
  37. dataType: 'json',
  38. responseType: 'text',
  39. success: function(res) {
  40. //console.log(res)
  41. },
  42. fail: function(res) {},
  43. complete: function(res) {},
  44. })
  45. },
  46. lotteryRecord: function () {
  47. let _this = this;
  48. wx.request({
  49. url: app.globalData.prodUrl + 'web-pm/wx/pm/list_lottery_raffle_count',
  50. data: '',
  51. header: { 'ydw-token': wx.getStorageSync('key').ydw_token },
  52. method: 'GET',
  53. dataType: 'json',
  54. responseType: 'text',
  55. success: function(res) {
  56. //console.log(res)
  57. _this.setData({
  58. record: res.data.data
  59. })
  60. },
  61. fail: function(res) {},
  62. complete: function(res) {},
  63. })
  64. }
  65. })