detail.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. frameStyle: { useTop: true, name: '申请解散', leftArrow: true, useBar: false },
  10. // 主体高度
  11. infoHeight: '',
  12. ids: '',
  13. jslist: []
  14. },
  15. back: function () {
  16. wx.navigateBack({ url: '/pages/me/index' })
  17. },
  18. //解散申请
  19. apply: function () {
  20. wx.navigateTo({url: `/pages/dissolution/index?id=${this.data.ids}`,})
  21. },
  22. /**
  23. * 生命周期函数--监听页面加载
  24. */
  25. onLoad: function (options) {
  26. this.setData({ ids: options.id })
  27. // 计算高度
  28. this.searchHeight();
  29. // 监听用户是否登录
  30. this.watchLogin();
  31. },
  32. // 监听用户是否登录
  33. watchLogin: function () {
  34. const that = this;
  35. var team_id = that.data.ids;
  36. wx.getStorage({
  37. key: 'token',
  38. success: res => {
  39. //解散团队数据
  40. wx.request({
  41. url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply`,
  42. method: 'get',
  43. data: { "team_id": team_id },
  44. success(res) {
  45. that.setData({ jslist: res.data.data });
  46. }
  47. })
  48. },
  49. fail: res => {
  50. wx.redirectTo({ url: '/pages/login/index', })
  51. }
  52. })
  53. },
  54. // 计算高度
  55. searchHeight: function () {
  56. let frameStyle = this.data.frameStyle;
  57. let client = app.globalData.client;
  58. let infoHeight = client.windowHeight;
  59. // 是否去掉状态栏
  60. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  61. // 是否减去底部菜单
  62. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  63. if (infoHeight) this.setData({ infoHeight: infoHeight })
  64. },
  65. /**
  66. * 生命周期函数--监听页面初次渲染完成
  67. */
  68. onReady: function () {
  69. },
  70. /**
  71. * 生命周期函数--监听页面显示
  72. */
  73. onShow: function () {
  74. },
  75. /**
  76. * 生命周期函数--监听页面隐藏
  77. */
  78. onHide: function () {
  79. },
  80. /**
  81. * 生命周期函数--监听页面卸载
  82. */
  83. onUnload: function () {
  84. },
  85. /**
  86. * 页面相关事件处理函数--监听用户下拉动作
  87. */
  88. onPullDownRefresh: function () {
  89. },
  90. /**
  91. * 页面上拉触底事件的处理函数
  92. */
  93. onReachBottom: function () {
  94. },
  95. /**
  96. * 用户点击右上角分享
  97. */
  98. onShareAppMessage: function () {
  99. }
  100. })