比如我设置分享到朋友圈的 path 是 pages/index/index?testQuery=''test",然后通过朋友圈进入“单页”或者从“单页”进入小程序都解析不到 testQuery 参数。有什么办法能获取到吗?或者我们如何知道哪些用户是通过某一个人分享在朋友圈的链接点击进入的小程序?
比如我设置分享到朋友圈的 path 是 pages/index/index?testQuery=''test",然后通过朋友圈进入“单页”或者从“单页”进入小程序都解析不到 testQuery 参数。有什么办法能获取到吗?或者我们如何知道哪些用户是通过某一个人分享在朋友圈的链接点击进入的小程序?
For example, if I set the path shared to the circle of friends as pages / index / index? Testquery = "test", and then enter the "single page" through the circle of friends or enter the applet from the "single page", the testquery parameter cannot be resolved. Is there any way to get it? Or how do we know which apps are accessed by someone sharing links in their circle of friends?
回答:
请仔细查看文档
https://developers.weixin.qq.com/miniprogram/deveference/api/Page.html#onShareTimeline
没path参数只有query参数,表示路径“?”后的参数
若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人
query: pages/index/index?testQuery=test
若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人
onLoad里获取
onLoad(options){
console.log("params:",options);
}