index.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // pages/home/index.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. height: app.globalData.height * 2 + 25,
  9. windowHeight: app.globalData.windowHeight,
  10. navbarData: {
  11. name: '我的'
  12. },
  13. },
  14. // 跳转页面
  15. routeBtn: function (e) {
  16. let type = e.currentTarget.dataset.type;
  17. if (type == '1') {
  18. wx.redirectTo({
  19. url: `/pages/history/index?openid=${app.globalData.wxInfo.openid}`
  20. })
  21. } else if (type == '2') {
  22. wx.redirectTo({
  23. url: '/pages/login/index'
  24. })
  25. }
  26. },
  27. /**
  28. * 生命周期函数--监听页面加载
  29. */
  30. onLoad: function (options) {
  31. },
  32. /**
  33. * 生命周期函数--监听页面初次渲染完成
  34. */
  35. onReady: function () {
  36. },
  37. /**
  38. * 生命周期函数--监听页面显示
  39. */
  40. onShow: function () {
  41. if (typeof this.getTabBar === 'function' &&
  42. this.getTabBar()) {
  43. this.getTabBar().setData({
  44. selected: 3
  45. })
  46. }
  47. },
  48. /**
  49. * 生命周期函数--监听页面隐藏
  50. */
  51. onHide: function () {
  52. },
  53. /**
  54. * 生命周期函数--监听页面卸载
  55. */
  56. onUnload: function () {
  57. },
  58. /**
  59. * 页面相关事件处理函数--监听用户下拉动作
  60. */
  61. onPullDownRefresh: function () {
  62. },
  63. /**
  64. * 页面上拉触底事件的处理函数
  65. */
  66. onReachBottom: function () {
  67. },
  68. /**
  69. * 用户点击右上角分享
  70. */
  71. onShareAppMessage: function () {
  72. }
  73. })