index.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. tiao: function () {
  37. wx.navigateTo({
  38. url: '/pages/list/index',
  39. })
  40. },
  41. xun: function () {
  42. wx.navigateTo({
  43. url: '/pages/match/detail',
  44. })
  45. },
  46. tabPath(e) {
  47. let query = e.detail.detail;
  48. if (query) wx.redirectTo({ url: `/pages/${query}/index` })
  49. },
  50. /**
  51. * 生命周期函数--监听页面加载
  52. */
  53. onLoad: function (options) {
  54. // 计算高度
  55. this.searchHeight()
  56. },
  57. // 计算高度
  58. searchHeight: function () {
  59. let frameStyle = this.data.frameStyle;
  60. let client = app.globalData.client;
  61. let infoHeight = client.windowHeight;
  62. // 减去状态栏
  63. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2)
  64. // 是否减去底部菜单
  65. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  66. if (infoHeight) this.setData({ infoHeight: infoHeight })
  67. },
  68. /**
  69. * 生命周期函数--监听页面初次渲染完成
  70. */
  71. onReady: function () {
  72. },
  73. /**
  74. * 生命周期函数--监听页面显示
  75. */
  76. onShow: function () {
  77. },
  78. /**
  79. * 生命周期函数--监听页面隐藏
  80. */
  81. onHide: function () {
  82. },
  83. /**
  84. * 生命周期函数--监听页面卸载
  85. */
  86. onUnload: function () {
  87. },
  88. /**
  89. * 页面相关事件处理函数--监听用户下拉动作
  90. */
  91. onPullDownRefresh: function () {
  92. },
  93. /**
  94. * 页面上拉触底事件的处理函数
  95. */
  96. onReachBottom: function () {
  97. },
  98. /**
  99. * 用户点击右上角分享
  100. */
  101. onShareAppMessage: function () {
  102. }
  103. })