index.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. // team_id: '234', // 团队id
  14. // team_name: '我是第一队', // 团队名称
  15. // create_user: '李铁蛋', // 团队创建人
  16. // create_id: '23455', // 团队创建人id
  17. // apply_time: '', // 申请时间
  18. // resaon: '', // 解散团队原因
  19. },
  20. },
  21. back: function () {
  22. wx.navigateBack({ url: '/pages/me/index' })
  23. },
  24. //提交
  25. formSubmit: function (e) {
  26. console.log('form发生了submit事件,携带数据为:', e.detail.value)
  27. },
  28. /**
  29. * 生命周期函数--监听页面加载
  30. */
  31. onLoad: function (options) {
  32. // 计算高度
  33. this.searchHeight();
  34. },
  35. // 计算高度
  36. searchHeight: function () {
  37. let frameStyle = this.data.frameStyle;
  38. let client = app.globalData.client;
  39. // 减去状态栏
  40. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  41. // 是否减去底部菜单
  42. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  43. if (infoHeight) this.setData({ infoHeight: infoHeight })
  44. },
  45. /**
  46. * 生命周期函数--监听页面初次渲染完成
  47. */
  48. onReady: function () {
  49. },
  50. /**
  51. * 生命周期函数--监听页面显示
  52. */
  53. onShow: function () {
  54. },
  55. /**
  56. * 生命周期函数--监听页面隐藏
  57. */
  58. onHide: function () {
  59. },
  60. /**
  61. * 生命周期函数--监听页面卸载
  62. */
  63. onUnload: function () {
  64. },
  65. /**
  66. * 页面相关事件处理函数--监听用户下拉动作
  67. */
  68. onPullDownRefresh: function () {
  69. },
  70. /**
  71. * 页面上拉触底事件的处理函数
  72. */
  73. onReachBottom: function () {
  74. },
  75. /**
  76. * 用户点击右上角分享
  77. */
  78. onShareAppMessage: function () {
  79. }
  80. })