detail.js 6.0 KB

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