list.js 1.7 KB

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