index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // nova-tourism/pages/my/my-wallet/index.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. statusBarHeight: 0,
  8. screenHeight: 0,
  9. customHeight: 0,
  10. bottomNavHeight: 0,
  11. contentHeight: 0,
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. const systemInfo = wx.getSystemInfoSync();
  18. const statusBarHeight = systemInfo.statusBarHeight || 0;
  19. const screenHeight = systemInfo.screenHeight || 0;
  20. const custom = wx.getMenuButtonBoundingClientRect();
  21. const customHeight = custom.height + 10 + 2 || 0;
  22. const bottomNavHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom || 0;
  23. const contentHeight = (screenHeight - bottomNavHeight - statusBarHeight - customHeight) * 750 / systemInfo.windowWidth;
  24. this.setData({
  25. statusBarHeight,
  26. screenHeight,
  27. customHeight,
  28. bottomNavHeight,
  29. contentHeight
  30. });
  31. },
  32. /**
  33. * 生命周期函数--监听页面初次渲染完成
  34. */
  35. onReady: function () {
  36. },
  37. /**
  38. * 生命周期函数--监听页面显示
  39. */
  40. onShow: function () {
  41. },
  42. /**
  43. * 生命周期函数--监听页面隐藏
  44. */
  45. onHide: function () {
  46. },
  47. /**
  48. * 生命周期函数--监听页面卸载
  49. */
  50. onUnload: function () {
  51. },
  52. /**
  53. * 页面相关事件处理函数--监听用户下拉动作
  54. */
  55. onPullDownRefresh: function () {
  56. },
  57. /**
  58. * 页面上拉触底事件的处理函数
  59. */
  60. onReachBottom: function () {
  61. },
  62. /**
  63. * 用户点击右上角分享
  64. */
  65. onShareAppMessage: function () {
  66. }
  67. })