通过URL Scheme方式进入小程序后,如何拿到后台传过来的参数?

小程序 文章 2021-01-26 10:41 3261 0 全屏看文

AI助手支持GPT4.0

通过URL Scheme方式进入小程序后,如何拿到后台传过来的参数?After entering the Mini Program through URL Scheme, how do I get the parameters passed from the background?

通过URL Scheme方式进入小程序后,如何拿到后台传过来的参数?

通过 URL Scheme 方式进入小程序,生成 Scheme 时传入的 jump_wxa 为 { path: "pages/test/test", query: "query=test"} (我查阅了社区其他人大致时这么传 query 的,即 key=value的形式),目前可以进入指定的 path 页面,但是在 test 页面 onLoad 的 options 里面直接用 options.query 获取不到 test,请问有踩过坑的大神教下如何在 options 中拿到传进来的参数吗,拿到的值是字符串还是对象,这个要发布的小程序才可以测试,开发者工具也没有提供模拟这种场景的1065,真蛋疼。

Enter the applet through URL scheme and generate the jump passed in when scheme is generated_ Wxa is {path: "pages / test / test,", Query: "query = test"} (I looked up the form of key = value that other people in the community spread about query in Zhishi). At present, you can enter the specified path page, but you can directly use it in the options of onload on the test page options.query You can't get the test. How can you get the test in options Do you get the parameters passed in? Is the value obtained a string or an object? This small program to be released can be tested. The developer tool does not provide 1065 to simulate this scenario. It's really painful.

回答:

brave:

打印一下options应该不难吧??

|G.XIAO|:

楼上正解

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
我登录小程序页面之后只有id 没有其他选项。
请问:提示“公众号名称被占用”,但搜索不到同名账号,该怎么处理?
没有找到哪里可以修改绑定公众号管理员?设置与开发,人员设置,修改功能在哪里?
应用类目是什么?没有选择应用类目影响哪些功能呢?
已达到开店上限是不是开不了店?
随便看看
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8389
问题? 7605
如何快速搭建抽奖助手小程序(无需代码知识) 5179
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6347
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5755
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5417
如何解决渲染层网络错误Failed to load media? 16671
小程序找号找回 释放昵称? 2606
我的小程序广告主收入5301,实际进账4406,是怎么回事呀? 2580
删除部分微信用户个人数据的通知,怎么删除? 5640