index.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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/yun.jpg',
  10. frameStyle: { useTop: false, name: '比赛列表', leftArrow: false, useBar: false, tabSelectid: '0' },
  11. // 主体高度
  12. infoHeight: '',
  13. active: 1,
  14. list: [
  15. {
  16. id: '1', name: '经开区足球比赛', fraction2: '1', groupname2: '马尼拉老年组', group: '第二组', fraction1: '2', groupname1: '哈拉海队幼儿园', match: '循环淘汰赛', listbisai: [], head2: '/image/head2.png', head1: '/image/head1.png', state: '报名中', datestart: '2022.01.20', dateend: '2022.01.22', address: '吉林省长春市远创国际A座'
  17. }
  18. ],
  19. lists: [
  20. {
  21. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  22. },
  23. {
  24. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  25. },
  26. {
  27. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  28. },
  29. {
  30. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  31. },
  32. {
  33. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  34. },
  35. {
  36. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  37. },
  38. {
  39. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  40. },
  41. {
  42. id: '1', name: '参赛队伍名称', person: '20', head: '/image/tou.png'
  43. }
  44. ],
  45. listbang: [{
  46. id: 1,
  47. name: "哈拉海队幼儿组",
  48. head: '/image/head2.png',
  49. score1: "9",
  50. score2: "0",
  51. score0: "1"
  52. }, {
  53. id: 2,
  54. name: "哈拉海队幼儿组",
  55. head: '/image/head2.png',
  56. score1: "1",
  57. score2: "0",
  58. score0: "1"
  59. }, {
  60. id: 3,
  61. name: "哈拉海队幼儿组",
  62. head: '/image/head2.png',
  63. score1: "1",
  64. score2: "0",
  65. score0: "1"
  66. }, {
  67. id: 4,
  68. name: "哈拉海队幼儿组",
  69. head: '/image/head2.png',
  70. score1: "1",
  71. score2: "1",
  72. score0: "1"
  73. }],
  74. listbisai: [
  75. {
  76. id: '1', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '0', groupname2: '马尼拉组', fraction1: '0', site: '第一场', groupname1: '哈拉海组', time: '13:00', date: '01.15', start: '未开始'
  77. },
  78. {
  79. id: '1', head2: '/image/head2.png', head1: '/image/head1.png', fraction2: '0', groupname2: '马尼拉组', fraction1: '0', site: '第一场', groupname1: '哈拉海组', time: '13:00', date: '01.15', start: '已结束'
  80. }
  81. ],
  82. },
  83. back: function () {
  84. wx.navigateBack({ url: '/pages/home/index' })
  85. },
  86. tabPath(e) {
  87. let query = e.detail.detail;
  88. if (query) wx.redirectTo({ url: `/pages/${query}/index` })
  89. },
  90. /**
  91. * 生命周期函数--监听页面加载
  92. */
  93. onLoad: function (options) {
  94. // 计算高度
  95. this.searchHeight()
  96. },
  97. // 计算高度
  98. searchHeight: function () {
  99. let frameStyle = this.data.frameStyle;
  100. let client = app.globalData.client;
  101. let infoHeight = client.windowHeight;
  102. // 减去状态栏
  103. if (frameStyle.useTop) infoHeight = infoHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2)
  104. // 是否减去底部菜单
  105. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  106. if (infoHeight) this.setData({ infoHeight: infoHeight })
  107. },
  108. /**
  109. * 生命周期函数--监听页面初次渲染完成
  110. */
  111. onReady: function () {
  112. },
  113. /**
  114. * 生命周期函数--监听页面显示
  115. */
  116. onShow: function () {
  117. },
  118. /**
  119. * 生命周期函数--监听页面隐藏
  120. */
  121. onHide: function () {
  122. },
  123. /**
  124. * 生命周期函数--监听页面卸载
  125. */
  126. onUnload: function () {
  127. },
  128. /**
  129. * 页面相关事件处理函数--监听用户下拉动作
  130. */
  131. onPullDownRefresh: function () {
  132. },
  133. /**
  134. * 页面上拉触底事件的处理函数
  135. */
  136. onReachBottom: function () {
  137. },
  138. /**
  139. * 用户点击右上角分享
  140. */
  141. onShareAppMessage: function () {
  142. }
  143. })