index.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. src: '/image/home.png',
  10. frameStyle: { useTop: false, name: '首页', leftArrow: false, useBar: true, tabSelectid: '0' },
  11. // 主体高度
  12. infoHeight: '',
  13. list: [
  14. {
  15. id: '1', name: '朝阳区乒乓球比赛', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '1', groupname2: '马尼拉老年组', group: '第一组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛', week: '星期五', time: '13:00',
  16. state: '进行中', listbisai: [
  17. {
  18. id: '1', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '1', groupname2: '马尼拉老年组', group: '第一组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛'
  19. }
  20. ], date: '2022.01.15', address: '吉林省长春市远创国际A座'
  21. },
  22. {
  23. id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛',
  24. week: '星期一', listbisai: [], head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '待比赛', date: '2022.01.20', address: '吉林省长春市远创国际A座'
  25. },
  26. {
  27. id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛',
  28. week: '星期一', listbisai: [], head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '报名中', date: '2022.01.20', address: '吉林省长春市远创国际A座'
  29. },
  30. {
  31. id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环赛',
  32. week: '星期一', listbisai: [], head2: '/image/head2.png', head1: '/image/head1.png', time: '09:00', state: '已结束', date: '2022.01.20', address: '吉林省长春市远创国际A座'
  33. },
  34. ],
  35. },
  36. tabPath(e) {
  37. let query = e.detail.detail;
  38. if (query) wx.redirectTo({ url: `/pages/${query}/index` })
  39. },
  40. /**
  41. * 生命周期函数--监听页面加载
  42. */
  43. onLoad: function (options) {
  44. // 计算高度
  45. this.searchHeight()
  46. },
  47. // 计算高度
  48. searchHeight: function () {
  49. let frameStyle = this.data.frameStyle;
  50. let client = app.globalData.client;
  51. let infoHeight = client.windowHeight;
  52. // 减去状态栏
  53. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2)
  54. // 是否减去底部菜单
  55. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  56. if (infoHeight) this.setData({ infoHeight: infoHeight })
  57. },
  58. /**
  59. * 生命周期函数--监听页面初次渲染完成
  60. */
  61. onReady: function () {
  62. },
  63. /**
  64. * 生命周期函数--监听页面显示
  65. */
  66. onShow: function () {
  67. },
  68. /**
  69. * 生命周期函数--监听页面隐藏
  70. */
  71. onHide: function () {
  72. },
  73. /**
  74. * 生命周期函数--监听页面卸载
  75. */
  76. onUnload: function () {
  77. },
  78. /**
  79. * 页面相关事件处理函数--监听用户下拉动作
  80. */
  81. onPullDownRefresh: function () {
  82. },
  83. /**
  84. * 页面上拉触底事件的处理函数
  85. */
  86. onReachBottom: function () {
  87. },
  88. /**
  89. * 用户点击右上角分享
  90. */
  91. onShareAppMessage: function () {
  92. }
  93. })