index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. ],
  19. listend: [
  20. {
  21. id: '1', name: '朝阳区乒乓球比赛', head2: '/image/head2.png', head1: '/image/head1.png',fraction2: '0', groupname2: '马尼拉组', group: '第一组', fraction1: '0', site: '第一场', groupname1: '哈拉海组', match: '循环赛', week: '星期五', time: '13:00',
  22. state: '已结束', date: '2022.01.15', address: '吉林省长春市远创国际A座'
  23. }
  24. ],
  25. },
  26. tiao: function () {
  27. wx.navigateTo({
  28. url: '/pages/match/index',
  29. })
  30. },
  31. //标签页
  32. setup() {
  33. const activeName = ref('a');
  34. return { activeName };
  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. })