layout.js 1.8 KB

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