分享小程序,跳转入小程序
BSL.ShareApplet('pageUrl','id','path','title','desc','imageUrl','callbackMethod')
调用前先要在微信开放平台App设置内关联好对应的小程序。
| 参数 | 必填 | 说明 |
|---|---|---|
| pageUrl | 是 | 兼容低版本的网页链接 |
| id | 是 | 小程序原始id |
| path | 是 | 小程序页面路径,本站打包填写:zsk_browser/pages/index/index?banner_url=网址 |
| title | 是 | 小程序消息title |
| desc | 是 | 小程序消息desc |
| imageUrl | 是 | 小程序消息封面图片,小于128k |
| callbackMethod | 是 | 自定义回调函数。回调值:1成功,0失败 |
例:
<script>
function Share(result){
if(result == '1'){
alert('分享成功');
}else{
alert('分享失败');
}
}
</script>
<a href="#" onclick="BSL.ShareApplet('http://www.bslyun.com','xxxxxx','zsk_browser/pages/index/index?banner_url=http%3a%2f%2fwww.baidu.com%2findex.php' ,'小程序标题' , '小程序介绍', 'http://open-qiniu.appbsl.com/sources/94830/329681/qr_test.png', 'Share')">分享小程序</a>
//以上小程序跳转地址是用我们平台打包小程库对应的地址。分享址要按你小程序填写。分享本站小程序时要跳转网址要对应的转ASCII码
如:http://www.baidu.com/index.php 转为http%3a%2f%2fwww.baidu.com%2findex.php
App关联
