WeixinJSBridge

来源:互联网 发布:linux视频播放器安装 编辑:程序博客网 时间:2024/06/03 22:08
<script type="text/javascript">document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {WeixinJSBridge.call('hideToolbar');  //隐藏右下面工具栏WeixinJSBridge.call('showToolbar'); //显示右下面工具栏WeixinJSBridge.call('hideOptionMenu'); //隐藏右上角按钮图标WeixinJSBridge.call('showOptionMenu'); //显示右上角三个点按钮window.shareData = {"imgUrl": "http://xxx.cn/wjspp/Public/Uploads/tximg/s","timeLineLink": "http://xxx.cn/wjspp/index.php/Mywmp/mywmp","sendFriendLink": "http://xxx.cn/wjspp/index.php/Mywmp/mywmp","tTitle": "title","tContent": "content","fTitle": "ftit","fContent": "fcon","wContent": "wcon"};//发送给好友WeixinJSBridge.on('menu:share:appmessage', function (argv) {WeixinJSBridge.invoke('sendAppMessage', {"img_url": window.shareData.imgUrl,// "img_width": "640",// "img_height": "640","link": window.shareData.sendFriendLink,"desc": window.shareData.fContent,"title": window.shareData.fTitle}, function (res) {alert('test');})});//分享到朋友圈WeixinJSBridge.on('menu:share:timeline', function (argv) {WeixinJSBridge.invoke('shareTimeline', {"img_url": window.shareData.imgUrl,"img_width": "640","img_height": "640","link": window.shareData.timeLineLink,"desc": window.shareData.tContent,"title": window.shareData.tTitle}, function (res) {alert('share');});});//分享到微博WeixinJSBridge.on('menu:share:weibo', function (argv) {WeixinJSBridge.invoke('shareWeibo', {"content": window.shareData.wContent,"url": window.shareData.weiboLink,}, function (res) {_report('weibo', res.err_msg);});});},false)</script>

0 0
原创粉丝点击