details.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. ids: '',
  11. src: '/image/adimges.jpg',
  12. src1: '/image/head1.png',
  13. // 主体高度
  14. infoHeight: '',
  15. teamlist: [],
  16. },
  17. back: function () {
  18. wx.navigateBack({ url: '/pages/home/index' })
  19. },
  20. /**
  21. * 生命周期函数--监听页面加载
  22. */
  23. onLoad: function (options) {
  24. this.setData({ ids: options.id });
  25. // 计算高度
  26. this.searchHeight()
  27. // 监听用户是否登录
  28. this.watchLogin();
  29. },
  30. //验证用户是否登录
  31. watchLogin: function () {
  32. var that = this;
  33. wx.getStorage({
  34. key: 'token',
  35. success: res => {
  36. //查询数据
  37. wx.request({
  38. url: `${app.globalData.publicUrl}/courtAdmin/api/team/${this.data.ids}`, //接口地址
  39. method: 'get',
  40. data: '',
  41. success(res) {
  42. if (res.data.errcode == 0) {
  43. let datas = res.data.data
  44. that.setData({
  45. teamlist: datas,
  46. });
  47. } else {
  48. wx.showToast({
  49. title: res.data.errmsg,
  50. icon: 'none',
  51. duration: 2000
  52. })
  53. }
  54. }
  55. })
  56. },
  57. fail: res => {
  58. return wx.redirectTo({ url: '/pages/login/index', })
  59. }
  60. })
  61. },
  62. // 计算高度
  63. searchHeight: function () {
  64. let frameStyle = this.data.frameStyle;
  65. let client = app.globalData.client;
  66. // 减去状态栏
  67. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  68. // 是否减去底部菜单
  69. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  70. if (infoHeight) this.setData({ infoHeight: infoHeight })
  71. },
  72. /**
  73. * 生命周期函数--监听页面初次渲染完成
  74. */
  75. onReady: function () {
  76. },
  77. /**
  78. * 生命周期函数--监听页面显示
  79. */
  80. onShow: function () {
  81. },
  82. /**
  83. * 生命周期函数--监听页面隐藏
  84. */
  85. onHide: function () {
  86. },
  87. /**
  88. * 生命周期函数--监听页面卸载
  89. */
  90. onUnload: function () {
  91. },
  92. /**
  93. * 页面相关事件处理函数--监听用户下拉动作
  94. */
  95. onPullDownRefresh: function () {
  96. },
  97. /**
  98. * 页面上拉触底事件的处理函数
  99. */
  100. onReachBottom: function () {
  101. },
  102. /**
  103. * 用户点击右上角分享
  104. */
  105. onShareAppMessage: function () {
  106. }
  107. })