index.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. showModal: false,
  10. // 主体高度
  11. infoHeight: '',
  12. frameStyle: { useTop: true, name: '比赛信息', leftArrow: true, useBar: false },
  13. list: [{
  14. logo1: '/image/logo1.png',
  15. logo2: '/image/logo2.png',
  16. time: '1-15 15:00',
  17. ranks1: '哈拉海队幼儿园组',
  18. score1: '2',
  19. score2: '1',
  20. ranks2: '马尼拉老年组',
  21. state: '未开始',
  22. match: '第二届老年组小区板王比赛'
  23. }],
  24. list1: [{ team: '哈拉海队', logo1: '/image/logo1.png', },],
  25. lists1: [
  26. { id: '1', text: '小孩1', tou: '/image/tou.png' },
  27. { id: '1', text: '小孩2', tou: '/image/tou.png' },
  28. { id: '1', text: '小孩3', tou: '/image/tou.png' },
  29. { id: '1', text: '小孩4', tou: '/image/tou.png' },
  30. { id: '1', text: '小孩5', tou: '/image/tou.png' },
  31. ],
  32. list2: [{ team: '马尼拉队', logo2: '/image/logo2.png', },],
  33. lists2: [
  34. { id: '1', text: '老头1', tou: '/image/tou.png' },
  35. { id: '1', text: '老头2', tou: '/image/tou.png' },
  36. { id: '1', text: '老头3', tou: '/image/tou.png' },
  37. { id: '1', text: '老头4', tou: '/image/tou.png' },
  38. { id: '1', text: '老头5', tou: '/image/tou.png' },
  39. { id: '1', text: '老头6', tou: '/image/tou.png' },
  40. { id: '1', text: '老头7', tou: '/image/tou.png' },
  41. { id: '1', text: '老头8', tou: '/image/tou.png' },
  42. { id: '1', text: '老头9', tou: '/image/tou.png' },
  43. { id: '1', text: '老头10', tou: '/image/tou.png' },
  44. ],
  45. form: {
  46. logo1: '/image/logo1.png',
  47. team1: '哈拉海队',
  48. num1: '0',
  49. num2: '',
  50. logo2: '/image/logo2.png',
  51. team2: '马尼拉队',
  52. num3: '0',
  53. num4: '',
  54. }
  55. },
  56. //提交
  57. formSubmit: function (e) {
  58. this.setData({
  59. showModal: false
  60. }),
  61. wx.showToast({
  62. title: '保存成功',
  63. icon: 'success',
  64. duration: 2000
  65. })
  66. },
  67. back: function () {
  68. wx.navigateBack({ url: '/pages/me/index' })
  69. },
  70. //显示对话框
  71. clickme: function () {
  72. this.setData({
  73. showModal: true
  74. })
  75. },
  76. preventTouchMove: function () {
  77. },
  78. //关闭弹窗
  79. go: function () {
  80. this.setData({
  81. showModal: false
  82. })
  83. },
  84. /**
  85. * 生命周期函数--监听页面加载
  86. */
  87. onLoad: function (options) {
  88. // 计算高度
  89. this.searchHeight()
  90. },
  91. // 计算高度
  92. searchHeight: function () {
  93. let frameStyle = this.data.frameStyle;
  94. let client = app.globalData.client;
  95. // 减去状态栏
  96. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  97. // 是否减去底部菜单
  98. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  99. if (infoHeight) this.setData({ infoHeight: infoHeight })
  100. },
  101. /**
  102. * 生命周期函数--监听页面初次渲染完成
  103. */
  104. onReady: function () {
  105. },
  106. /**
  107. * 生命周期函数--监听页面显示
  108. */
  109. onShow: function () {
  110. },
  111. /**
  112. * 生命周期函数--监听页面隐藏
  113. */
  114. onHide: function () {
  115. },
  116. /**
  117. * 生命周期函数--监听页面卸载
  118. */
  119. onUnload: function () {
  120. },
  121. /**
  122. * 页面相关事件处理函数--监听用户下拉动作
  123. */
  124. onPullDownRefresh: function () {
  125. },
  126. /**
  127. * 页面上拉触底事件的处理函数
  128. */
  129. onReachBottom: function () {
  130. },
  131. /**
  132. * 用户点击右上角分享
  133. */
  134. onShareAppMessage: function () {
  135. }
  136. })