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

小程序 文章 2021-01-26 10:41 3256 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群

相关文章
为何在开发者工具调佣wx.getUserInfo无法弹出弹框?
如何创建小程序?
请教微信小程序如何获取当前用户更换了手机?
捕鱼小游戏开通虚拟支付提交自审报告和支付承诺函逾期了,补充提交多次未回复,怎么联系对应的负责人?
服务商入驻商户被驳回,显示商户资质存在风险,暂不支持入驻。。
随便看看
微信公众号免300认证教程 5047
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 4364
小程序广告组件通过审核,但是小程序内没有显示广告? 4339
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8254
问题? 7472
如何快速搭建抽奖助手小程序(无需代码知识) 5150
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6208
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5720
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5294
如何解决渲染层网络错误Failed to load media? 16639