index.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // pages/login/login.js
  2. import WxValidate from '../../utils/wxValidate'
  3. const app = getApp()
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. // 主体高度
  10. infoHeight: '',
  11. frameStyle: { useTop: true, name: '创建团队', leftArrow: true, useBar: false },
  12. form: {
  13. src: '/image/tou.png',
  14. ranks: '比赛第一名队',
  15. mechanism: '吉佳通达',
  16. type: ['乒乓球', '足球'],
  17. objectSex: [{ id: 0, name: '乒乓球' }, { id: 1, name: '足球' },],
  18. },
  19. lists: [
  20. {
  21. id: '1', text: '哈拉海队', logo: '/image/logo1.png', jian: '/image/jian.png '
  22. },
  23. {
  24. id: '1', text: '哈拉海队', logo: '/image/logo1.png', jian: '/image/jian.png '
  25. },
  26. {
  27. id: '1', text: '哈拉海队', logo: '/image/logo1.png', jian: '/image/jian.png '
  28. },
  29. {
  30. id: '1', text: '哈拉海队', logo: '/image/logo1.png', jian: '/image/jian.png '
  31. },
  32. {
  33. id: '1', text: '哈拉海队', logo: '/image/logo1.png', jian: '/image/jian.png '
  34. },
  35. {
  36. id: '1', text: '哈拉海队', logo: '/image/logo1.png', jian: '/image/jian.png '
  37. },
  38. {
  39. id: '1', text: '哈拉海队', logo: '/image/logo1.png', jian: '/image/jian.png '
  40. },
  41. ],
  42. index: 0,
  43. },
  44. //选择
  45. bindPickerChange: function (e) {
  46. console.log('picker发送选择改变,携带值为', e.detail.value)
  47. this.setData({
  48. index: e.detail.value
  49. })
  50. },
  51. back: function () {
  52. wx.navigateBack({ url: '/pages/me/index' })
  53. },
  54. //提交
  55. formSubmit: function (e) {
  56. console.log('form发生了submit事件,携带数据为:', e.detail.value)
  57. },
  58. /**
  59. * 生命周期函数--监听页面加载
  60. */
  61. onLoad: function (options) {
  62. // 计算高度
  63. this.searchHeight()
  64. },
  65. // 计算高度
  66. searchHeight: function () {
  67. let frameStyle = this.data.frameStyle;
  68. let client = app.globalData.client;
  69. // 减去状态栏
  70. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  71. // 是否减去底部菜单
  72. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  73. if (infoHeight) this.setData({ infoHeight: infoHeight })
  74. },
  75. /**
  76. * 生命周期函数--监听页面初次渲染完成
  77. */
  78. onReady: function () {
  79. },
  80. /**
  81. * 生命周期函数--监听页面显示
  82. */
  83. onShow: function () {
  84. },
  85. /**
  86. * 生命周期函数--监听页面隐藏
  87. */
  88. onHide: function () {
  89. },
  90. /**
  91. * 生命周期函数--监听页面卸载
  92. */
  93. onUnload: function () {
  94. },
  95. /**
  96. * 页面相关事件处理函数--监听用户下拉动作
  97. */
  98. onPullDownRefresh: function () {
  99. },
  100. /**
  101. * 页面上拉触底事件的处理函数
  102. */
  103. onReachBottom: function () {
  104. },
  105. /**
  106. * 用户点击右上角分享
  107. */
  108. onShareAppMessage: function () {
  109. }
  110. })