index.js 2.4 KB

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