| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- // pages/home/home.js
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- name:"图图",
- users: "小明",
- list:[
- {
- id:1,
- name:"孙悟空",
- desc:"金箍棒"
- },
- {
- id:2,
- name:"猪八戒",
- desc:"九齿钉耙"
- },
- {
- id:3,
- name:"图图",
- desc:"翻斗花园"
- }
- ],
- score: 50,
- background: ['demo-text-1', 'demo-text-2', 'demo-text-3'],
- indicatorDots: true,
- vertical: false,
- autoplay: true,
- interval: 2000,
- duration: 500
- },
- handleChange: function() {
- console.log("触碰了")
- this.setData({
- name:"哆啦A梦"
- })
- },
- goDetail(event) {
- console.log('x',event)
- wx.navigateTo({
- url: `/pages/detail/detail?id=${event.target.dataset.id}`,
- })
- },
- handleRead() {
- console.log(wx.getStorageSync('username'))
- },
- handleShow() {
- // wx.showToast({
- // title: '你好',
- // icon:'error'
- // })
- wx.setStorageSync('username', '小强')
- },
- handleJump() {
- console.log("你好")
- // wx.navigateTo({
- // url: '/pages/detail/detail',
- // })
- // wx.redirectTo({
- // url: '/pages/detail/detail',
- // })
- // wx.switchTab({
- // url: '/pages/list/list',
- // })
- wx.reLaunch({
- url: '/pages/list/list',
- })
- },
- handleInput(e) {
- // console.log(e,'eeee')
- const key = e.detail.value;
- this.setData({
- users: key
- })
- console.log(this.data.users,'sss')
- },
- handleChange(e) {
- console.log(e)
- },
- handleScore:function() {
- console.log(this.data.score,'分数')
- this.setData({
- score: this.data.score + 10
- })
- },
- handleBox: function() {
- console.log("box")
- },
- handleBox1: function() {
- console.log("box1")
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- console.log("111")
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- console.log("222")
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- console.log("333")
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- console.log("444")
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- console.log("555")
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- console.log("666")
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|