通过朋友圈进入小程序“单页”时,如何获取参数 query?

小程序 文章 2020-08-04 16:41 835 0 全屏看文

AI助手支持GPT4.0

通过朋友圈进入小程序“单页”时,如何获取参数 query?

比如我设置分享到朋友圈的 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?

回答:

Admin²⁰²⁰:

onLoad里获取

onLoad(options){

console.log("params:",options);

}

正周:

请仔细查看文档

https://developers.weixin.qq.com/miniprogram/deveference/api/Page.html#onShareTimeline


没path参数只有query参数,表示路径“?”后的参数

若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人

o0o有脾气的酸奶:

query: pages/index/index?testQuery=test

若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人

👀:??在哪里能获取到 query 呢?单页中?还是从单页跳转小程序之后,
o0o有脾气的酸奶:pages/index/index.js的onLoad

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
自己想开发小程序,有哪位大神帮帮忙,想自己动手学学.好学吗?
为什么真机调试websocket连接error 而在开发者工具上可以?
scroll-view 的 skip-hidden-item-layout属性无效?
小程序的数据安全如何?
开发者工具出现无法预览和真机调试
随便看看
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 7471
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 6793