home.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // pages/home/home.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. name:"图图",
  8. list:[
  9. {
  10. name:"图图",
  11. age:3
  12. },
  13. {
  14. name:"Lucy",
  15. age:13
  16. },
  17. {
  18. name:"Tom",
  19. age:22
  20. }
  21. ],
  22. age: 19,
  23. background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
  24. indicatorDots: true,
  25. vertical: false,
  26. autoplay: false,
  27. interval: 2000,
  28. duration: 500
  29. },
  30. handleBox: function() {
  31. console.log("box")
  32. },
  33. handleBox1: function(event) {
  34. console.log(event,'wwww')
  35. console.log("box1")
  36. // event.stopPropagation();
  37. // event.cancleBubble = true;
  38. // event.preventDefault();
  39. // event.returnValue = false;
  40. },
  41. /**
  42. * 生命周期函数--监听页面加载
  43. * 页面加载时触发 一个页面只会调用一次
  44. */
  45. onLoad(options) {
  46. console.log("1")
  47. },
  48. /**
  49. * 生命周期函数--监听页面初次渲染完成
  50. * 一个页面只会触发一次
  51. */
  52. onReady() {
  53. console.log("2")
  54. },
  55. /**
  56. * 生命周期函数--监听页面显示
  57. * 页面显示 切入/切除时触发
  58. * 触发n次
  59. */
  60. onShow() {
  61. console.log('3')
  62. },
  63. /**
  64. * 生命周期函数--监听页面隐藏
  65. */
  66. onHide() {
  67. console.log("4");
  68. },
  69. /**
  70. * 生命周期函数--监听页面卸载
  71. */
  72. onUnload() {
  73. console.log("5")
  74. },
  75. /**
  76. * 页面相关事件处理函数--监听用户下拉动作
  77. */
  78. onPullDownRefresh() {
  79. console.log("6")
  80. },
  81. /**
  82. * 页面上拉触底事件的处理函数
  83. */
  84. onReachBottom() {
  85. },
  86. /**
  87. * 用户点击右上角分享
  88. */
  89. onShareAppMessage() {
  90. }
  91. })