detail.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. if (res.data.errcode == 0) {
  46. let datas = res.data.data
  47. for (let i = 0; i < datas.length; i++) {
  48. if (datas[i].status == 0) {
  49. datas[i].status = '待审'
  50. } else if (datas[i].status == 1) {
  51. datas[i].status = '通过'
  52. } else if (datas[i].status == -1) {
  53. datas[i].status = '拒绝'
  54. }
  55. }
  56. that.setData({ jslist: datas });
  57. } else {
  58. wx.showToast({
  59. title: res.data.errmsg,
  60. icon: 'none',
  61. duration: 2000
  62. })
  63. }
  64. }
  65. })
  66. },
  67. fail: res => {
  68. wx.redirectTo({ url: '/pages/login/index', })
  69. }
  70. })
  71. },
  72. // 计算高度
  73. searchHeight: function () {
  74. let frameStyle = this.data.frameStyle;
  75. let client = app.globalData.client;
  76. let infoHeight = client.windowHeight;
  77. // 是否去掉状态栏
  78. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  79. // 是否减去底部菜单
  80. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  81. if (infoHeight) this.setData({ infoHeight: infoHeight })
  82. },
  83. /**
  84. * 生命周期函数--监听页面初次渲染完成
  85. */
  86. onReady: function () {
  87. },
  88. /**
  89. * 生命周期函数--监听页面显示
  90. */
  91. onShow: function () {
  92. },
  93. /**
  94. * 生命周期函数--监听页面隐藏
  95. */
  96. onHide: function () {
  97. },
  98. /**
  99. * 生命周期函数--监听页面卸载
  100. */
  101. onUnload: function () {
  102. },
  103. /**
  104. * 页面相关事件处理函数--监听用户下拉动作
  105. */
  106. onPullDownRefresh: function () {
  107. },
  108. /**
  109. * 页面上拉触底事件的处理函数
  110. */
  111. onReachBottom: function () {
  112. },
  113. /**
  114. * 用户点击右上角分享
  115. */
  116. onShareAppMessage: function () {
  117. }
  118. })