myActive.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. const app = require('../../utils/util.js');
  2. const tool = require('../../utils/tool.js');
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. arr: []
  9. },
  10. goActive(e){
  11. console.log(e.currentTarget.dataset.id)
  12. // wx.redirectTo({
  13. // url: '/pages/onSiteActivity/onSiteActivity?id='+e.currentTarget.dataset.id,
  14. // })
  15. },
  16. /**
  17. * 生命周期函数--监听页面加载
  18. */
  19. async onLoad (options) {
  20. const getOpenid = await tool.openidStatus();
  21. this.setData({
  22. openid: getOpenid[0],
  23. sessionkey: getOpenid[1]
  24. })
  25. wx.request({
  26. url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/myActive',
  27. method: "get",
  28. success: (res) => {
  29. console.log(res)
  30. if(res.data.code==0){
  31. this.setData({
  32. arr: res.data.actives
  33. })
  34. }
  35. }
  36. })
  37. },
  38. /**
  39. * 生命周期函数--监听页面初次渲染完成
  40. */
  41. onReady: function () {
  42. },
  43. /**
  44. * 生命周期函数--监听页面显示
  45. */
  46. onShow: function () {
  47. },
  48. /**
  49. * 生命周期函数--监听页面隐藏
  50. */
  51. onHide: function () {
  52. },
  53. /**
  54. * 生命周期函数--监听页面卸载
  55. */
  56. onUnload: function () {
  57. },
  58. /**
  59. * 页面相关事件处理函数--监听用户下拉动作
  60. */
  61. onPullDownRefresh: function () {
  62. },
  63. /**
  64. * 页面上拉触底事件的处理函数
  65. */
  66. onReachBottom: function () {
  67. },
  68. /**
  69. * 用户点击右上角分享
  70. */
  71. onShareAppMessage: function () {
  72. }
  73. })