小程序跳转到h5后,h5如何跳转会小程序?
@官方
h5跳转回小程序,官方文档是这样写的,
<!-- html --><script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>// javascriptwx.miniProgram.navigateTo({url: '/path/to/page'})wx.miniProgram.postMessage({ data: 'foo' })wx.miniProgram.postMessage({ data: {foo: 'bar'} })wx.miniProgram.getEnv(function(res) { console.log(res.miniprogram) // true }) |
但是https://www.w3cschool.cn/weixinkaifawendang/h8ap1qe5.html里面显示,必须要配置
wx.config({ debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId: 'wx218745d3a97a41e5', // 必填,公众号的唯一标识 timestamp: '', // 必填,生成签名的时间戳 nonceStr: '', // 必填,生成签名的随机串 signature: '',// 必填,签名,见附录1 jsApiList: [] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); |
才可以,请问到底需要什么样的步骤?直接 wx.miniProgram 是 undefined,有的是 config,ready 这些 function
