index.js 1.9 KB

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