html方法要回到小程序原生页面的时候采用:

 

wx.miniProgram.navigateTo({
 
    url: '/pages/scenic/scenic_detail/scenic_detail'
 
})

  url:  / + app.json 里面要跳转的小程序页面的路径。

 

如果要传递参数到跳转到页面,则可以在url后面拼接,如要传递id和title:

wx.miniProgram.navigateTo({
 
    url: '/pages/scenic/scenic_detail/scenic_detail?id='+id+'&title='+title
 
})

  注: 要引入相关的js

<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>

  小程序原生页面接收传递的参数:

 onLoad: function (options) {
   console.log(options);
    this.title = options.title
    var scenicId = options.id; 
 }

  可以在 跳转 小程序 页 onload 接收到。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-07-08
  • 2021-10-18
  • 2021-05-11
猜你喜欢
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-11-20
  • 2021-10-13
  • 2021-05-20
相关资源
相似解决方案