schema拼接规则:
weixin://dl/business/?appid=*APPID*&path=*PATH*&query=*QUERY*&env_version=*ENV_VERSION*
相关文档:developers.weixin.qq.com/miniprogram…
其中,各个参数的定义如下:
- 【必填】APPID:通过明文 URL Scheme 打开小程序的 appid;
- 【必填】PATH:通过明文 URL Scheme 打开小程序的页面 path ,必须是已经发布的小程序存在的页面,不可携带 query;
- 【选填】QUERY:通过明文 URL Scheme 打开小程序的 query ,最大512个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~%`,需要url_encode;
- 【选填】ENV_VERSION:要打开的小程序版本,正式版为
release
,体验版为trial
,开发版为develop
,仅在微信外打开时生效。注意:若不填写,则默认打开正式版小程序。
通过明文 URL Scheme 打开小程序的场景值为 1286
案例1 问诊
weixin://dl/business/?appid=wx4a....81640&path=pages/redirect/redirect&query=channel%3Dcommon%26from%3Dcommon%26type%3DtoPage%26params%3Durl%253D%252Fpages%252Fconsultation%252Fconsultation%253FbizOrigin%253Dbuquan&env_version=release
⼩程序原始id : gh_1a8....40d7 | wx.......40(schema跳用这个)
路径 : /pages/redirect/redirect?channel%3Dcommon%26from%3Dcommon%26type%3DtoPage%26params%3Durl%253D%252Fpages%252Fconsultation%252Fconsultation%253FbizOrigin%253Dbuquan
案例2 券列表
weixin://dl/business/?appid=wx4a8fea5c56a81640&path=pages/redirect/redirect&query=channel%3Dcommon%26from%3Dcommon%26type%3DtoPage%26params%3Durl%253D%252Fpages%252FcouponList%252FcouponList%253FbizOrigin%253Dbuquan&env_version=release