home.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // pages/home/home.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. commentPage: {
  8. pageNum: 1,
  9. //一个页面一次请求获取多少,展示多少
  10. pageSize: 10
  11. },
  12. commentList: [],
  13. },
  14. // init() {
  15. // getCommentList(this.commentPage).then(
  16. // (res) => {
  17. // // code message data
  18. // const {data} = res
  19. // this.setData({
  20. // commentList : data
  21. // })
  22. // }
  23. // ).catch(
  24. // (err) => {
  25. // console.log(err);
  26. // //处理错误状态
  27. // }
  28. // ).finally(
  29. // () => {
  30. // }
  31. // )
  32. // },
  33. /**
  34. * 生命周期函数--监听页面加载
  35. */
  36. // onLoad(options) {
  37. // this.init()
  38. // },
  39. /**
  40. * 生命周期函数--监听页面初次渲染完成
  41. */
  42. onReady() {
  43. },
  44. /**
  45. * 生命周期函数--监听页面显示
  46. */
  47. onShow() {
  48. },
  49. /**
  50. * 生命周期函数--监听页面隐藏
  51. */
  52. onHide() {
  53. },
  54. /**
  55. * 生命周期函数--监听页面卸载
  56. */
  57. onUnload() {
  58. },
  59. /**
  60. * 页面相关事件处理函数--监听用户下拉动作
  61. */
  62. onPullDownRefresh() {
  63. },
  64. /**
  65. * 页面上拉触底事件的处理函数
  66. */
  67. onReachBottom() {
  68. },
  69. /**
  70. * 用户点击右上角分享
  71. */
  72. onShareAppMessage() {
  73. }
  74. })