index.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. console.log('form发生了submit事件,携带数据为:', e.detail.value)
  59. this.setData({
  60. showModal: false
  61. }),
  62. wx.showToast({
  63. title: '保存成功',
  64. icon: 'success',
  65. duration: 2000
  66. })
  67. },
  68. back: function () {
  69. wx.navigateBack({ url: '/pages/me/index' })
  70. },
  71. //显示对话框
  72. clickme: function () {
  73. this.setData({
  74. showModal: true
  75. })
  76. },
  77. preventTouchMove: function () {
  78. },
  79. //关闭弹窗
  80. go: function () {
  81. this.setData({
  82. showModal: false
  83. })
  84. },
  85. /**
  86. * 生命周期函数--监听页面加载
  87. */
  88. onLoad: function (options) {
  89. // 计算高度
  90. this.searchHeight()
  91. },
  92. // 计算高度
  93. searchHeight: function () {
  94. let frameStyle = this.data.frameStyle;
  95. let client = app.globalData.client;
  96. // 减去状态栏
  97. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  98. // 是否减去底部菜单
  99. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  100. if (infoHeight) this.setData({ infoHeight: infoHeight })
  101. },
  102. /**
  103. * 生命周期函数--监听页面初次渲染完成
  104. */
  105. onReady: function () {
  106. },
  107. /**
  108. * 生命周期函数--监听页面显示
  109. */
  110. onShow: function () {
  111. },
  112. /**
  113. * 生命周期函数--监听页面隐藏
  114. */
  115. onHide: function () {
  116. },
  117. /**
  118. * 生命周期函数--监听页面卸载
  119. */
  120. onUnload: function () {
  121. },
  122. /**
  123. * 页面相关事件处理函数--监听用户下拉动作
  124. */
  125. onPullDownRefresh: function () {
  126. },
  127. /**
  128. * 页面上拉触底事件的处理函数
  129. */
  130. onReachBottom: function () {
  131. },
  132. /**
  133. * 用户点击右上角分享
  134. */
  135. onShareAppMessage: function () {
  136. }
  137. })