activeDetail.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. const app = require('../../utils/util.js');
  2. const tool = require('../../utils/tool.js');
  3. Page({
  4. data: {},
  5. baoming() {
  6. tool.isLogin().then(result => {
  7. console.log('我登录成功了')
  8. tool.isFinishInfo().then(result2 => {
  9. tool.isFinishTargetInfo().then(redult3 => {}).catch(err => {
  10. wx.showModal({
  11. title: '您还未完善择偶信息',
  12. showCancel: false,
  13. success(res) {
  14. if (res.confirm) {
  15. wx.switchTab({
  16. url: '/pages/targetInfo/targetInfo',
  17. })
  18. }
  19. }
  20. })
  21. return false;
  22. })
  23. }).catch(err => {
  24. wx.showModal({
  25. title: '您还未完善个人信息',
  26. showCancel: false,
  27. success(res) {
  28. if (res.confirm) {
  29. wx.switchTab({
  30. url: '/pages/personInfo/personInfo',
  31. })
  32. }
  33. }
  34. })
  35. return false;
  36. })
  37. }).catch(err => {
  38. wx.showModal({
  39. title: '您还未登录',
  40. showCancel: false,
  41. success(res) {
  42. if (res.confirm) {
  43. wx.switchTab({
  44. url: '/pages/personal/personal',
  45. })
  46. }
  47. }
  48. })
  49. return false;
  50. })
  51. wx.request({
  52. url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
  53. method: "get",
  54. success: (res) => {
  55. if (res.data.code == 0) {
  56. console.log(res, '报名成功了')
  57. // wx.redirectTo({
  58. // url: '/pages/registrationSuccess/registrationSuccess',
  59. // })
  60. }else{
  61. wx.requestSubscribeMessage({
  62. tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
  63. success(res) {
  64. console.log(res)
  65. }
  66. })
  67. }
  68. }
  69. })
  70. },
  71. async onLoad(options) {
  72. tool.openidStatus().then(result => {
  73. this.setData({
  74. openid: result[0],
  75. sessionkey: result[1]
  76. })
  77. this.getActivies(options.id);
  78. })
  79. },
  80. getActivies(id2) {
  81. wx.request({
  82. url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + id2 + '/detail',
  83. method: "get",
  84. success: (res) => {
  85. if (res.data.code == 0) {
  86. console.log(res, '查询活动详情')
  87. this.setData({
  88. id: res.data.activeRoll.id,
  89. actualCount: res.data.activeRoll.actualCount,
  90. planCount: res.data.activeRoll.planCount,
  91. activeStart: res.data.activeRoll.activeStart,
  92. address: res.data.activeRoll.address,
  93. remark: res.data.activeRoll.remark,
  94. openId: id2
  95. })
  96. console.log(this.data.openId)
  97. }
  98. }
  99. })
  100. },
  101. /**
  102. * 生命周期函数--监听页面初次渲染完成
  103. */
  104. onReady: function () {
  105. },
  106. /**
  107. * 生命周期函数--监听页面显示
  108. */
  109. onShow: function () {
  110. },
  111. /**
  112. * 生命周期函数--监听页面隐藏
  113. */
  114. onHide: function () {
  115. },
  116. /**
  117. * 生命周期函数--监听页面卸载
  118. */
  119. onUnload: function () {
  120. },
  121. /**
  122. * 页面相关事件处理函数--监听用户下拉动作
  123. */
  124. onPullDownRefresh: function () {
  125. },
  126. /**
  127. * 页面上拉触底事件的处理函数
  128. */
  129. onReachBottom: function () {
  130. },
  131. /**
  132. * 用户点击右上角分享
  133. */
  134. onShareAppMessage: function () {
  135. }
  136. })