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