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