index.js 3.3 KB

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