detail.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. //解散申请
  16. apply: function () {
  17. wx.navigateTo({
  18. url: `/pages/dissolution/index?id=` + this.ids,
  19. })
  20. },
  21. back: function () {
  22. wx.navigateBack({ url: '/pages/me/index' })
  23. },
  24. /**
  25. * 生命周期函数--监听页面加载
  26. */
  27. onLoad: function (options) {
  28. this.ids =options.id;
  29. // 计算高度
  30. this.searchHeight();
  31. // 监听用户是否登录
  32. this.watchLogin();
  33. },
  34. // 监听用户是否登录
  35. watchLogin: function () {
  36. const that = this;
  37. var team_id = that.ids;
  38. wx.getStorage({
  39. key: 'token',
  40. success: res => {
  41. //解散团队数据
  42. wx.request({
  43. url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply`, //接口地址
  44. method: 'get',
  45. data: {
  46. "team_id":team_id
  47. },
  48. success(res) {
  49. if (res.data.errcode == 0) {
  50. let datas = res.data.data
  51. for (let i = 0; i < datas.length; i++) {
  52. if (datas[i].status == 0) {
  53. datas[i].status = '待审'
  54. } else if (datas[i].status == 1) {
  55. datas[i].status = '通过'
  56. } else if (datas[i].status == -1) {
  57. datas[i].status = '拒绝'
  58. }
  59. }
  60. that.setData({
  61. jslist: datas,
  62. });
  63. } else {
  64. wx.showToast({
  65. title: res.data.errmsg,
  66. icon: 'none',
  67. duration: 2000
  68. })
  69. }
  70. }
  71. })
  72. },
  73. fail: res => {
  74. wx.redirectTo({ url: '/pages/login/index', })
  75. }
  76. })
  77. },
  78. // 计算高度
  79. searchHeight: function () {
  80. let frameStyle = this.data.frameStyle;
  81. let client = app.globalData.client;
  82. let infoHeight = client.windowHeight;
  83. // 是否去掉状态栏
  84. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  85. // 是否减去底部菜单
  86. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  87. if (infoHeight) this.setData({ infoHeight: infoHeight })
  88. },
  89. /**
  90. * 生命周期函数--监听页面初次渲染完成
  91. */
  92. onReady: function () {
  93. },
  94. /**
  95. * 生命周期函数--监听页面显示
  96. */
  97. onShow: function () {
  98. },
  99. /**
  100. * 生命周期函数--监听页面隐藏
  101. */
  102. onHide: function () {
  103. },
  104. /**
  105. * 生命周期函数--监听页面卸载
  106. */
  107. onUnload: function () {
  108. },
  109. /**
  110. * 页面相关事件处理函数--监听用户下拉动作
  111. */
  112. onPullDownRefresh: function () {
  113. },
  114. /**
  115. * 页面上拉触底事件的处理函数
  116. */
  117. onReachBottom: function () {
  118. },
  119. /**
  120. * 用户点击右上角分享
  121. */
  122. onShareAppMessage: function () {
  123. }
  124. })