index.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. sex: ['男', '女'],
  17. objectSex: [{ id: 0, name: '男' }, { id: 1, name: '女' },],
  18. post: '后勤部长',
  19. phone: '12311111111',
  20. email: '123@qq.com',
  21. },
  22. index: 0,
  23. },
  24. //选择
  25. bindPickerChange: function (e) {
  26. console.log('picker发送选择改变,携带值为', e.detail.value)
  27. this.setData({
  28. index: e.detail.value
  29. })
  30. },
  31. back: function () {
  32. wx.navigateBack({ url: '/pages/me/index' })
  33. },
  34. //提交
  35. formSubmit: function (e) {
  36. console.log('form发生了submit事件,携带数据为:', e.detail.value)
  37. },
  38. /**
  39. * 生命周期函数--监听页面加载
  40. */
  41. onLoad: function (options) {
  42. // 计算高度
  43. this.searchHeight()
  44. },
  45. // 计算高度
  46. searchHeight: function () {
  47. let frameStyle = this.data.frameStyle;
  48. let client = app.globalData.client;
  49. // 减去状态栏
  50. let infoHeight = client.windowHeight - (client.statusBarHeight + client.getMenu.height + (client.getMenu.top - client.statusBarHeight) * 2);
  51. // 是否减去底部菜单
  52. if (frameStyle.useBar) infoHeight = infoHeight - 50;
  53. if (infoHeight) this.setData({ infoHeight: infoHeight })
  54. },
  55. /**
  56. * 生命周期函数--监听页面初次渲染完成
  57. */
  58. onReady: function () {
  59. },
  60. /**
  61. * 生命周期函数--监听页面显示
  62. */
  63. onShow: function () {
  64. },
  65. /**
  66. * 生命周期函数--监听页面隐藏
  67. */
  68. onHide: function () {
  69. },
  70. /**
  71. * 生命周期函数--监听页面卸载
  72. */
  73. onUnload: function () {
  74. },
  75. /**
  76. * 页面相关事件处理函数--监听用户下拉动作
  77. */
  78. onPullDownRefresh: function () {
  79. },
  80. /**
  81. * 页面上拉触底事件的处理函数
  82. */
  83. onReachBottom: function () {
  84. },
  85. /**
  86. * 用户点击右上角分享
  87. */
  88. onShareAppMessage: function () {
  89. }
  90. })