activeDetail.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. const app = require('../../utils/util.js');
  2. const tool = require('../../utils/tool.js');
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. },
  9. baoming() {
  10. // /wx/actives/{openId}/{activeId}/enter
  11. wx.request({
  12. url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
  13. method: "get",
  14. success: (res) => {
  15. if (res.data.code == 0) {
  16. console.log(res, '报名成功了')
  17. wx.redirectTo({
  18. url: '/pages/registrationSuccess/registrationSuccess',
  19. })
  20. }
  21. }
  22. })
  23. },
  24. /**
  25. * 生命周期函数--监听页面加载
  26. */
  27. async onLoad(options) {
  28. console.log(options)
  29. const getOpenid = await tool.openidStatus();
  30. this.setData({
  31. openid: getOpenid[0],
  32. sessionkey: getOpenid[1]
  33. })
  34. wx.request({
  35. url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + options.id + '/detail',
  36. method: "get",
  37. success: (res) => {
  38. if (res.data.code == 0) {
  39. console.log(res, '查询活动详情')
  40. this.setData({
  41. id:res.data.activeRoll.id,
  42. actualCount:res.data.activeRoll.actualCount,
  43. planCount:res.data.activeRoll.planCount,
  44. activeStart:res.data.activeRoll.activeStart,
  45. address:res.data.activeRoll.address,
  46. remark:res.data.activeRoll.remark,
  47. openId:options.openId
  48. })
  49. console.log(this.data.openId)
  50. }
  51. }
  52. })
  53. },
  54. /**
  55. * 生命周期函数--监听页面初次渲染完成
  56. */
  57. onReady: function () {
  58. },
  59. /**
  60. * 生命周期函数--监听页面显示
  61. */
  62. onShow: function () {
  63. },
  64. /**
  65. * 生命周期函数--监听页面隐藏
  66. */
  67. onHide: function () {
  68. },
  69. /**
  70. * 生命周期函数--监听页面卸载
  71. */
  72. onUnload: function () {
  73. },
  74. /**
  75. * 页面相关事件处理函数--监听用户下拉动作
  76. */
  77. onPullDownRefresh: function () {
  78. },
  79. /**
  80. * 页面上拉触底事件的处理函数
  81. */
  82. onReachBottom: function () {
  83. },
  84. /**
  85. * 用户点击右上角分享
  86. */
  87. onShareAppMessage: function () {
  88. }
  89. })