detail.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. idjie: '',
  10. ids: '',
  11. src: '/image/adimges.jpg',
  12. src1: '/image/head1.png',
  13. frameStyle: { useTop: false, name: '团队审核', leftArrow: true, useBar: false },
  14. // 主体高度
  15. infoHeight: '',
  16. list: [],
  17. lists: [],
  18. },
  19. watchLogin: function () {
  20. var that = this;
  21. let id = that.ids
  22. wx.getStorage({
  23. key: 'token',
  24. success: res => {
  25. //查询数据
  26. wx.request({
  27. url: `${app.globalData.publicUrl}/courtAdmin/api/team/` + id, //接口地址
  28. method: 'get',
  29. data: '',
  30. success(res) {
  31. if (res.data.errcode == 0) {
  32. let datas = res.data.data
  33. console.log('单', datas);
  34. that.setData({
  35. list: datas,
  36. });
  37. } else {
  38. wx.showToast({
  39. title: res.data.errmsg,
  40. icon: 'none',
  41. duration: 2000
  42. })
  43. }
  44. }
  45. })
  46. },
  47. fail: res => {
  48. return wx.redirectTo({ url: '/pages/login/index', })
  49. }
  50. })
  51. },
  52. back: function () {
  53. wx.navigateBack({ url: '/pages/home/index' })
  54. },
  55. hui: function () {
  56. wx.navigateBack({ url: '/pages/manage/index' })
  57. },
  58. out: function () {
  59. var that = this;
  60. let id = that.idjie
  61. debugger
  62. wx.showModal({
  63. title: '',
  64. content: '是否确认解散团队',
  65. success(res) {
  66. if (res.confirm) {
  67. wx.request({
  68. url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + id, //接口地址
  69. method: 'DELETE',
  70. data: '',
  71. success(res) {
  72. if (res.data.errcode == 0) {
  73. wx.showToast({ title: `解散团队成功`, icon: 'success', duration: 2000 }) //创建成功提示
  74. return wx.redirectTo({ url: '/pages/manage/index' })// 跳转页面
  75. } else {
  76. wx.showToast({
  77. title: res.data.errmsg,
  78. icon: 'none',
  79. duration: 2000
  80. })
  81. }
  82. }
  83. })
  84. } else if (res.cancel) {
  85. console.log('用户点击取消')
  86. }
  87. }
  88. })
  89. },
  90. /**
  91. * 生命周期函数--监听页面加载
  92. */
  93. onLoad: function (options) {
  94. var myObject = JSON.parse(decodeURIComponent(options.obj));
  95. this.ids = myObject.name;
  96. this.idjie = myObject.id;
  97. // 计算高度
  98. this.searchHeight()
  99. // 监听用户是否登录
  100. this.watchLogin();
  101. },
  102. // 计算高度
  103. searchHeight: function () {
  104. let frameStyle = this.data.frameStyle;
  105. let client = app.globalData.client;
  106. // 减去状态栏
  107. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  108. // 是否减去底部菜单
  109. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  110. if (infoHeight) this.setData({ infoHeight: infoHeight })
  111. },
  112. /**
  113. * 生命周期函数--监听页面初次渲染完成
  114. */
  115. onReady: function () {
  116. },
  117. /**
  118. * 生命周期函数--监听页面显示
  119. */
  120. onShow: function () {
  121. },
  122. /**
  123. * 生命周期函数--监听页面隐藏
  124. */
  125. onHide: function () {
  126. },
  127. /**
  128. * 生命周期函数--监听页面卸载
  129. */
  130. onUnload: function () {
  131. },
  132. /**
  133. * 页面相关事件处理函数--监听用户下拉动作
  134. */
  135. onPullDownRefresh: function () {
  136. },
  137. /**
  138. * 页面上拉触底事件的处理函数
  139. */
  140. onReachBottom: function () {
  141. },
  142. /**
  143. * 用户点击右上角分享
  144. */
  145. onShareAppMessage: function () {
  146. }
  147. })