home.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // pages/home/home.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. name:"图图",
  8. users: "小明",
  9. list:[
  10. {
  11. name:"孙悟空",
  12. desc:"金箍棒"
  13. },
  14. {
  15. name:"猪八戒",
  16. desc:"九齿钉耙"
  17. }
  18. ],
  19. score: 50,
  20. background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
  21. indicatorDots: true,
  22. vertical: false,
  23. autoplay: true,
  24. interval: 2000,
  25. duration: 500
  26. },
  27. handleChange: function() {
  28. console.log("触碰了")
  29. this.setData({
  30. name:"哆啦A梦"
  31. })
  32. },
  33. handleInput(e) {
  34. // console.log(e,'eeee')
  35. const key = e.detail.value;
  36. this.setData({
  37. users: key
  38. })
  39. console.log(this.data.users,'sss')
  40. },
  41. handleChange(e) {
  42. console.log(e)
  43. },
  44. handleScore:function() {
  45. console.log(this.data.score,'分数')
  46. this.setData({
  47. score: this.data.score + 10
  48. })
  49. },
  50. handleBox: function() {
  51. console.log("box")
  52. },
  53. handleBox1: function() {
  54. console.log("box1")
  55. },
  56. /**
  57. * 生命周期函数--监听页面加载
  58. */
  59. onLoad(options) {
  60. console.log("111")
  61. },
  62. /**
  63. * 生命周期函数--监听页面初次渲染完成
  64. */
  65. onReady() {
  66. console.log("222")
  67. },
  68. /**
  69. * 生命周期函数--监听页面显示
  70. */
  71. onShow() {
  72. console.log("333")
  73. },
  74. /**
  75. * 生命周期函数--监听页面隐藏
  76. */
  77. onHide() {
  78. console.log("444")
  79. },
  80. /**
  81. * 生命周期函数--监听页面卸载
  82. */
  83. onUnload() {
  84. console.log("555")
  85. },
  86. /**
  87. * 页面相关事件处理函数--监听用户下拉动作
  88. */
  89. onPullDownRefresh() {
  90. console.log("666")
  91. },
  92. /**
  93. * 页面上拉触底事件的处理函数
  94. */
  95. onReachBottom() {
  96. },
  97. /**
  98. * 用户点击右上角分享
  99. */
  100. onShareAppMessage() {
  101. }
  102. })