index.js 1.9 KB

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