Page({
  // The initial data used for the first rendering of the page
  data: {
    text: "This is page data."
  },
  onLoad: function(options) {
    // Lifecycle callbacks - listen for page loads
  },
  onShow: function() {
    // Lifecycle callbacks - listen for page display
    console.log(this.route)// Page routing
  },
  onReady: function() {
    // Lifecycle callback - listen for the page to complete its first rendering
  },
  onHide: function() {
    // Lifecycle callbacks - listen for page hiding
  },
  onUnload: function() {
    // Lifecycle callbacks - listen for page unloads
  },
  onPullDownRefresh: function() {
    // Listen for the user to pull down
  },
  onReachBottom: function() {
    // A handler for the pull-down event on the page
  },
  onShareAppMessage: function (options) {
    // The user clicks on the upper right corner to forward
    if (options.from === 'button') {
      // from the page forward button
      console.log(res.target)
    }
    return {
      title: 'Custom Forwarding title'.path: '/page/user? id=123'}},onShareTimeline: function () {
    // Users click on the upper right corner to forward to moments
  },
  onAddToFavorites: function (options) {
    // The user clicks "Favorites" in the upper right corner
    // WebView page returns webviewUrl
    console.log('WebviewUrl: ', options.webviewUrl)
    return {
      title: 'Custom title'.imageUrl: 'http://demo.png'.query: 'name=xxx&age=xxx',}},onPageScroll: function(options) {
    // a page scroll event handler
  },
  onResize: function() {
    // Triggered when the page size changes
  },
  onTabItemTap(item) {
  	// If the current page is TAB, click TAB
    console.log(item.index)
    console.log(item.pagePath)
    console.log(item.text)
  },
  // Developers can add any function or data to the Object argument, which can be accessed using this in the page function
  
      
        Click me 
       handler function
  viewTap: function() {
    this.setData({
      text: 'Set some data for updating view.'
    }, function() {
      // this is setData callback})}})Copy the code