小程序之带参数跳转到tab页

wx.switchTab({
  url: '../../message/message/message',
})

//wx.switchTab url不能带参数 解决方法⬇️ (紫色表示非固定需要自己更改的)


app.js ⬇️
 globalData: {
   activityid: '', //需要传递的参数
   title: '' //需要传递的参数
 }
 
 传参页面.js ⬇️
  var app = getApp()
  
  issue: function(e){
    app.globalData.activityid = e.currentTarget.dataset.id  
    app.globalData.title = e.currentTarget.dataset.title
    wx.switchTab({
      url: '../../message/message/message',
    })
  }
 
 取参页面.js ⬇️
  var activityid = app.globalData.activityid
  var title = app.globalData.title 
 

 

posted @ 2018-12-27 10:38  大猫STUDIO  阅读(3524)  评论(0编辑  收藏  举报