index.js 2.6 KB

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