detail.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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: false, name: '团队审核', leftArrow: true, useBar: false },
  10. team_id: '',
  11. ids: '',
  12. src: '/image/adimges.jpg',
  13. src1: '/image/head1.png',
  14. // 主体高度
  15. infoHeight: '',
  16. teamlist: [],
  17. form: [],
  18. },
  19. back: function () {
  20. wx.navigateBack({ url: '/pages/home/index' })
  21. },
  22. //点击驳回
  23. hui: function () {
  24. var that = this;
  25. let id = that.team_id
  26. wx.showModal({
  27. title: '',
  28. content: '是否驳回',
  29. success(res) {
  30. if (res.confirm) {
  31. wx.request({
  32. url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/${id}`, //接口地址
  33. method: 'post',
  34. data: {
  35. "status": "-1"
  36. },
  37. success(res) {
  38. if (res.data.errcode == 0) {
  39. wx.showToast({ title: `修改团队状态拒绝`, icon: 'success', duration: 2000 }) //创建成功提示
  40. // return wx.redirectTo({ url: '/pages/manage/index' })// 跳转页面
  41. } else {
  42. wx.showToast({
  43. title: res.data.errmsg,
  44. icon: 'none',
  45. duration: 2000
  46. })
  47. }
  48. }
  49. })
  50. } else if (res.cancel) {
  51. }
  52. }
  53. })
  54. },
  55. //点击通过
  56. out: function () {
  57. var that = this;
  58. let id = that.team_id
  59. wx.showModal({
  60. title: '',
  61. content: '是否确认',
  62. success(res) {
  63. if (res.confirm) {
  64. wx.request({
  65. url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/${id}`, //接口地址
  66. method: 'post',
  67. data: {
  68. "status": "1"
  69. },
  70. success(res) {
  71. if (res.data.errcode == 0) {
  72. wx.showToast({ title: `修改团队状态成功`, icon: 'success', duration: 2000 }) //创建成功提示
  73. // return wx.redirectTo({ url: '/pages/manage/index' })// 跳转页面
  74. } else {
  75. wx.showToast({
  76. title: res.data.errmsg,
  77. icon: 'none',
  78. duration: 2000
  79. })
  80. }
  81. }
  82. })
  83. } else if (res.cancel) {
  84. }
  85. }
  86. })
  87. },
  88. /**
  89. * 生命周期函数--监听页面加载
  90. */
  91. onLoad: function (options) {
  92. var myObject = JSON.parse(decodeURIComponent(options.obj));
  93. this.ids = myObject.name;
  94. this.team_id = myObject.id;
  95. // 计算高度
  96. this.searchHeight()
  97. // 监听用户是否登录
  98. this.watchLogin();
  99. },
  100. //验证用户是否登录
  101. watchLogin: function () {
  102. var that = this;
  103. let id = that.ids;
  104. let ids = that.team_id;
  105. wx.getStorage({
  106. key: 'token',
  107. success: res => {
  108. //查询数据
  109. wx.request({
  110. url: `${app.globalData.publicUrl}/courtAdmin/api/team/` + id, //接口地址
  111. method: 'get',
  112. data: '',
  113. success(res) {
  114. if (res.data.errcode == 0) {
  115. that.setData({
  116. teamlist: res.data.data,
  117. });
  118. } else {
  119. wx.showToast({
  120. title: res.data.errmsg,
  121. icon: 'none',
  122. duration: 2000
  123. })
  124. }
  125. }
  126. })
  127. //解散团队数据
  128. wx.request({
  129. url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + ids, //接口地址
  130. method: 'get',
  131. data: {},
  132. success(res) {
  133. if (res.data.errcode == 0) {
  134. that.setData({
  135. form: res.data.data,
  136. });
  137. } else {
  138. wx.showToast({
  139. title: res.data.errmsg,
  140. icon: 'none',
  141. duration: 2000
  142. })
  143. }
  144. }
  145. })
  146. },
  147. fail: res => {
  148. return wx.redirectTo({ url: '/pages/login/index', })
  149. }
  150. })
  151. },
  152. // 计算高度
  153. searchHeight: function () {
  154. let frameStyle = this.data.frameStyle;
  155. let client = app.globalData.client;
  156. let infoHeight = client.windowHeight;
  157. // 是否去掉状态栏
  158. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  159. // 是否减去底部菜单
  160. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  161. if (infoHeight) this.setData({ infoHeight: infoHeight })
  162. },
  163. /**
  164. * 生命周期函数--监听页面初次渲染完成
  165. */
  166. onReady: function () {
  167. },
  168. /**
  169. * 生命周期函数--监听页面显示
  170. */
  171. onShow: function () {
  172. },
  173. /**
  174. * 生命周期函数--监听页面隐藏
  175. */
  176. onHide: function () {
  177. },
  178. /**
  179. * 生命周期函数--监听页面卸载
  180. */
  181. onUnload: function () {
  182. },
  183. /**
  184. * 页面相关事件处理函数--监听用户下拉动作
  185. */
  186. onPullDownRefresh: function () {
  187. },
  188. /**
  189. * 页面上拉触底事件的处理函数
  190. */
  191. onReachBottom: function () {
  192. },
  193. /**
  194. * 用户点击右上角分享
  195. */
  196. onShareAppMessage: function () {
  197. }
  198. })