index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // components/home/index.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. homeActive: false
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad: function (options) {},
  13. setTouchMove: function (e) {
  14. var that = this
  15. if (e.touches[0].clientY < 545 && e.touches[0].clientY > 66) {
  16. that.setData({
  17. top: e.touches[0].clientY
  18. })
  19. }
  20. },
  21. open: function () {
  22. this.setData({
  23. homeActive: !this.data.homeActive
  24. })
  25. },
  26. /**
  27. * 生命周期函数--监听页面初次渲染完成
  28. */
  29. onReady: function () {},
  30. /**
  31. * 生命周期函数--监听页面显示
  32. */
  33. onShow: function () {},
  34. /**
  35. * 生命周期函数--监听页面隐藏
  36. */
  37. onHide: function () {},
  38. /**
  39. * 生命周期函数--监听页面卸载
  40. */
  41. onUnload: function () {},
  42. /**
  43. * 页面相关事件处理函数--监听用户下拉动作
  44. */
  45. onPullDownRefresh: function () {},
  46. /**
  47. * 页面上拉触底事件的处理函数
  48. */
  49. onReachBottom: function () {},
  50. /**
  51. * 用户点击右上角分享
  52. */
  53. onShareAppMessage: function () {}
  54. })