detail.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. from: [],
  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. let datas = res.data.data
  116. that.setData({
  117. teamlist: datas,
  118. });
  119. } else {
  120. wx.showToast({
  121. title: res.data.errmsg,
  122. icon: 'none',
  123. duration: 2000
  124. })
  125. }
  126. }
  127. })
  128. //解散团队数据
  129. wx.request({
  130. url: `${app.globalData.publicUrl}/courtAdmin/api/dismissapply/` + ids, //接口地址
  131. method: 'get',
  132. data: {},
  133. success(res) {
  134. if (res.data.errcode == 0) {
  135. let datas = res.data.data
  136. that.setData({
  137. from: datas,
  138. });
  139. } else {
  140. wx.showToast({
  141. title: res.data.errmsg,
  142. icon: 'none',
  143. duration: 2000
  144. })
  145. }
  146. }
  147. })
  148. },
  149. fail: res => {
  150. return wx.redirectTo({ url: '/pages/login/index', })
  151. }
  152. })
  153. },
  154. // 计算高度
  155. searchHeight: function () {
  156. let frameStyle = this.data.frameStyle;
  157. let client = app.globalData.client;
  158. let infoHeight = client.windowHeight;
  159. // 是否去掉状态栏
  160. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  161. // 是否减去底部菜单
  162. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  163. if (infoHeight) this.setData({ infoHeight: infoHeight })
  164. },
  165. /**
  166. * 生命周期函数--监听页面初次渲染完成
  167. */
  168. onReady: function () {
  169. },
  170. /**
  171. * 生命周期函数--监听页面显示
  172. */
  173. onShow: function () {
  174. },
  175. /**
  176. * 生命周期函数--监听页面隐藏
  177. */
  178. onHide: function () {
  179. },
  180. /**
  181. * 生命周期函数--监听页面卸载
  182. */
  183. onUnload: function () {
  184. },
  185. /**
  186. * 页面相关事件处理函数--监听用户下拉动作
  187. */
  188. onPullDownRefresh: function () {
  189. },
  190. /**
  191. * 页面上拉触底事件的处理函数
  192. */
  193. onReachBottom: function () {
  194. },
  195. /**
  196. * 用户点击右上角分享
  197. */
  198. onShareAppMessage: function () {
  199. }
  200. })