details.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. let infoHeight = client.windowHeight;
  67. // 是否去掉状态栏
  68. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  69. // 是否减去底部菜单
  70. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  71. if (infoHeight) this.setData({ infoHeight: infoHeight })
  72. },
  73. /**
  74. * 生命周期函数--监听页面初次渲染完成
  75. */
  76. onReady: function () {
  77. },
  78. /**
  79. * 生命周期函数--监听页面显示
  80. */
  81. onShow: function () {
  82. },
  83. /**
  84. * 生命周期函数--监听页面隐藏
  85. */
  86. onHide: function () {
  87. },
  88. /**
  89. * 生命周期函数--监听页面卸载
  90. */
  91. onUnload: function () {
  92. },
  93. /**
  94. * 页面相关事件处理函数--监听用户下拉动作
  95. */
  96. onPullDownRefresh: function () {
  97. },
  98. /**
  99. * 页面上拉触底事件的处理函数
  100. */
  101. onReachBottom: function () {
  102. },
  103. /**
  104. * 用户点击右上角分享
  105. */
  106. onShareAppMessage: function () {
  107. }
  108. })