index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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: true, name: '我的团队', leftArrow: false, useBar: true },
  10. // 主体高度
  11. infoHeight: '',
  12. src: '/image/team.png',
  13. },
  14. tabPath(e) {
  15. let query = e.detail.detail;
  16. if (query) wx.redirectTo({ url: `/pages/${query}/index` })
  17. },
  18. /**
  19. * 生命周期函数--监听页面加载
  20. */
  21. onLoad: function (options) {
  22. // 计算高度
  23. this.searchHeight()
  24. },
  25. // 计算高度
  26. searchHeight: function () {
  27. let frameStyle = this.data.frameStyle;
  28. let client = app.globalData.client;
  29. // 减去状态栏
  30. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  31. // 是否减去底部菜单
  32. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  33. if (infoHeight) this.setData({ infoHeight: infoHeight })
  34. },
  35. /**
  36. * 生命周期函数--监听页面初次渲染完成
  37. */
  38. onReady: function () {
  39. },
  40. /**
  41. * 生命周期函数--监听页面显示
  42. */
  43. onShow: function () {
  44. },
  45. /**
  46. * 生命周期函数--监听页面隐藏
  47. */
  48. onHide: function () {
  49. },
  50. /**
  51. * 生命周期函数--监听页面卸载
  52. */
  53. onUnload: function () {
  54. },
  55. /**
  56. * 页面相关事件处理函数--监听用户下拉动作
  57. */
  58. onPullDownRefresh: function () {
  59. },
  60. /**
  61. * 页面上拉触底事件的处理函数
  62. */
  63. onReachBottom: function () {
  64. },
  65. /**
  66. * 用户点击右上角分享
  67. */
  68. onShareAppMessage: function () {
  69. }
  70. })