list.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // pages/list/list.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. vase:"",
  8. userName:"",
  9. passWord:"",
  10. name:"懒羊羊",
  11. score:10,
  12. list: [{
  13. id: 1,
  14. name: '孙悟空'
  15. }, {
  16. id: 2,
  17. name: '猪八戒'
  18. }],
  19. background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
  20. indicatorDots: true,
  21. vertical: false,
  22. autoplay: false,
  23. interval: 2000,
  24. duration: 500
  25. },
  26. handleVase() {
  27. this.setData({
  28. vase:20
  29. })
  30. },
  31. handleSumbit(event) {
  32. // this.userName = event.detail.value.userName;
  33. this.setData({
  34. // ...event.detail.value
  35. userName: event.detail.value.userName
  36. })
  37. console.log("提交表单",this.data,event)
  38. },
  39. handleName() {
  40. wx.setStorageSync('name','孙悟空')
  41. console.log(wx.getStorageSync('age'))
  42. // wx.showToast({
  43. // title: '你好',
  44. // })
  45. // wx.showModal({
  46. // title: '哈哈哈',
  47. // content: '',
  48. // complete: (res) => {
  49. // if (res.cancel) {
  50. // console.log("取消")
  51. // }
  52. // if (res.confirm) {
  53. // console.log("确认")
  54. // }
  55. // }
  56. // })
  57. wx.showLoading({
  58. title: '加载中',
  59. })
  60. setTimeout(function () {
  61. wx.hideLoading()
  62. }, 2000)
  63. },
  64. /**
  65. * 生命周期函数--监听页面加载
  66. */
  67. onLoad(options) {
  68. },
  69. /**
  70. * 生命周期函数--监听页面初次渲染完成
  71. */
  72. onReady() {
  73. },
  74. /**
  75. * 生命周期函数--监听页面显示
  76. */
  77. onShow() {
  78. },
  79. /**
  80. * 生命周期函数--监听页面隐藏
  81. */
  82. onHide() {
  83. },
  84. /**
  85. * 生命周期函数--监听页面卸载
  86. */
  87. onUnload() {
  88. },
  89. /**
  90. * 页面相关事件处理函数--监听用户下拉动作
  91. */
  92. onPullDownRefresh() {
  93. },
  94. /**
  95. * 页面上拉触底事件的处理函数
  96. */
  97. onReachBottom() {
  98. },
  99. /**
  100. * 用户点击右上角分享
  101. */
  102. onShareAppMessage() {
  103. }
  104. })