index.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. list: [
  14. {
  15. create_time: '2021-01-01',
  16. type: '早餐',
  17. status: '0',
  18. children: [
  19. { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' },
  20. { title: '香辣肉絲' }, { title: '香辣肉絲' },
  21. ]
  22. },
  23. {
  24. create_time: '2021-01-01',
  25. type: '早餐',
  26. status: '0',
  27. children: [
  28. { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' },
  29. ]
  30. },
  31. {
  32. create_time: '2021-01-01',
  33. type: '早餐',
  34. status: '0',
  35. children: [
  36. { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' }, { title: '香辣肉絲' },
  37. ]
  38. },
  39. ]
  40. },
  41. /**
  42. * 生命周期函数--监听页面加载
  43. */
  44. onLoad: function (options) {
  45. console.log(options.id);
  46. },
  47. /**
  48. * 生命周期函数--监听页面初次渲染完成
  49. */
  50. onReady: function () {
  51. },
  52. /**
  53. * 生命周期函数--监听页面显示
  54. */
  55. onShow: function () {
  56. // if (typeof this.getTabBar === 'function' &&
  57. // this.getTabBar()) {
  58. // this.getTabBar().setData({
  59. // selected: 3
  60. // })
  61. // }
  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. })