index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. hasindex:3, //当前选择菜单的id
  10. frameStyle: { useTop: true, name: '团队排名', leftArrow: true, useBar: false },
  11. // 主体高度
  12. infoHeight: '',
  13. list: [{
  14. id: 1,
  15. name: "哈拉海队幼儿组",
  16. head: '/image/head2.png',
  17. score1: "9",
  18. score2: "0"
  19. }, {
  20. id: 2,
  21. name: "哈拉海队幼儿组",
  22. head: '/image/head2.png',
  23. score1: "1",
  24. score2: "0"
  25. }, {
  26. id: 3,
  27. name: "哈拉海队幼儿组",
  28. head: '/image/head2.png',
  29. score1: "1",
  30. score2: "0"
  31. }, {
  32. id: 4,
  33. name: "哈拉海队幼儿组",
  34. head: '/image/head2.png',
  35. score1: "1",
  36. score2: "1"
  37. }],
  38. lists: [{
  39. id: 1,
  40. name: "哈拉海队幼儿组",
  41. head: '/image/head2.png',
  42. score: "9",
  43. }, {
  44. id: 2,
  45. name: "哈拉海队幼儿组",
  46. head: '/image/head2.png',
  47. score: "1",
  48. }, {
  49. id: 3,
  50. name: "哈拉海队幼儿组",
  51. head: '/image/head2.png',
  52. score: "1",
  53. }, {
  54. id: 4,
  55. name: "哈拉海队幼儿组",
  56. head: '/image/head2.png',
  57. score: "1",
  58. }],
  59. },
  60. back: function () {
  61. wx.navigateBack({ url: '/pages/home/index' })
  62. },
  63. /**
  64. * 生命周期函数--监听页面加载
  65. */
  66. onLoad: function (options) {
  67. // 计算高度
  68. this.searchHeight()
  69. },
  70. // 计算高度
  71. searchHeight: function () {
  72. let frameStyle = this.data.frameStyle;
  73. let client = app.globalData.client;
  74. // 减去状态栏
  75. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  76. // 是否减去底部菜单
  77. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  78. if (infoHeight) this.setData({ infoHeight: infoHeight })
  79. },
  80. /**
  81. * 生命周期函数--监听页面初次渲染完成
  82. */
  83. onReady: function () {
  84. },
  85. /**
  86. * 生命周期函数--监听页面显示
  87. */
  88. onShow: function () {
  89. },
  90. /**
  91. * 生命周期函数--监听页面隐藏
  92. */
  93. onHide: function () {
  94. },
  95. /**
  96. * 生命周期函数--监听页面卸载
  97. */
  98. onUnload: function () {
  99. },
  100. /**
  101. * 页面相关事件处理函数--监听用户下拉动作
  102. */
  103. onPullDownRefresh: function () {
  104. },
  105. /**
  106. * 页面上拉触底事件的处理函数
  107. */
  108. onReachBottom: function () {
  109. },
  110. /**
  111. * 用户点击右上角分享
  112. */
  113. onShareAppMessage: function () {
  114. }
  115. })