InfoType.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. const app = require('../../utils/util.js');
  2. const tool = require('../../utils/tool.js');
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. // status:true
  9. },
  10. goMyinfo() {
  11. if (!this.data.status) {
  12. wx.navigateTo({
  13. url: '/pages/personInfo/personInfo',
  14. })
  15. } else {
  16. wx.showModal({
  17. title: '您当前有正在参加的活动,暂时不可修改个人信息哦',
  18. showCancel: false
  19. })
  20. }
  21. },
  22. goMyinfoDetail() {
  23. if (!this.data.status) {
  24. wx.navigateTo({
  25. url: '/pages/personInfoDetail/personInfoDetail',
  26. })
  27. } else {
  28. wx.showModal({
  29. title: '您当前有正在参加的活动,暂时不可修改个人信息哦',
  30. showCancel: false
  31. })
  32. }
  33. },
  34. goMyTargetInfo() {
  35. if (!this.data.status) {
  36. wx.navigateTo({
  37. url: '/pages/targetInfo/targetInfo',
  38. })
  39. } else {
  40. wx.showModal({
  41. title: '您当前有正在参加的活动,暂时不可修改目标信息哦',
  42. showCancel: false
  43. })
  44. }
  45. },
  46. getActivies() {
  47. wx.request({
  48. url: app.globalData.publicUrl + '/wx/member/' + this.data.openid + '/myActive',
  49. method: "get",
  50. success: (res) => {
  51. console.log(res)
  52. if (res.data.code == 0) {
  53. this.setData({
  54. arr: res.data.actives
  55. })
  56. for (let i = 0; i < res.data.actives.length; i++) {
  57. if (res.data.actives[i].activeStatus == 1) {
  58. this.setData({
  59. status: false
  60. })
  61. }
  62. }
  63. }
  64. }
  65. })
  66. },
  67. /**
  68. * 生命周期函数--监听页面加载
  69. */
  70. onLoad: function (options) {
  71. tool.openidStatus().then(result => {
  72. this.setData({
  73. openid: result[0],
  74. sessionkey: result[1]
  75. })
  76. this.getActivies();
  77. })
  78. },
  79. /**
  80. * 生命周期函数--监听页面初次渲染完成
  81. */
  82. onReady: function () {
  83. },
  84. /**
  85. * 生命周期函数--监听页面显示
  86. */
  87. onShow: function () {
  88. },
  89. /**
  90. * 生命周期函数--监听页面隐藏
  91. */
  92. onHide: function () {
  93. },
  94. /**
  95. * 生命周期函数--监听页面卸载
  96. */
  97. onUnload: function () {
  98. },
  99. /**
  100. * 页面相关事件处理函数--监听用户下拉动作
  101. */
  102. onPullDownRefresh: function () {
  103. },
  104. /**
  105. * 页面上拉触底事件的处理函数
  106. */
  107. onReachBottom: function () {
  108. },
  109. /**
  110. * 用户点击右上角分享
  111. */
  112. onShareAppMessage: function () {
  113. }
  114. })