index.js 4.3 KB

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