detail.js 5.9 KB

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