index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. frameStyle: { useTop: true, name: '创建比赛', leftArrow: true, useBar: false },
  10. // 主体高度
  11. infoHeight: '',
  12. date: '2018-01-01',//默认起始时间
  13. date2: '2018-01-24',//默认结束时间
  14. singledate: '2018-09-01',
  15. time: '12:01',
  16. multiIndex: [0,0],
  17. multiIndex1: [0,0],
  18. multiArray: [['循环制',''], ['单循环', '双循环', '四循环','']],
  19. multiArray1: [['淘汰制',''], ['单败淘汰', '双败淘汰', '交叉淘汰','']],
  20. },
  21. bindMultiPickerChange: function (e) {
  22. console.log('picker发送选择改变,携带值为', e.detail.value)
  23. this.setData({
  24. multiIndex: e.detail.value
  25. })
  26. },
  27. bindDateChange3: function(e) {
  28. console.log('picker发送选择改变,携带值为', e.detail.value)
  29. this.setData({
  30. singledate: e.detail.value
  31. })
  32. },
  33. bindTimeChange: function(e) {
  34. console.log('picker发送选择改变,携带值为', e.detail.value)
  35. this.setData({
  36. time: e.detail.value
  37. })
  38. },
  39. // 时间段选择
  40. bindDateChange(e) {
  41. let that = this;
  42. console.log(e.detail.value)
  43. that.setData({
  44. date: e.detail.value,
  45. })
  46. },
  47. bindDateChange2(e) {
  48. let that = this;
  49. that.setData({
  50. date2: e.detail.value,
  51. })
  52. },
  53. back: function () {
  54. wx.navigateBack({ url: '/pages/home/index' })
  55. },
  56. /**
  57. * 生命周期函数--监听页面加载
  58. */
  59. onLoad: function (options) {
  60. // 计算高度
  61. this.searchHeight()
  62. },
  63. // 计算高度
  64. searchHeight: function () {
  65. let frameStyle = this.data.frameStyle;
  66. let client = app.globalData.client;
  67. // 减去状态栏
  68. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  69. // 是否减去底部菜单
  70. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  71. if (infoHeight) this.setData({ infoHeight: infoHeight })
  72. },
  73. /**
  74. * 生命周期函数--监听页面初次渲染完成
  75. */
  76. onReady: function () {
  77. },
  78. /**
  79. * 生命周期函数--监听页面显示
  80. */
  81. onShow: function () {
  82. },
  83. /**
  84. * 生命周期函数--监听页面隐藏
  85. */
  86. onHide: function () {
  87. },
  88. /**
  89. * 生命周期函数--监听页面卸载
  90. */
  91. onUnload: function () {
  92. },
  93. /**
  94. * 页面相关事件处理函数--监听用户下拉动作
  95. */
  96. onPullDownRefresh: function () {
  97. },
  98. /**
  99. * 页面上拉触底事件的处理函数
  100. */
  101. onReachBottom: function () {
  102. },
  103. /**
  104. * 用户点击右上角分享
  105. */
  106. onShareAppMessage: function () {
  107. }
  108. })