detail.js 2.6 KB

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