index.js 2.6 KB

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